Lines Matching +full:0 +full:xf

64 	struct xfile		*xf;  in xfile_create()  local
67 xf = kmalloc(sizeof(struct xfile), XCHK_GFP_FLAGS); in xfile_create()
68 if (!xf) in xfile_create()
71 xf->file = shmem_file_setup(description, isize, 0); in xfile_create()
72 if (!xf->file) in xfile_create()
74 if (IS_ERR(xf->file)) { in xfile_create()
75 error = PTR_ERR(xf->file); in xfile_create()
86 xf->file->f_mode |= FMODE_PREAD | FMODE_PWRITE | FMODE_NOCMTIME | in xfile_create()
88 xf->file->f_flags |= O_RDWR | O_LARGEFILE | O_NOATIME; in xfile_create()
89 inode = file_inode(xf->file); in xfile_create()
97 trace_xfile_create(xf); in xfile_create()
99 *xfilep = xf; in xfile_create()
100 return 0; in xfile_create()
102 kfree(xf); in xfile_create()
109 struct xfile *xf) in xfile_destroy() argument
111 struct inode *inode = file_inode(xf->file); in xfile_destroy()
113 trace_xfile_destroy(xf); in xfile_destroy()
116 fput(xf->file); in xfile_destroy()
117 kfree(xf); in xfile_destroy()
128 struct xfile *xf, in xfile_pread() argument
133 struct inode *inode = file_inode(xf->file); in xfile_pread()
136 ssize_t read = 0; in xfile_pread()
138 int error = 0; in xfile_pread()
145 trace_xfile_pread(xf, pos, count); in xfile_pread()
148 while (count > 0) { in xfile_pread()
166 memset(buf, 0, len); in xfile_pread()
180 memset(buf, 0, len); in xfile_pread()
192 if (read > 0) in xfile_pread()
205 struct xfile *xf, in xfile_pwrite() argument
210 struct inode *inode = file_inode(xf->file); in xfile_pwrite()
214 ssize_t written = 0; in xfile_pwrite()
216 int error = 0; in xfile_pwrite()
223 trace_xfile_pwrite(xf, pos, count); in xfile_pwrite()
226 while (count > 0) { in xfile_pwrite()
252 memset(kaddr, 0, PAGE_SIZE); in xfile_pwrite()
261 if (ret < 0) { in xfile_pwrite()
276 if (written > 0) in xfile_pwrite()
284 struct xfile *xf, in xfile_seek_data() argument
289 ret = vfs_llseek(xf->file, pos, SEEK_DATA); in xfile_seek_data()
290 trace_xfile_seek_data(xf, pos, ret); in xfile_seek_data()
297 struct xfile *xf, in xfile_stat() argument
303 error = vfs_getattr_nosec(&xf->file->f_path, &ks, in xfile_stat()
310 return 0; in xfile_stat()
315 * boundary. Returns 0 (and a locked page) if successful, -ENOTBLK if we
320 struct xfile *xf, in xfile_get_page() argument
325 struct inode *inode = file_inode(xf->file); in xfile_get_page()
339 trace_xfile_get_page(xf, pos, len); in xfile_get_page()
366 memset(kaddr, 0, PAGE_SIZE); in xfile_get_page()
389 * Release the (locked) page for a memory object. Returns 0 or a negative
394 struct xfile *xf, in xfile_put_page() argument
397 struct inode *inode = file_inode(xf->file); in xfile_put_page()
403 trace_xfile_put_page(xf, xfpage->pos, PAGE_SIZE); in xfile_put_page()
412 memset(xfpage, 0, sizeof(struct xfile_page)); in xfile_put_page()
414 if (ret < 0) in xfile_put_page()
418 return 0; in xfile_put_page()