Lines Matching refs:key
37 nilfs_direct_get_ptr(const struct nilfs_bmap *direct, __u64 key) in nilfs_direct_get_ptr() argument
39 return le64_to_cpu(*(nilfs_direct_dptrs(direct) + key)); in nilfs_direct_get_ptr()
43 __u64 key, __u64 ptr) in nilfs_direct_set_ptr() argument
45 *(nilfs_direct_dptrs(direct) + key) = cpu_to_le64(ptr); in nilfs_direct_set_ptr()
49 __u64 key, int level, __u64 *ptrp) in nilfs_direct_lookup() argument
53 if (key > NILFS_DIRECT_KEY_MAX || level != 1) in nilfs_direct_lookup()
55 ptr = nilfs_direct_get_ptr(direct, key); in nilfs_direct_lookup()
64 __u64 key, __u64 *ptrp, in nilfs_direct_lookup_contig() argument
72 if (key > NILFS_DIRECT_KEY_MAX) in nilfs_direct_lookup_contig()
74 ptr = nilfs_direct_get_ptr(direct, key); in nilfs_direct_lookup_contig()
86 maxblocks = min_t(unsigned, maxblocks, NILFS_DIRECT_KEY_MAX - key + 1); in nilfs_direct_lookup_contig()
88 (ptr2 = nilfs_direct_get_ptr(direct, key + cnt)) != in nilfs_direct_lookup_contig()
105 nilfs_direct_find_target_v(const struct nilfs_bmap *direct, __u64 key) in nilfs_direct_find_target_v() argument
109 ptr = nilfs_bmap_find_target_seq(direct, key); in nilfs_direct_find_target_v()
118 static int nilfs_direct_insert(struct nilfs_bmap *bmap, __u64 key, __u64 ptr) in nilfs_direct_insert() argument
125 if (key > NILFS_DIRECT_KEY_MAX) in nilfs_direct_insert()
127 if (nilfs_direct_get_ptr(bmap, key) != NILFS_BMAP_INVALID_PTR) in nilfs_direct_insert()
131 req.bpr_ptr = nilfs_direct_find_target_v(bmap, key); in nilfs_direct_insert()
141 nilfs_direct_set_ptr(bmap, key, req.bpr_ptr); in nilfs_direct_insert()
147 nilfs_bmap_set_target_v(bmap, key, req.bpr_ptr); in nilfs_direct_insert()
154 static int nilfs_direct_delete(struct nilfs_bmap *bmap, __u64 key) in nilfs_direct_delete() argument
160 if (key > NILFS_DIRECT_KEY_MAX || in nilfs_direct_delete()
161 nilfs_direct_get_ptr(bmap, key) == NILFS_BMAP_INVALID_PTR) in nilfs_direct_delete()
165 req.bpr_ptr = nilfs_direct_get_ptr(bmap, key); in nilfs_direct_delete()
170 nilfs_direct_set_ptr(bmap, key, NILFS_BMAP_INVALID_PTR); in nilfs_direct_delete()
178 __u64 key, lastkey; in nilfs_direct_last_key() local
181 for (key = NILFS_DIRECT_KEY_MIN; key <= NILFS_DIRECT_KEY_MAX; key++) in nilfs_direct_last_key()
182 if (nilfs_direct_get_ptr(direct, key) != in nilfs_direct_last_key()
184 lastkey = key; in nilfs_direct_last_key()
194 static int nilfs_direct_check_insert(const struct nilfs_bmap *bmap, __u64 key) in nilfs_direct_check_insert() argument
196 return key > NILFS_DIRECT_KEY_MAX; in nilfs_direct_check_insert()
202 __u64 key; in nilfs_direct_gather_data() local
209 for (key = 0; key < nitems; key++) { in nilfs_direct_gather_data()
210 ptr = nilfs_direct_get_ptr(direct, key); in nilfs_direct_gather_data()
212 keys[n] = key; in nilfs_direct_gather_data()
221 __u64 key, __u64 *keys, __u64 *ptrs, int n) in nilfs_direct_delete_and_convert() argument
229 ret = bmap->b_ops->bop_delete(bmap, key); in nilfs_direct_delete_and_convert()
241 dptrs[i] = (i != key) ? in nilfs_direct_delete_and_convert()
258 __u64 key; in nilfs_direct_propagate() local
266 key = nilfs_bmap_data_get_key(bmap, bh); in nilfs_direct_propagate()
267 ptr = nilfs_direct_get_ptr(bmap, key); in nilfs_direct_propagate()
277 nilfs_direct_set_ptr(bmap, key, newreq.pr_entry_nr); in nilfs_direct_propagate()
285 __u64 key, __u64 ptr, in nilfs_direct_assign_v() argument
299 binfo->bi_v.bi_blkoff = cpu_to_le64(key); in nilfs_direct_assign_v()
305 __u64 key, __u64 ptr, in nilfs_direct_assign_p() argument
310 nilfs_direct_set_ptr(direct, key, blocknr); in nilfs_direct_assign_p()
312 binfo->bi_dat.bi_blkoff = cpu_to_le64(key); in nilfs_direct_assign_p()
323 __u64 key; in nilfs_direct_assign() local
326 key = nilfs_bmap_data_get_key(bmap, *bh); in nilfs_direct_assign()
327 if (unlikely(key > NILFS_DIRECT_KEY_MAX)) { in nilfs_direct_assign()
329 (unsigned long long)key); in nilfs_direct_assign()
332 ptr = nilfs_direct_get_ptr(bmap, key); in nilfs_direct_assign()
340 nilfs_direct_assign_v(bmap, key, ptr, bh, blocknr, binfo) : in nilfs_direct_assign()
341 nilfs_direct_assign_p(bmap, key, ptr, bh, blocknr, binfo); in nilfs_direct_assign()