Lines Matching refs:file

33 #include <linux/file.h>

54 struct file *shm_file;
77 struct file *file;
81 #define shm_file_data(file) (*((struct shm_file_data **)&(file)->private_data))
273 struct file *file = vma->vm_file;
274 struct shm_file_data *sfd = shm_file_data(file);
282 if (shp->shm_file != sfd->file) {
317 struct file *shm_file;
360 struct file *file = vma->vm_file;
361 struct shm_file_data *sfd = shm_file_data(file);
519 struct file *file = vmf->vma->vm_file;
520 struct shm_file_data *sfd = shm_file_data(file);
527 struct file *file = vma->vm_file;
528 struct shm_file_data *sfd = shm_file_data(file);
539 struct file *file = vma->vm_file;
540 struct shm_file_data *sfd = shm_file_data(file);
552 struct file *file = vma->vm_file;
553 struct shm_file_data *sfd = shm_file_data(file);
564 struct file *file = vma->vm_file;
565 struct shm_file_data *sfd = shm_file_data(file);
578 static int shm_mmap(struct file *file, struct vm_area_struct *vma)
580 struct shm_file_data *sfd = shm_file_data(file);
584 * In case of remap_file_pages() emulation, the file can represent an
593 ret = call_mmap(sfd->file, vma);
606 static int shm_release(struct inode *ino, struct file *file)
608 struct shm_file_data *sfd = shm_file_data(file);
611 fput(sfd->file);
612 shm_file_data(file) = NULL;
617 static int shm_fsync(struct file *file, loff_t start, loff_t end, int datasync)
619 struct shm_file_data *sfd = shm_file_data(file);
621 if (!sfd->file->f_op->fsync) {
624 return sfd->file->f_op->fsync(sfd->file, start, end, datasync);
627 static long shm_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
629 struct shm_file_data *sfd = shm_file_data(file);
631 if (!sfd->file->f_op->fallocate) {
634 return sfd->file->f_op->fallocate(file, mode, offset, len);
637 static unsigned long shm_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
640 struct shm_file_data *sfd = shm_file_data(file);
642 return sfd->file->f_op->get_unmapped_area(sfd->file, addr, len, pgoff, flags);
667 bool is_file_shm_hugepages(struct file *file)
669 return file->f_op == &shm_file_operations_huge;
699 struct file *file;
747 file = hugetlb_file_setup(name, hugesize, acctflag, &shp->mlock_user, HUGETLB_SHMFS_INODE,
757 file = shmem_kernel_file_setup(name, size, acctflag);
759 error = PTR_ERR(file);
760 if (IS_ERR(file)) {
770 shp->shm_file = file;
788 file_inode(file)->i_ino = shp->shm_perm.id;
800 if (is_file_hugepages(file) && shp->mlock_user) {
803 fput(file);
1166 struct file *shm_file;
1535 struct file *file, *base;
1621 * We need to take a reference to the real shm file to prevent the
1623 * file extends beyond that of the shm segment. It's not usually
1625 * that unmaps the memory, then does ->mmap() via file reference only.
1627 * detect shm ID reuse we need to compare the file pointers.
1642 file = alloc_file_clone(base, f_flags, is_file_hugepages(base) ? &shm_file_operations_huge : &shm_file_operations);
1643 err = PTR_ERR(file);
1644 if (IS_ERR(file)) {
1652 sfd->file = base;
1654 file->private_data = sfd;
1656 err = security_mmap_file(file, prot, flags);
1677 addr = do_mmap(file, addr, size, prot, flags, 0, &populate, NULL);
1690 fput(file);
1755 struct file *file;
1802 * Record the file of the shm segment being
1807 file = vma->vm_file;
1834 (vma->vm_file == file)) {