Lines Matching refs:buf
41 struct cachefiles_xattr *buf; in cachefiles_set_object_xattr() local
53 buf = kmalloc(sizeof(struct cachefiles_xattr) + len, GFP_KERNEL); in cachefiles_set_object_xattr()
54 if (!buf) in cachefiles_set_object_xattr()
57 buf->object_size = cpu_to_be64(object->cookie->object_size); in cachefiles_set_object_xattr()
58 buf->zero_point = 0; in cachefiles_set_object_xattr()
59 buf->type = CACHEFILES_COOKIE_TYPE_DATA; in cachefiles_set_object_xattr()
60 buf->content = object->content_info; in cachefiles_set_object_xattr()
62 buf->content = CACHEFILES_CONTENT_DIRTY; in cachefiles_set_object_xattr()
64 memcpy(buf->data, fscache_get_aux(object->cookie), len); in cachefiles_set_object_xattr()
71 cachefiles_xattr_cache, buf, in cachefiles_set_object_xattr()
80 be64_to_cpup((__be64 *)buf->data), in cachefiles_set_object_xattr()
81 buf->content, in cachefiles_set_object_xattr()
89 be64_to_cpup((__be64 *)buf->data), in cachefiles_set_object_xattr()
90 buf->content, in cachefiles_set_object_xattr()
94 kfree(buf); in cachefiles_set_object_xattr()
104 struct cachefiles_xattr *buf; in cachefiles_check_auxdata() local
113 buf = kmalloc(tlen, GFP_KERNEL); in cachefiles_check_auxdata()
114 if (!buf) in cachefiles_check_auxdata()
119 xlen = vfs_getxattr(&nop_mnt_idmap, dentry, cachefiles_xattr_cache, buf, tlen); in cachefiles_check_auxdata()
134 if (buf->type != CACHEFILES_COOKIE_TYPE_DATA) { in cachefiles_check_auxdata()
136 } else if (memcmp(buf->data, p, len) != 0) { in cachefiles_check_auxdata()
138 } else if (be64_to_cpu(buf->object_size) != object->cookie->object_size) { in cachefiles_check_auxdata()
140 } else if (buf->content == CACHEFILES_CONTENT_DIRTY) { in cachefiles_check_auxdata()
151 be64_to_cpup((__be64 *)buf->data), in cachefiles_check_auxdata()
152 buf->content, why); in cachefiles_check_auxdata()
153 kfree(buf); in cachefiles_check_auxdata()
214 struct cachefiles_vol_xattr *buf; in cachefiles_set_volume_xattr() local
222 len += sizeof(*buf); in cachefiles_set_volume_xattr()
223 buf = kmalloc(len, GFP_KERNEL); in cachefiles_set_volume_xattr()
224 if (!buf) in cachefiles_set_volume_xattr()
226 buf->reserved = cpu_to_be32(0); in cachefiles_set_volume_xattr()
227 memcpy(buf->data, p, volume->vcookie->coherency_len); in cachefiles_set_volume_xattr()
235 buf, len, 0); in cachefiles_set_volume_xattr()
252 kfree(buf); in cachefiles_set_volume_xattr()
262 struct cachefiles_vol_xattr *buf; in cachefiles_check_volume_xattr() local
272 len += sizeof(*buf); in cachefiles_check_volume_xattr()
273 buf = kmalloc(len, GFP_KERNEL); in cachefiles_check_volume_xattr()
274 if (!buf) in cachefiles_check_volume_xattr()
279 xlen = vfs_getxattr(&nop_mnt_idmap, dentry, cachefiles_xattr_cache, buf, len); in cachefiles_check_volume_xattr()
291 } else if (buf->reserved != cpu_to_be32(0)) { in cachefiles_check_volume_xattr()
293 } else if (memcmp(buf->data, p, len - sizeof(*buf)) != 0) { in cachefiles_check_volume_xattr()
301 kfree(buf); in cachefiles_check_volume_xattr()