Lines Matching refs:token

27 void btrfs_init_map_token(struct btrfs_map_token *token, struct extent_buffer *eb)  in btrfs_init_map_token()  argument
29 token->eb = eb; in btrfs_init_map_token()
30 token->kaddr = page_address(eb->pages[0]); in btrfs_init_map_token()
31 token->offset = 0; in btrfs_init_map_token()
59 u##bits btrfs_get_token_##bits(struct btrfs_map_token *token, \
64 const unsigned long oip = get_eb_offset_in_page(token->eb, \
70 ASSERT(token); \
71 ASSERT(token->kaddr); \
72 ASSERT(check_setget_bounds(token->eb, ptr, off, size)); \
73 if (token->offset <= member_offset && \
74 member_offset + size <= token->offset + PAGE_SIZE) { \
75 return get_unaligned_le##bits(token->kaddr + oip); \
77 token->kaddr = page_address(token->eb->pages[idx]); \
78 token->offset = idx << PAGE_SHIFT; \
80 return get_unaligned_le##bits(token->kaddr + oip); \
82 memcpy(lebytes, token->kaddr + oip, part); \
83 token->kaddr = page_address(token->eb->pages[idx + 1]); \
84 token->offset = (idx + 1) << PAGE_SHIFT; \
85 memcpy(lebytes + part, token->kaddr, size - part); \
108 void btrfs_set_token_##bits(struct btrfs_map_token *token, \
114 const unsigned long oip = get_eb_offset_in_page(token->eb, \
120 ASSERT(token); \
121 ASSERT(token->kaddr); \
122 ASSERT(check_setget_bounds(token->eb, ptr, off, size)); \
123 if (token->offset <= member_offset && \
124 member_offset + size <= token->offset + PAGE_SIZE) { \
125 put_unaligned_le##bits(val, token->kaddr + oip); \
128 token->kaddr = page_address(token->eb->pages[idx]); \
129 token->offset = idx << PAGE_SHIFT; \
131 put_unaligned_le##bits(val, token->kaddr + oip); \
135 memcpy(token->kaddr + oip, lebytes, part); \
136 token->kaddr = page_address(token->eb->pages[idx + 1]); \
137 token->offset = (idx + 1) << PAGE_SHIFT; \
138 memcpy(token->kaddr, lebytes + part, size - part); \