diff options
author | Mike Snitzer <snitzer@redhat.com> | 2013-03-01 17:45:47 -0500 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2013-03-01 17:45:47 -0500 |
commit | 018cede93c987273071aed153b6d207e0af5e868 (patch) | |
tree | fc5c8b6c980a1a5b08a50719cb8e9f3b74bfe4af /drivers/md | |
parent | e4c938111f25dbbf2579e65ce4a7cb2d20a59308 (diff) |
dm persistent data: set some btree fn parms const
Mark some constant parameters constant in some dm-btree functions.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-thin-metadata.c | 12 | ||||
-rw-r--r-- | drivers/md/persistent-data/dm-btree.h | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c index 4d6e85367b84..00cee02f8fc9 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c | |||
@@ -280,7 +280,7 @@ static void unpack_block_time(uint64_t v, dm_block_t *b, uint32_t *t) | |||
280 | *t = v & ((1 << 24) - 1); | 280 | *t = v & ((1 << 24) - 1); |
281 | } | 281 | } |
282 | 282 | ||
283 | static void data_block_inc(void *context, void *value_le) | 283 | static void data_block_inc(void *context, const void *value_le) |
284 | { | 284 | { |
285 | struct dm_space_map *sm = context; | 285 | struct dm_space_map *sm = context; |
286 | __le64 v_le; | 286 | __le64 v_le; |
@@ -292,7 +292,7 @@ static void data_block_inc(void *context, void *value_le) | |||
292 | dm_sm_inc_block(sm, b); | 292 | dm_sm_inc_block(sm, b); |
293 | } | 293 | } |
294 | 294 | ||
295 | static void data_block_dec(void *context, void *value_le) | 295 | static void data_block_dec(void *context, const void *value_le) |
296 | { | 296 | { |
297 | struct dm_space_map *sm = context; | 297 | struct dm_space_map *sm = context; |
298 | __le64 v_le; | 298 | __le64 v_le; |
@@ -304,7 +304,7 @@ static void data_block_dec(void *context, void *value_le) | |||
304 | dm_sm_dec_block(sm, b); | 304 | dm_sm_dec_block(sm, b); |
305 | } | 305 | } |
306 | 306 | ||
307 | static int data_block_equal(void *context, void *value1_le, void *value2_le) | 307 | static int data_block_equal(void *context, const void *value1_le, const void *value2_le) |
308 | { | 308 | { |
309 | __le64 v1_le, v2_le; | 309 | __le64 v1_le, v2_le; |
310 | uint64_t b1, b2; | 310 | uint64_t b1, b2; |
@@ -318,7 +318,7 @@ static int data_block_equal(void *context, void *value1_le, void *value2_le) | |||
318 | return b1 == b2; | 318 | return b1 == b2; |
319 | } | 319 | } |
320 | 320 | ||
321 | static void subtree_inc(void *context, void *value) | 321 | static void subtree_inc(void *context, const void *value) |
322 | { | 322 | { |
323 | struct dm_btree_info *info = context; | 323 | struct dm_btree_info *info = context; |
324 | __le64 root_le; | 324 | __le64 root_le; |
@@ -329,7 +329,7 @@ static void subtree_inc(void *context, void *value) | |||
329 | dm_tm_inc(info->tm, root); | 329 | dm_tm_inc(info->tm, root); |
330 | } | 330 | } |
331 | 331 | ||
332 | static void subtree_dec(void *context, void *value) | 332 | static void subtree_dec(void *context, const void *value) |
333 | { | 333 | { |
334 | struct dm_btree_info *info = context; | 334 | struct dm_btree_info *info = context; |
335 | __le64 root_le; | 335 | __le64 root_le; |
@@ -341,7 +341,7 @@ static void subtree_dec(void *context, void *value) | |||
341 | DMERR("btree delete failed\n"); | 341 | DMERR("btree delete failed\n"); |
342 | } | 342 | } |
343 | 343 | ||
344 | static int subtree_equal(void *context, void *value1_le, void *value2_le) | 344 | static int subtree_equal(void *context, const void *value1_le, const void *value2_le) |
345 | { | 345 | { |
346 | __le64 v1_le, v2_le; | 346 | __le64 v1_le, v2_le; |
347 | memcpy(&v1_le, value1_le, sizeof(v1_le)); | 347 | memcpy(&v1_le, value1_le, sizeof(v1_le)); |
diff --git a/drivers/md/persistent-data/dm-btree.h b/drivers/md/persistent-data/dm-btree.h index a2cd50441ca1..fced8316bca2 100644 --- a/drivers/md/persistent-data/dm-btree.h +++ b/drivers/md/persistent-data/dm-btree.h | |||
@@ -58,21 +58,21 @@ struct dm_btree_value_type { | |||
58 | * somewhere.) This method is _not_ called for insertion of a new | 58 | * somewhere.) This method is _not_ called for insertion of a new |
59 | * value: It is assumed the ref count is already 1. | 59 | * value: It is assumed the ref count is already 1. |
60 | */ | 60 | */ |
61 | void (*inc)(void *context, void *value); | 61 | void (*inc)(void *context, const void *value); |
62 | 62 | ||
63 | /* | 63 | /* |
64 | * This value is being deleted. The btree takes care of freeing | 64 | * This value is being deleted. The btree takes care of freeing |
65 | * the memory pointed to by @value. Often the del function just | 65 | * the memory pointed to by @value. Often the del function just |
66 | * needs to decrement a reference count somewhere. | 66 | * needs to decrement a reference count somewhere. |
67 | */ | 67 | */ |
68 | void (*dec)(void *context, void *value); | 68 | void (*dec)(void *context, const void *value); |
69 | 69 | ||
70 | /* | 70 | /* |
71 | * A test for equality between two values. When a value is | 71 | * A test for equality between two values. When a value is |
72 | * overwritten with a new one, the old one has the dec method | 72 | * overwritten with a new one, the old one has the dec method |
73 | * called _unless_ the new and old value are deemed equal. | 73 | * called _unless_ the new and old value are deemed equal. |
74 | */ | 74 | */ |
75 | int (*equal)(void *context, void *value1, void *value2); | 75 | int (*equal)(void *context, const void *value1, const void *value2); |
76 | }; | 76 | }; |
77 | 77 | ||
78 | /* | 78 | /* |