Lines Matching defs:file

21  * This file is released under the GPL.
30 #include <linux/file.h>
682 /* No huge page at the end of the file: nothing to split */
2110 /* Perhaps the file has been truncated since we checked */
2198 struct file *fpin = NULL;
2266 unsigned long shmem_get_unmapped_area(struct file *file,
2270 unsigned long (*get_area)(struct file *,
2282 addr = get_area(file, uaddr, len, pgoff, flags);
2311 if (file) {
2312 VM_BUG_ON(file->f_op != &shmem_file_operations);
2313 sb = file_inode(file)->i_sb;
2399 int shmem_lock(struct file *file, int lock, struct ucounts *ucounts)
2401 struct inode *inode = file_inode(file);
2414 mapping_set_unevictable(file->f_mapping);
2419 mapping_clear_unevictable(file->f_mapping);
2427 static int shmem_mmap(struct file *file, struct vm_area_struct *vma)
2429 struct inode *inode = file_inode(file);
2440 file_accessed(file);
2449 static int shmem_file_open(struct inode *inode, struct file *file)
2451 file->f_mode |= FMODE_CAN_ODIRECT;
2452 return generic_file_open(inode, file);
2725 shmem_write_begin(struct file *file, struct address_space *mapping,
2760 shmem_write_end(struct file *file, struct address_space *mapping,
2787 struct file *file = iocb->ki_filp;
2788 struct inode *inode = file_inode(file);
2900 file_accessed(file);
2906 struct file *file = iocb->ki_filp;
2907 struct inode *inode = file->f_mapping->host;
2914 ret = file_remove_privs(file);
2917 ret = file_update_time(file);
2971 static ssize_t shmem_file_splice_read(struct file *in, loff_t *ppos,
3015 * another truncate extends the file - this is desired though).
3061 static loff_t shmem_file_llseek(struct file *file, loff_t offset, int whence)
3063 struct address_space *mapping = file->f_mapping;
3067 return generic_file_llseek_size(file, offset, whence,
3076 offset = vfs_setpos(file, offset, MAX_LFS_FILESIZE);
3081 static long shmem_fallocate(struct file *file, int mode, loff_t offset,
3084 struct inode *inode = file_inode(file);
3097 struct address_space *mapping = file->f_mapping;
3230 file_modified(file);
3299 struct file *file, umode_t mode)
3316 d_tmpfile(file, inode);
3319 return finish_open_simple(file, error);
3344 * Link a file..
3356 * But if an O_TMPFILE file is linked into the tmpfs, the
4790 int shmem_lock(struct file *file, int lock, struct ucounts *ucounts)
4800 unsigned long shmem_get_unmapped_area(struct file *file,
4804 return current->mm->get_unmapped_area(file, addr, len, pgoff, flags);
4832 static struct file *__shmem_file_setup(struct vfsmount *mnt, const char *name,
4836 struct file *res;
4869 * shmem_kernel_file_setup - get an unlinked file living in tmpfs which must be
4875 * @size: size to be set for the file
4878 struct file *shmem_kernel_file_setup(const char *name, loff_t size, unsigned long flags)
4885 * shmem_file_setup - get an unlinked file living in tmpfs
4887 * @size: size to be set for the file
4890 struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags)
4897 * shmem_file_setup_with_mnt - get an unlinked file living in tmpfs
4898 * @mnt: the tmpfs mount where the file will be created
4900 * @size: size to be set for the file
4903 struct file *shmem_file_setup_with_mnt(struct vfsmount *mnt, const char *name,
4916 struct file *file;
4920 * Cloning a new file under mmap_lock leads to a lock ordering conflict
4921 * between XFS directory reading and selinux: since this file is only
4923 * bypass file security, in the same way as shmem_kernel_file_setup().
4925 file = shmem_kernel_file_setup("dev/zero", size, vma->vm_flags);
4926 if (IS_ERR(file))
4927 return PTR_ERR(file);
4931 vma->vm_file = file;