Lines Matching refs:off

22 bool is_bnode_offset_valid(struct hfs_bnode *node, int off)  in is_bnode_offset_valid()  argument
24 bool is_valid = off < node->tree->node_size; in is_bnode_offset_valid()
31 node->tree->node_size, off); in is_bnode_offset_valid()
38 int check_and_correct_requested_length(struct hfs_bnode *node, int off, int len) in check_and_correct_requested_length() argument
42 if (!is_bnode_offset_valid(node, off)) in check_and_correct_requested_length()
47 if ((off + len) > node_size) { in check_and_correct_requested_length()
48 int new_len = (int)node_size - off; in check_and_correct_requested_length()
55 node->tree->node_size, off, len, new_len); in check_and_correct_requested_length()
64 void hfs_bnode_read(struct hfs_bnode *node, void *buf, int off, int len) in hfs_bnode_read() argument
69 if (!is_bnode_offset_valid(node, off)) in hfs_bnode_read()
77 node->tree->node_size, off, len); in hfs_bnode_read()
81 len = check_and_correct_requested_length(node, off, len); in hfs_bnode_read()
83 off += node->page_offset; in hfs_bnode_read()
84 pagep = node->page + (off >> PAGE_SHIFT); in hfs_bnode_read()
85 off &= ~PAGE_MASK; in hfs_bnode_read()
87 l = min_t(int, len, PAGE_SIZE - off); in hfs_bnode_read()
88 memcpy_from_page(buf, *pagep, off, l); in hfs_bnode_read()
97 u16 hfs_bnode_read_u16(struct hfs_bnode *node, int off) in hfs_bnode_read_u16() argument
101 hfs_bnode_read(node, &data, off, 2); in hfs_bnode_read_u16()
105 u8 hfs_bnode_read_u8(struct hfs_bnode *node, int off) in hfs_bnode_read_u8() argument
109 hfs_bnode_read(node, &data, off, 1); in hfs_bnode_read_u8()
113 void hfs_bnode_read_key(struct hfs_bnode *node, void *key, int off) in hfs_bnode_read_key() argument
122 key_len = hfs_bnode_read_u16(node, off) + 2; in hfs_bnode_read_key()
132 hfs_bnode_read(node, key, off, key_len); in hfs_bnode_read_key()
135 void hfs_bnode_write(struct hfs_bnode *node, void *buf, int off, int len) in hfs_bnode_write() argument
140 if (!is_bnode_offset_valid(node, off)) in hfs_bnode_write()
148 node->tree->node_size, off, len); in hfs_bnode_write()
152 len = check_and_correct_requested_length(node, off, len); in hfs_bnode_write()
154 off += node->page_offset; in hfs_bnode_write()
155 pagep = node->page + (off >> PAGE_SHIFT); in hfs_bnode_write()
156 off &= ~PAGE_MASK; in hfs_bnode_write()
158 l = min_t(int, len, PAGE_SIZE - off); in hfs_bnode_write()
159 memcpy_to_page(*pagep, off, buf, l); in hfs_bnode_write()
170 void hfs_bnode_write_u16(struct hfs_bnode *node, int off, u16 data) in hfs_bnode_write_u16() argument
174 hfs_bnode_write(node, &v, off, 2); in hfs_bnode_write_u16()
177 void hfs_bnode_clear(struct hfs_bnode *node, int off, int len) in hfs_bnode_clear() argument
182 if (!is_bnode_offset_valid(node, off)) in hfs_bnode_clear()
190 node->tree->node_size, off, len); in hfs_bnode_clear()
194 len = check_and_correct_requested_length(node, off, len); in hfs_bnode_clear()
196 off += node->page_offset; in hfs_bnode_clear()
197 pagep = node->page + (off >> PAGE_SHIFT); in hfs_bnode_clear()
198 off &= ~PAGE_MASK; in hfs_bnode_clear()
200 l = min_t(int, len, PAGE_SIZE - off); in hfs_bnode_clear()
201 memzero_page(*pagep, off, l); in hfs_bnode_clear()
393 int i, off, key_off; in hfs_bnode_dump() local
401 off = node->tree->node_size - 2; in hfs_bnode_dump()
402 for (i = be16_to_cpu(desc.num_recs); i >= 0; off -= 2, i--) { in hfs_bnode_dump()
403 key_off = hfs_bnode_read_u16(node, off); in hfs_bnode_dump()
497 loff_t off; in __hfs_bnode_create() local
534 off = (loff_t)cnid << tree->node_size_shift; in __hfs_bnode_create()
535 block = off >> PAGE_SHIFT; in __hfs_bnode_create()
536 node->page_offset = off & ~PAGE_MASK; in __hfs_bnode_create()
569 int i, rec_off, off, next_off; in hfs_bnode_find() local
620 off = hfs_bnode_read_u16(node, rec_off); in hfs_bnode_find()
621 if (off != sizeof(struct hfs_bnode_desc)) in hfs_bnode_find()
623 for (i = 1; i <= node->num_recs; off = next_off, i++) { in hfs_bnode_find()
626 if (next_off <= off || in hfs_bnode_find()
630 entry_size = next_off - off; in hfs_bnode_find()
634 key_size = hfs_bnode_read_u16(node, off) + 2; in hfs_bnode_find()