diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2010-07-10 03:50:41 -0400 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2010-07-22 21:02:13 -0400 |
commit | 25b8d7ded0e4579bf152882249abfd351e65a17d (patch) | |
tree | 4949d1b531805b5ea2c25a544eea200f0ec3d580 /fs/nilfs2/direct.c | |
parent | 1d5385b9f30ae43209459db424416a3e1d8f2bde (diff) |
nilfs2: get rid of private conversion macros on bmap key and pointer
Will remove nilfs_bmap_key_to_dkey(), nilfs_bmap_dkey_to_key(),
nilfs_bmap_ptr_to_dptr(), and nilfs_bmap_dptr_to_ptr() for simplicity.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/direct.c')
-rw-r--r-- | fs/nilfs2/direct.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/nilfs2/direct.c b/fs/nilfs2/direct.c index 236753df5cdf..32f1746a74a7 100644 --- a/fs/nilfs2/direct.c +++ b/fs/nilfs2/direct.c | |||
@@ -36,13 +36,13 @@ static inline __le64 *nilfs_direct_dptrs(const struct nilfs_direct *direct) | |||
36 | static inline __u64 | 36 | static inline __u64 |
37 | nilfs_direct_get_ptr(const struct nilfs_direct *direct, __u64 key) | 37 | nilfs_direct_get_ptr(const struct nilfs_direct *direct, __u64 key) |
38 | { | 38 | { |
39 | return nilfs_bmap_dptr_to_ptr(*(nilfs_direct_dptrs(direct) + key)); | 39 | return le64_to_cpu(*(nilfs_direct_dptrs(direct) + key)); |
40 | } | 40 | } |
41 | 41 | ||
42 | static inline void nilfs_direct_set_ptr(struct nilfs_direct *direct, | 42 | static inline void nilfs_direct_set_ptr(struct nilfs_direct *direct, |
43 | __u64 key, __u64 ptr) | 43 | __u64 key, __u64 ptr) |
44 | { | 44 | { |
45 | *(nilfs_direct_dptrs(direct) + key) = nilfs_bmap_ptr_to_dptr(ptr); | 45 | *(nilfs_direct_dptrs(direct) + key) = cpu_to_le64(ptr); |
46 | } | 46 | } |
47 | 47 | ||
48 | static int nilfs_direct_lookup(const struct nilfs_bmap *bmap, | 48 | static int nilfs_direct_lookup(const struct nilfs_bmap *bmap, |
@@ -258,7 +258,7 @@ int nilfs_direct_delete_and_convert(struct nilfs_bmap *bmap, | |||
258 | for (i = 0, j = 0; i < NILFS_DIRECT_NBLOCKS; i++) { | 258 | for (i = 0, j = 0; i < NILFS_DIRECT_NBLOCKS; i++) { |
259 | if ((j < n) && (i == keys[j])) { | 259 | if ((j < n) && (i == keys[j])) { |
260 | dptrs[i] = (i != key) ? | 260 | dptrs[i] = (i != key) ? |
261 | nilfs_bmap_ptr_to_dptr(ptrs[j]) : | 261 | cpu_to_le64(ptrs[j]) : |
262 | NILFS_BMAP_INVALID_PTR; | 262 | NILFS_BMAP_INVALID_PTR; |
263 | j++; | 263 | j++; |
264 | } else | 264 | } else |
@@ -315,8 +315,8 @@ static int nilfs_direct_assign_v(struct nilfs_direct *direct, | |||
315 | ret = nilfs_dat_prepare_start(dat, &req.bpr_req); | 315 | ret = nilfs_dat_prepare_start(dat, &req.bpr_req); |
316 | if (!ret) { | 316 | if (!ret) { |
317 | nilfs_dat_commit_start(dat, &req.bpr_req, blocknr); | 317 | nilfs_dat_commit_start(dat, &req.bpr_req, blocknr); |
318 | binfo->bi_v.bi_vblocknr = nilfs_bmap_ptr_to_dptr(ptr); | 318 | binfo->bi_v.bi_vblocknr = cpu_to_le64(ptr); |
319 | binfo->bi_v.bi_blkoff = nilfs_bmap_key_to_dkey(key); | 319 | binfo->bi_v.bi_blkoff = cpu_to_le64(key); |
320 | } | 320 | } |
321 | return ret; | 321 | return ret; |
322 | } | 322 | } |
@@ -329,7 +329,7 @@ static int nilfs_direct_assign_p(struct nilfs_direct *direct, | |||
329 | { | 329 | { |
330 | nilfs_direct_set_ptr(direct, key, blocknr); | 330 | nilfs_direct_set_ptr(direct, key, blocknr); |
331 | 331 | ||
332 | binfo->bi_dat.bi_blkoff = nilfs_bmap_key_to_dkey(key); | 332 | binfo->bi_dat.bi_blkoff = cpu_to_le64(key); |
333 | binfo->bi_dat.bi_level = 0; | 333 | binfo->bi_dat.bi_level = 0; |
334 | 334 | ||
335 | return 0; | 335 | return 0; |