4 * Copyright (c) 2013 Samsung Electronics Co. Ltd
5 * Authors: Daeho Jeong, Woojoong Lee, Seunghwan Hyun,
6 * Sunghwan Yun, Sungjong Seo
8 * This program has been developed as a stackable file system based on
9 * the WrapFS which written by
11 * Copyright (c) 1998-2011 Erez Zadok
12 * Copyright (c) 2009 Shrikar Archak
13 * Copyright (c) 2003-2011 Stony Brook University
14 * Copyright (c) 2003-2011 The Research Foundation of SUNY
16 * This file is dual licensed. It may be redistributed and/or modified
17 * under the terms of the Apache 2.0 License OR version 2 of the GNU
18 * General Public License.
23 static int sdcardfs_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
27 const struct vm_operations_struct *lower_vm_ops;
29 file = (struct file *)vma->vm_private_data;
30 lower_vm_ops = SDCARDFS_F(file)->lower_vm_ops;
31 BUG_ON(!lower_vm_ops);
33 err = lower_vm_ops->fault(vma, vmf);
37 static void sdcardfs_vm_open(struct vm_area_struct *vma)
39 struct file *file = (struct file *)vma->vm_private_data;
44 static void sdcardfs_vm_close(struct vm_area_struct *vma)
46 struct file *file = (struct file *)vma->vm_private_data;
51 static int sdcardfs_page_mkwrite(struct vm_area_struct *vma,
56 const struct vm_operations_struct *lower_vm_ops;
58 file = (struct file *)vma->vm_private_data;
59 lower_vm_ops = SDCARDFS_F(file)->lower_vm_ops;
60 BUG_ON(!lower_vm_ops);
61 if (!lower_vm_ops->page_mkwrite)
64 err = lower_vm_ops->page_mkwrite(vma, vmf);
69 static ssize_t sdcardfs_direct_IO(struct kiocb *iocb,
70 struct iov_iter *iter, loff_t pos)
73 * This function should never be called directly. We need it
74 * to exist, to get past a check in open_check_o_direct(),
75 * which is called from do_last().
80 const struct address_space_operations sdcardfs_aops = {
81 .direct_IO = sdcardfs_direct_IO,
84 const struct vm_operations_struct sdcardfs_vm_ops = {
85 .fault = sdcardfs_fault,
86 .page_mkwrite = sdcardfs_page_mkwrite,
87 .open = sdcardfs_vm_open,
88 .close = sdcardfs_vm_close,