Lines Matching full:blob
16 * XFS Blob Storage
25 uint32_t xb_size; /* size of the blob, in bytes */
27 /* blob comes after here */
30 /* Initialize a blob storage object. */
36 struct xfblob *blob; in xfblob_create() local
44 blob = kmalloc(sizeof(struct xfblob), XCHK_GFP_FLAGS); in xfblob_create()
45 if (!blob) { in xfblob_create()
50 blob->xfile = xfile; in xfblob_create()
51 blob->last_offset = PAGE_SIZE; in xfblob_create()
53 *blobp = blob; in xfblob_create()
61 /* Destroy a blob storage object. */
64 struct xfblob *blob) in xfblob_destroy() argument
66 xfile_destroy(blob->xfile); in xfblob_destroy()
67 kfree(blob); in xfblob_destroy()
70 /* Retrieve a blob. */
73 struct xfblob *blob, in xfblob_load() argument
81 error = xfile_load(blob->xfile, &key, sizeof(key), cookie); in xfblob_load()
94 return xfile_load(blob->xfile, ptr, key.xb_size, in xfblob_load()
98 /* Store a blob. */
101 struct xfblob *blob, in xfblob_store() argument
107 .xb_offset = blob->last_offset, in xfblob_store()
111 loff_t pos = blob->last_offset; in xfblob_store()
114 error = xfile_store(blob->xfile, &key, sizeof(key), pos); in xfblob_store()
119 error = xfile_store(blob->xfile, ptr, size, pos); in xfblob_store()
123 *cookie = blob->last_offset; in xfblob_store()
124 blob->last_offset += sizeof(key) + size; in xfblob_store()
127 xfile_discard(blob->xfile, blob->last_offset, sizeof(key)); in xfblob_store()
131 /* Free a blob. */
134 struct xfblob *blob, in xfblob_free() argument
140 error = xfile_load(blob->xfile, &key, sizeof(key), cookie); in xfblob_free()
149 xfile_discard(blob->xfile, cookie, sizeof(key) + key.xb_size); in xfblob_free()
153 /* How many bytes is this blob storage object consuming? */
156 struct xfblob *blob) in xfblob_bytes() argument
158 return xfile_bytes(blob->xfile); in xfblob_bytes()
164 struct xfblob *blob) in xfblob_truncate() argument
166 xfile_discard(blob->xfile, PAGE_SIZE, MAX_LFS_FILESIZE - PAGE_SIZE); in xfblob_truncate()
167 blob->last_offset = PAGE_SIZE; in xfblob_truncate()