Lines Matching full:file

17 struct file *shmem_create_from_data(const char *name, void *data, size_t len)  in shmem_create_from_data()
19 struct file *file; in shmem_create_from_data() local
22 file = shmem_file_setup(name, PAGE_ALIGN(len), VM_NORESERVE); in shmem_create_from_data()
23 if (IS_ERR(file)) in shmem_create_from_data()
24 return file; in shmem_create_from_data()
26 err = shmem_write(file, 0, data, len); in shmem_create_from_data()
28 fput(file); in shmem_create_from_data()
32 return file; in shmem_create_from_data()
35 struct file *shmem_create_from_object(struct drm_i915_gem_object *obj) in shmem_create_from_object()
38 struct file *file; in shmem_create_from_object() local
42 file = obj->base.filp; in shmem_create_from_object()
43 atomic_long_inc(&file->f_count); in shmem_create_from_object()
44 return file; in shmem_create_from_object()
52 file = shmem_create_from_data("", ptr, obj->base.size); in shmem_create_from_object()
55 return file; in shmem_create_from_object()
58 void *shmem_pin_map(struct file *file) in shmem_pin_map() argument
64 n_pages = file->f_mapping->host->i_size >> PAGE_SHIFT; in shmem_pin_map()
70 pages[i] = shmem_read_mapping_page_gfp(file->f_mapping, i, in shmem_pin_map()
79 mapping_set_unevictable(file->f_mapping); in shmem_pin_map()
88 void shmem_unpin_map(struct file *file, void *ptr) in shmem_unpin_map() argument
90 mapping_clear_unevictable(file->f_mapping); in shmem_unpin_map()
94 static int __shmem_rw(struct file *file, loff_t off, in __shmem_rw() argument
106 page = shmem_read_mapping_page_gfp(file->f_mapping, pfn, in __shmem_rw()
130 int shmem_read_to_iosys_map(struct file *file, loff_t off, in shmem_read_to_iosys_map() argument
141 page = shmem_read_mapping_page_gfp(file->f_mapping, pfn, in shmem_read_to_iosys_map()
161 int shmem_read(struct file *file, loff_t off, void *dst, size_t len) in shmem_read() argument
163 return __shmem_rw(file, off, dst, len, false); in shmem_read()
166 int shmem_write(struct file *file, loff_t off, void *src, size_t len) in shmem_write() argument
168 return __shmem_rw(file, off, src, len, true); in shmem_write()