Lines Matching +full:0 +full:xf
57 struct xfile *xf; in xfile_create() local
60 xf = kmalloc(sizeof(struct xfile), XCHK_GFP_FLAGS); in xfile_create()
61 if (!xf) in xfile_create()
64 xf->file = shmem_kernel_file_setup(description, isize, VM_NORESERVE); in xfile_create()
65 if (IS_ERR(xf->file)) { in xfile_create()
66 error = PTR_ERR(xf->file); in xfile_create()
70 inode = file_inode(xf->file); in xfile_create()
79 trace_xfile_create(xf); in xfile_create()
81 *xfilep = xf; in xfile_create()
82 return 0; in xfile_create()
84 kfree(xf); in xfile_create()
91 struct xfile *xf) in xfile_destroy() argument
93 struct inode *inode = file_inode(xf->file); in xfile_destroy()
95 trace_xfile_destroy(xf); in xfile_destroy()
98 fput(xf->file); in xfile_destroy()
99 kfree(xf); in xfile_destroy()
108 struct xfile *xf, in xfile_load() argument
113 struct inode *inode = file_inode(xf->file); in xfile_load()
121 trace_xfile_load(xf, pos, count); in xfile_load()
124 while (count > 0) { in xfile_load()
129 if (shmem_get_folio(inode, pos >> PAGE_SHIFT, 0, &folio, in xfile_load()
130 SGP_READ) < 0) in xfile_load()
139 memset(buf, 0, len); in xfile_load()
141 if (filemap_check_wb_err(inode->i_mapping, 0)) { in xfile_load()
162 return 0; in xfile_load()
171 struct xfile *xf, in xfile_store() argument
176 struct inode *inode = file_inode(xf->file); in xfile_store()
184 trace_xfile_store(xf, pos, count); in xfile_store()
194 while (count > 0) { in xfile_store()
199 if (shmem_get_folio(inode, pos >> PAGE_SHIFT, 0, &folio, in xfile_store()
200 SGP_CACHE) < 0) in xfile_store()
202 if (filemap_check_wb_err(inode->i_mapping, 0)) { in xfile_store()
224 return 0; in xfile_store()
230 struct xfile *xf, in xfile_seek_data() argument
235 ret = vfs_llseek(xf->file, pos, SEEK_DATA); in xfile_seek_data()
236 trace_xfile_seek_data(xf, pos, ret); in xfile_seek_data()
247 struct xfile *xf, in xfile_get_folio() argument
252 struct inode *inode = file_inode(xf->file); in xfile_get_folio()
260 trace_xfile_get_folio(xf, pos, len); in xfile_get_folio()
270 error = shmem_get_folio(inode, pos >> PAGE_SHIFT, 0, &folio, in xfile_get_folio()
285 if (filemap_check_wb_err(inode->i_mapping, 0)) { in xfile_get_folio()
305 struct xfile *xf, in xfile_put_folio() argument
308 trace_xfile_put_folio(xf, folio_pos(folio), folio_size(folio)); in xfile_put_folio()
317 struct xfile *xf, in xfile_discard() argument
321 trace_xfile_discard(xf, pos, count); in xfile_discard()
323 shmem_truncate_range(file_inode(xf->file), pos, pos + count - 1); in xfile_discard()