Lines Matching full:token

35  * Generic helpers with a token (cached address of the most recently accessed
51 u##bits btrfs_get_token_##bits(struct btrfs_map_token *token, \
56 const unsigned long oip = get_eb_offset_in_page(token->eb, \
62 ASSERT(token); \
63 ASSERT(token->kaddr); \
64 ASSERT(check_setget_bounds(token->eb, ptr, off, size)); \
65 if (token->offset <= member_offset && \
66 member_offset + size <= token->offset + PAGE_SIZE) { \
67 return get_unaligned_le##bits(token->kaddr + oip); \
69 token->kaddr = page_address(token->eb->pages[idx]); \
70 token->offset = idx << PAGE_SHIFT; \
72 return get_unaligned_le##bits(token->kaddr + oip); \
74 memcpy(lebytes, token->kaddr + oip, part); \
75 token->kaddr = page_address(token->eb->pages[idx + 1]); \
76 token->offset = (idx + 1) << PAGE_SHIFT; \
77 memcpy(lebytes + part, token->kaddr, size - part); \
100 void btrfs_set_token_##bits(struct btrfs_map_token *token, \
106 const unsigned long oip = get_eb_offset_in_page(token->eb, \
112 ASSERT(token); \
113 ASSERT(token->kaddr); \
114 ASSERT(check_setget_bounds(token->eb, ptr, off, size)); \
115 if (token->offset <= member_offset && \
116 member_offset + size <= token->offset + PAGE_SIZE) { \
117 put_unaligned_le##bits(val, token->kaddr + oip); \
120 token->kaddr = page_address(token->eb->pages[idx]); \
121 token->offset = idx << PAGE_SHIFT; \
123 put_unaligned_le##bits(val, token->kaddr + oip); \
127 memcpy(token->kaddr + oip, lebytes, part); \
128 token->kaddr = page_address(token->eb->pages[idx + 1]); \
129 token->offset = (idx + 1) << PAGE_SHIFT; \
130 memcpy(token->kaddr, lebytes + part, size - part); \