diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2015-04-16 15:46:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-17 09:04:03 -0400 |
commit | 3568a13f4089aac90b3763a2b6c293cd2b638ec1 (patch) | |
tree | 9971fbde5b3eba646bf7df40b02fad09433be1e7 /fs | |
parent | 0de6d6b9a2ba21ae28b2420f6684021904833f68 (diff) |
nilfs2: unify type of key arguments in bmap interface
The type of key arguments in block mapping interface varies depending
on function. For instance, nilfs_bmap_lookup_at_level() takes "__u64"
for its key argument whereas nilfs_bmap_lookup() takes "unsigned
long".
This fits them to "__u64" to eliminate the variation.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nilfs2/alloc.c | 5 | ||||
-rw-r--r-- | fs/nilfs2/bmap.c | 17 | ||||
-rw-r--r-- | fs/nilfs2/bmap.h | 8 | ||||
-rw-r--r-- | fs/nilfs2/inode.c | 6 |
4 files changed, 16 insertions, 20 deletions
diff --git a/fs/nilfs2/alloc.c b/fs/nilfs2/alloc.c index 741fd02e0444..8df0f3b7839b 100644 --- a/fs/nilfs2/alloc.c +++ b/fs/nilfs2/alloc.c | |||
@@ -405,13 +405,14 @@ nilfs_palloc_rest_groups_in_desc_block(const struct inode *inode, | |||
405 | static int nilfs_palloc_count_desc_blocks(struct inode *inode, | 405 | static int nilfs_palloc_count_desc_blocks(struct inode *inode, |
406 | unsigned long *desc_blocks) | 406 | unsigned long *desc_blocks) |
407 | { | 407 | { |
408 | unsigned long blknum; | 408 | __u64 blknum; |
409 | int ret; | 409 | int ret; |
410 | 410 | ||
411 | ret = nilfs_bmap_last_key(NILFS_I(inode)->i_bmap, &blknum); | 411 | ret = nilfs_bmap_last_key(NILFS_I(inode)->i_bmap, &blknum); |
412 | if (likely(!ret)) | 412 | if (likely(!ret)) |
413 | *desc_blocks = DIV_ROUND_UP( | 413 | *desc_blocks = DIV_ROUND_UP( |
414 | blknum, NILFS_MDT(inode)->mi_blocks_per_desc_block); | 414 | (unsigned long)blknum, |
415 | NILFS_MDT(inode)->mi_blocks_per_desc_block); | ||
415 | return ret; | 416 | return ret; |
416 | } | 417 | } |
417 | 418 | ||
diff --git a/fs/nilfs2/bmap.c b/fs/nilfs2/bmap.c index aadbd0b5e3e8..c82f4361c1f9 100644 --- a/fs/nilfs2/bmap.c +++ b/fs/nilfs2/bmap.c | |||
@@ -152,9 +152,7 @@ static int nilfs_bmap_do_insert(struct nilfs_bmap *bmap, __u64 key, __u64 ptr) | |||
152 | * | 152 | * |
153 | * %-EEXIST - A record associated with @key already exist. | 153 | * %-EEXIST - A record associated with @key already exist. |
154 | */ | 154 | */ |
155 | int nilfs_bmap_insert(struct nilfs_bmap *bmap, | 155 | int nilfs_bmap_insert(struct nilfs_bmap *bmap, __u64 key, unsigned long rec) |
156 | unsigned long key, | ||
157 | unsigned long rec) | ||
158 | { | 156 | { |
159 | int ret; | 157 | int ret; |
160 | 158 | ||
@@ -191,19 +189,16 @@ static int nilfs_bmap_do_delete(struct nilfs_bmap *bmap, __u64 key) | |||
191 | return bmap->b_ops->bop_delete(bmap, key); | 189 | return bmap->b_ops->bop_delete(bmap, key); |
192 | } | 190 | } |
193 | 191 | ||
194 | int nilfs_bmap_last_key(struct nilfs_bmap *bmap, unsigned long *key) | 192 | int nilfs_bmap_last_key(struct nilfs_bmap *bmap, __u64 *keyp) |
195 | { | 193 | { |
196 | __u64 lastkey; | ||
197 | int ret; | 194 | int ret; |
198 | 195 | ||
199 | down_read(&bmap->b_sem); | 196 | down_read(&bmap->b_sem); |
200 | ret = bmap->b_ops->bop_last_key(bmap, &lastkey); | 197 | ret = bmap->b_ops->bop_last_key(bmap, keyp); |
201 | up_read(&bmap->b_sem); | 198 | up_read(&bmap->b_sem); |
202 | 199 | ||
203 | if (ret < 0) | 200 | if (ret < 0) |
204 | ret = nilfs_bmap_convert_error(bmap, __func__, ret); | 201 | ret = nilfs_bmap_convert_error(bmap, __func__, ret); |
205 | else | ||
206 | *key = lastkey; | ||
207 | return ret; | 202 | return ret; |
208 | } | 203 | } |
209 | 204 | ||
@@ -224,7 +219,7 @@ int nilfs_bmap_last_key(struct nilfs_bmap *bmap, unsigned long *key) | |||
224 | * | 219 | * |
225 | * %-ENOENT - A record associated with @key does not exist. | 220 | * %-ENOENT - A record associated with @key does not exist. |
226 | */ | 221 | */ |
227 | int nilfs_bmap_delete(struct nilfs_bmap *bmap, unsigned long key) | 222 | int nilfs_bmap_delete(struct nilfs_bmap *bmap, __u64 key) |
228 | { | 223 | { |
229 | int ret; | 224 | int ret; |
230 | 225 | ||
@@ -235,7 +230,7 @@ int nilfs_bmap_delete(struct nilfs_bmap *bmap, unsigned long key) | |||
235 | return nilfs_bmap_convert_error(bmap, __func__, ret); | 230 | return nilfs_bmap_convert_error(bmap, __func__, ret); |
236 | } | 231 | } |
237 | 232 | ||
238 | static int nilfs_bmap_do_truncate(struct nilfs_bmap *bmap, unsigned long key) | 233 | static int nilfs_bmap_do_truncate(struct nilfs_bmap *bmap, __u64 key) |
239 | { | 234 | { |
240 | __u64 lastkey; | 235 | __u64 lastkey; |
241 | int ret; | 236 | int ret; |
@@ -276,7 +271,7 @@ static int nilfs_bmap_do_truncate(struct nilfs_bmap *bmap, unsigned long key) | |||
276 | * | 271 | * |
277 | * %-ENOMEM - Insufficient amount of memory available. | 272 | * %-ENOMEM - Insufficient amount of memory available. |
278 | */ | 273 | */ |
279 | int nilfs_bmap_truncate(struct nilfs_bmap *bmap, unsigned long key) | 274 | int nilfs_bmap_truncate(struct nilfs_bmap *bmap, __u64 key) |
280 | { | 275 | { |
281 | int ret; | 276 | int ret; |
282 | 277 | ||
diff --git a/fs/nilfs2/bmap.h b/fs/nilfs2/bmap.h index b89e68076adc..9230d3335001 100644 --- a/fs/nilfs2/bmap.h +++ b/fs/nilfs2/bmap.h | |||
@@ -153,10 +153,10 @@ int nilfs_bmap_test_and_clear_dirty(struct nilfs_bmap *); | |||
153 | int nilfs_bmap_read(struct nilfs_bmap *, struct nilfs_inode *); | 153 | int nilfs_bmap_read(struct nilfs_bmap *, struct nilfs_inode *); |
154 | void nilfs_bmap_write(struct nilfs_bmap *, struct nilfs_inode *); | 154 | void nilfs_bmap_write(struct nilfs_bmap *, struct nilfs_inode *); |
155 | int nilfs_bmap_lookup_contig(struct nilfs_bmap *, __u64, __u64 *, unsigned); | 155 | int nilfs_bmap_lookup_contig(struct nilfs_bmap *, __u64, __u64 *, unsigned); |
156 | int nilfs_bmap_insert(struct nilfs_bmap *, unsigned long, unsigned long); | 156 | int nilfs_bmap_insert(struct nilfs_bmap *bmap, __u64 key, unsigned long rec); |
157 | int nilfs_bmap_delete(struct nilfs_bmap *, unsigned long); | 157 | int nilfs_bmap_delete(struct nilfs_bmap *bmap, __u64 key); |
158 | int nilfs_bmap_last_key(struct nilfs_bmap *, unsigned long *); | 158 | int nilfs_bmap_last_key(struct nilfs_bmap *bmap, __u64 *keyp); |
159 | int nilfs_bmap_truncate(struct nilfs_bmap *, unsigned long); | 159 | int nilfs_bmap_truncate(struct nilfs_bmap *bmap, __u64 key); |
160 | void nilfs_bmap_clear(struct nilfs_bmap *); | 160 | void nilfs_bmap_clear(struct nilfs_bmap *); |
161 | int nilfs_bmap_propagate(struct nilfs_bmap *, struct buffer_head *); | 161 | int nilfs_bmap_propagate(struct nilfs_bmap *, struct buffer_head *); |
162 | void nilfs_bmap_lookup_dirty_buffers(struct nilfs_bmap *, struct list_head *); | 162 | void nilfs_bmap_lookup_dirty_buffers(struct nilfs_bmap *, struct list_head *); |
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c index ab4987bc637f..07577cbe668a 100644 --- a/fs/nilfs2/inode.c +++ b/fs/nilfs2/inode.c | |||
@@ -106,7 +106,7 @@ int nilfs_get_block(struct inode *inode, sector_t blkoff, | |||
106 | err = nilfs_transaction_begin(inode->i_sb, &ti, 1); | 106 | err = nilfs_transaction_begin(inode->i_sb, &ti, 1); |
107 | if (unlikely(err)) | 107 | if (unlikely(err)) |
108 | goto out; | 108 | goto out; |
109 | err = nilfs_bmap_insert(ii->i_bmap, (unsigned long)blkoff, | 109 | err = nilfs_bmap_insert(ii->i_bmap, blkoff, |
110 | (unsigned long)bh_result); | 110 | (unsigned long)bh_result); |
111 | if (unlikely(err != 0)) { | 111 | if (unlikely(err != 0)) { |
112 | if (err == -EEXIST) { | 112 | if (err == -EEXIST) { |
@@ -714,7 +714,7 @@ void nilfs_update_inode(struct inode *inode, struct buffer_head *ibh, int flags) | |||
714 | static void nilfs_truncate_bmap(struct nilfs_inode_info *ii, | 714 | static void nilfs_truncate_bmap(struct nilfs_inode_info *ii, |
715 | unsigned long from) | 715 | unsigned long from) |
716 | { | 716 | { |
717 | unsigned long b; | 717 | __u64 b; |
718 | int ret; | 718 | int ret; |
719 | 719 | ||
720 | if (!test_bit(NILFS_I_BMAP, &ii->i_state)) | 720 | if (!test_bit(NILFS_I_BMAP, &ii->i_state)) |
@@ -729,7 +729,7 @@ repeat: | |||
729 | if (b < from) | 729 | if (b < from) |
730 | return; | 730 | return; |
731 | 731 | ||
732 | b -= min_t(unsigned long, NILFS_MAX_TRUNCATE_BLOCKS, b - from); | 732 | b -= min_t(__u64, NILFS_MAX_TRUNCATE_BLOCKS, b - from); |
733 | ret = nilfs_bmap_truncate(ii->i_bmap, b); | 733 | ret = nilfs_bmap_truncate(ii->i_bmap, b); |
734 | nilfs_relax_pressure_in_lock(ii->vfs_inode.i_sb); | 734 | nilfs_relax_pressure_in_lock(ii->vfs_inode.i_sb); |
735 | if (!ret || (ret == -ENOMEM && | 735 | if (!ret || (ret == -ENOMEM && |