Merge branch 'stable-3.2' into pandora-3.2
[pandora-kernel.git] / fs / aufs / f_op.c
1 /*
2  * Copyright (C) 2005-2012 Junjiro R. Okajima
3  *
4  * This program, aufs is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17  */
18
19 /*
20  * file and vm operations
21  */
22
23 #include <linux/fs_stack.h>
24 #include <linux/mman.h>
25 #include <linux/security.h>
26 #include "aufs.h"
27
28 int au_do_open_nondir(struct file *file, int flags)
29 {
30         int err;
31         aufs_bindex_t bindex;
32         struct file *h_file;
33         struct dentry *dentry;
34         struct au_finfo *finfo;
35
36         FiMustWriteLock(file);
37
38         dentry = file->f_dentry;
39         err = au_d_alive(dentry);
40         if (unlikely(err))
41                 goto out;
42
43         finfo = au_fi(file);
44         memset(&finfo->fi_htop, 0, sizeof(finfo->fi_htop));
45         atomic_set(&finfo->fi_mmapped, 0);
46         bindex = au_dbstart(dentry);
47         h_file = au_h_open(dentry, bindex, flags, file);
48         if (IS_ERR(h_file))
49                 err = PTR_ERR(h_file);
50         else {
51                 au_set_fbstart(file, bindex);
52                 au_set_h_fptr(file, bindex, h_file);
53                 au_update_figen(file);
54                 /* todo: necessary? */
55                 /* file->f_ra = h_file->f_ra; */
56         }
57
58 out:
59         return err;
60 }
61
62 static int aufs_open_nondir(struct inode *inode __maybe_unused,
63                             struct file *file)
64 {
65         int err;
66         struct super_block *sb;
67
68         AuDbg("%.*s, f_flags 0x%x, f_mode 0x%x\n",
69               AuDLNPair(file->f_dentry), vfsub_file_flags(file),
70               file->f_mode);
71
72         sb = file->f_dentry->d_sb;
73         si_read_lock(sb, AuLock_FLUSH);
74         err = au_do_open(file, au_do_open_nondir, /*fidir*/NULL);
75         si_read_unlock(sb);
76         return err;
77 }
78
79 int aufs_release_nondir(struct inode *inode __maybe_unused, struct file *file)
80 {
81         struct au_finfo *finfo;
82         aufs_bindex_t bindex;
83
84         finfo = au_fi(file);
85         bindex = finfo->fi_btop;
86         if (bindex >= 0) {
87                 /* remove me from sb->s_files */
88                 file_sb_list_del(file);
89                 au_set_h_fptr(file, bindex, NULL);
90         }
91
92         au_finfo_fin(file);
93         return 0;
94 }
95
96 /* ---------------------------------------------------------------------- */
97
98 static int au_do_flush_nondir(struct file *file, fl_owner_t id)
99 {
100         int err;
101         struct file *h_file;
102
103         err = 0;
104         h_file = au_hf_top(file);
105         if (h_file)
106                 err = vfsub_flush(h_file, id);
107         return err;
108 }
109
110 static int aufs_flush_nondir(struct file *file, fl_owner_t id)
111 {
112         return au_do_flush(file, id, au_do_flush_nondir);
113 }
114
115 /* ---------------------------------------------------------------------- */
116 /*
117  * read and write functions acquire [fdi]_rwsem once, but release before
118  * mmap_sem. This is because to stop a race condition between mmap(2).
119  * Releasing these aufs-rwsem should be safe, no branch-mamagement (by keeping
120  * si_rwsem), no harmful copy-up should happen. Actually copy-up may happen in
121  * read functions after [fdi]_rwsem are released, but it should be harmless.
122  */
123
124 static ssize_t aufs_read(struct file *file, char __user *buf, size_t count,
125                          loff_t *ppos)
126 {
127         ssize_t err;
128         struct dentry *dentry;
129         struct file *h_file;
130         struct super_block *sb;
131
132         dentry = file->f_dentry;
133         sb = dentry->d_sb;
134         si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW);
135         err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0);
136         if (unlikely(err))
137                 goto out;
138
139         h_file = au_hf_top(file);
140         get_file(h_file);
141         di_read_unlock(dentry, AuLock_IR);
142         fi_read_unlock(file);
143
144         /* filedata may be obsoleted by concurrent copyup, but no problem */
145         err = vfsub_read_u(h_file, buf, count, ppos);
146         /* todo: necessary? */
147         /* file->f_ra = h_file->f_ra; */
148         /* update without lock, I don't think it a problem */
149         fsstack_copy_attr_atime(dentry->d_inode, h_file->f_dentry->d_inode);
150         fput(h_file);
151
152 out:
153         si_read_unlock(sb);
154         return err;
155 }
156
157 /*
158  * todo: very ugly
159  * it locks both of i_mutex and si_rwsem for read in safe.
160  * if the plink maintenance mode continues forever (that is the problem),
161  * may loop forever.
162  */
163 static void au_mtx_and_read_lock(struct inode *inode)
164 {
165         int err;
166         struct super_block *sb = inode->i_sb;
167
168         while (1) {
169                 mutex_lock(&inode->i_mutex);
170                 err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM);
171                 if (!err)
172                         break;
173                 mutex_unlock(&inode->i_mutex);
174                 si_read_lock(sb, AuLock_NOPLMW);
175                 si_read_unlock(sb);
176         }
177 }
178
179 static ssize_t aufs_write(struct file *file, const char __user *ubuf,
180                           size_t count, loff_t *ppos)
181 {
182         ssize_t err;
183         struct au_pin pin;
184         struct dentry *dentry;
185         struct super_block *sb;
186         struct inode *inode;
187         struct file *h_file;
188         char __user *buf = (char __user *)ubuf;
189
190         dentry = file->f_dentry;
191         sb = dentry->d_sb;
192         inode = dentry->d_inode;
193         au_mtx_and_read_lock(inode);
194
195         err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1);
196         if (unlikely(err))
197                 goto out;
198
199         err = au_ready_to_write(file, -1, &pin);
200         di_downgrade_lock(dentry, AuLock_IR);
201         if (unlikely(err)) {
202                 di_read_unlock(dentry, AuLock_IR);
203                 fi_write_unlock(file);
204                 goto out;
205         }
206
207         h_file = au_hf_top(file);
208         get_file(h_file);
209         au_unpin(&pin);
210         di_read_unlock(dentry, AuLock_IR);
211         fi_write_unlock(file);
212
213         err = vfsub_write_u(h_file, buf, count, ppos);
214         ii_write_lock_child(inode);
215         au_cpup_attr_timesizes(inode);
216         inode->i_mode = h_file->f_dentry->d_inode->i_mode;
217         ii_write_unlock(inode);
218         fput(h_file);
219
220 out:
221         si_read_unlock(sb);
222         mutex_unlock(&inode->i_mutex);
223         return err;
224 }
225
226 static ssize_t au_do_aio(struct file *h_file, int rw, struct kiocb *kio,
227                          const struct iovec *iov, unsigned long nv, loff_t pos)
228 {
229         ssize_t err;
230         struct file *file;
231         ssize_t (*func)(struct kiocb *, const struct iovec *, unsigned long,
232                         loff_t);
233
234         err = security_file_permission(h_file, rw);
235         if (unlikely(err))
236                 goto out;
237
238         err = -ENOSYS;
239         func = NULL;
240         if (rw == MAY_READ)
241                 func = h_file->f_op->aio_read;
242         else if (rw == MAY_WRITE)
243                 func = h_file->f_op->aio_write;
244         if (func) {
245                 file = kio->ki_filp;
246                 kio->ki_filp = h_file;
247                 lockdep_off();
248                 err = func(kio, iov, nv, pos);
249                 lockdep_on();
250                 kio->ki_filp = file;
251         } else
252                 /* currently there is no such fs */
253                 WARN_ON_ONCE(1);
254
255 out:
256         return err;
257 }
258
259 static ssize_t aufs_aio_read(struct kiocb *kio, const struct iovec *iov,
260                              unsigned long nv, loff_t pos)
261 {
262         ssize_t err;
263         struct file *file, *h_file;
264         struct dentry *dentry;
265         struct super_block *sb;
266
267         file = kio->ki_filp;
268         dentry = file->f_dentry;
269         sb = dentry->d_sb;
270         si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW);
271         err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0);
272         if (unlikely(err))
273                 goto out;
274
275         h_file = au_hf_top(file);
276         get_file(h_file);
277         di_read_unlock(dentry, AuLock_IR);
278         fi_read_unlock(file);
279
280         err = au_do_aio(h_file, MAY_READ, kio, iov, nv, pos);
281         /* todo: necessary? */
282         /* file->f_ra = h_file->f_ra; */
283         /* update without lock, I don't think it a problem */
284         fsstack_copy_attr_atime(dentry->d_inode, h_file->f_dentry->d_inode);
285         fput(h_file);
286
287 out:
288         si_read_unlock(sb);
289         return err;
290 }
291
292 static ssize_t aufs_aio_write(struct kiocb *kio, const struct iovec *iov,
293                               unsigned long nv, loff_t pos)
294 {
295         ssize_t err;
296         struct au_pin pin;
297         struct dentry *dentry;
298         struct inode *inode;
299         struct file *file, *h_file;
300         struct super_block *sb;
301
302         file = kio->ki_filp;
303         dentry = file->f_dentry;
304         sb = dentry->d_sb;
305         inode = dentry->d_inode;
306         au_mtx_and_read_lock(inode);
307
308         err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1);
309         if (unlikely(err))
310                 goto out;
311
312         err = au_ready_to_write(file, -1, &pin);
313         di_downgrade_lock(dentry, AuLock_IR);
314         if (unlikely(err)) {
315                 di_read_unlock(dentry, AuLock_IR);
316                 fi_write_unlock(file);
317                 goto out;
318         }
319
320         h_file = au_hf_top(file);
321         get_file(h_file);
322         au_unpin(&pin);
323         di_read_unlock(dentry, AuLock_IR);
324         fi_write_unlock(file);
325
326         err = au_do_aio(h_file, MAY_WRITE, kio, iov, nv, pos);
327         ii_write_lock_child(inode);
328         au_cpup_attr_timesizes(inode);
329         inode->i_mode = h_file->f_dentry->d_inode->i_mode;
330         ii_write_unlock(inode);
331         fput(h_file);
332
333 out:
334         si_read_unlock(sb);
335         mutex_unlock(&inode->i_mutex);
336         return err;
337 }
338
339 static ssize_t aufs_splice_read(struct file *file, loff_t *ppos,
340                                 struct pipe_inode_info *pipe, size_t len,
341                                 unsigned int flags)
342 {
343         ssize_t err;
344         struct file *h_file;
345         struct dentry *dentry;
346         struct super_block *sb;
347
348         dentry = file->f_dentry;
349         sb = dentry->d_sb;
350         si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW);
351         err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0);
352         if (unlikely(err))
353                 goto out;
354
355         err = -EINVAL;
356         h_file = au_hf_top(file);
357         get_file(h_file);
358         if (au_test_loopback_kthread()) {
359                 au_warn_loopback(h_file->f_dentry->d_sb);
360                 if (file->f_mapping != h_file->f_mapping) {
361                         file->f_mapping = h_file->f_mapping;
362                         smp_mb(); /* unnecessary? */
363                 }
364         }
365         di_read_unlock(dentry, AuLock_IR);
366         fi_read_unlock(file);
367
368         err = vfsub_splice_to(h_file, ppos, pipe, len, flags);
369         /* todo: necessasry? */
370         /* file->f_ra = h_file->f_ra; */
371         /* update without lock, I don't think it a problem */
372         fsstack_copy_attr_atime(dentry->d_inode, h_file->f_dentry->d_inode);
373         fput(h_file);
374
375 out:
376         si_read_unlock(sb);
377         return err;
378 }
379
380 static ssize_t
381 aufs_splice_write(struct pipe_inode_info *pipe, struct file *file, loff_t *ppos,
382                   size_t len, unsigned int flags)
383 {
384         ssize_t err;
385         struct au_pin pin;
386         struct dentry *dentry;
387         struct inode *inode;
388         struct file *h_file;
389         struct super_block *sb;
390
391         dentry = file->f_dentry;
392         sb = dentry->d_sb;
393         inode = dentry->d_inode;
394         au_mtx_and_read_lock(inode);
395
396         err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1);
397         if (unlikely(err))
398                 goto out;
399
400         err = au_ready_to_write(file, -1, &pin);
401         di_downgrade_lock(dentry, AuLock_IR);
402         if (unlikely(err)) {
403                 di_read_unlock(dentry, AuLock_IR);
404                 fi_write_unlock(file);
405                 goto out;
406         }
407
408         h_file = au_hf_top(file);
409         get_file(h_file);
410         au_unpin(&pin);
411         di_read_unlock(dentry, AuLock_IR);
412         fi_write_unlock(file);
413
414         err = vfsub_splice_from(pipe, h_file, ppos, len, flags);
415         ii_write_lock_child(inode);
416         au_cpup_attr_timesizes(inode);
417         inode->i_mode = h_file->f_dentry->d_inode->i_mode;
418         ii_write_unlock(inode);
419         fput(h_file);
420
421 out:
422         si_read_unlock(sb);
423         mutex_unlock(&inode->i_mutex);
424         return err;
425 }
426
427 /* ---------------------------------------------------------------------- */
428
429 /*
430  * The locking order around current->mmap_sem.
431  * - in most and regular cases
432  *   file I/O syscall -- aufs_read() or something
433  *      -- si_rwsem for read -- mmap_sem
434  *      (Note that [fdi]i_rwsem are released before mmap_sem).
435  * - in mmap case
436  *   mmap(2) -- mmap_sem -- aufs_mmap() -- si_rwsem for read -- [fdi]i_rwsem
437  * This AB-BA order is definitly bad, but is not a problem since "si_rwsem for
438  * read" allows muliple processes to acquire it and [fdi]i_rwsem are not held in
439  * file I/O. Aufs needs to stop lockdep in aufs_mmap() though.
440  * It means that when aufs acquires si_rwsem for write, the process should never
441  * acquire mmap_sem.
442  *
443  * Actually aufs_readdir() holds [fdi]i_rwsem before mmap_sem, but this is not a
444  * problem either since any directory is not able to be mmap-ed.
445  * The similar scenario is applied to aufs_readlink() too.
446  */
447
448 /* cf. linux/include/linux/mman.h: calc_vm_prot_bits() */
449 #define AuConv_VM_PROT(f, b)    _calc_vm_trans(f, VM_##b, PROT_##b)
450
451 static unsigned long au_arch_prot_conv(unsigned long flags)
452 {
453         /* currently ppc64 only */
454 #ifdef CONFIG_PPC64
455         /* cf. linux/arch/powerpc/include/asm/mman.h */
456         AuDebugOn(arch_calc_vm_prot_bits(-1) != VM_SAO);
457         return AuConv_VM_PROT(flags, SAO);
458 #else
459         AuDebugOn(arch_calc_vm_prot_bits(-1));
460         return 0;
461 #endif
462 }
463
464 static unsigned long au_prot_conv(unsigned long flags)
465 {
466         return AuConv_VM_PROT(flags, READ)
467                 | AuConv_VM_PROT(flags, WRITE)
468                 | AuConv_VM_PROT(flags, EXEC)
469                 | au_arch_prot_conv(flags);
470 }
471
472 /* cf. linux/include/linux/mman.h: calc_vm_flag_bits() */
473 #define AuConv_VM_MAP(f, b)     _calc_vm_trans(f, VM_##b, MAP_##b)
474
475 static unsigned long au_flag_conv(unsigned long flags)
476 {
477         return AuConv_VM_MAP(flags, GROWSDOWN)
478                 | AuConv_VM_MAP(flags, DENYWRITE)
479                 | AuConv_VM_MAP(flags, EXECUTABLE)
480                 | AuConv_VM_MAP(flags, LOCKED);
481 }
482
483 static int aufs_mmap(struct file *file, struct vm_area_struct *vma)
484 {
485         int err;
486         unsigned long prot;
487         aufs_bindex_t bstart;
488         const unsigned char wlock
489                 = (file->f_mode & FMODE_WRITE) && (vma->vm_flags & VM_SHARED);
490         struct dentry *dentry;
491         struct super_block *sb;
492         struct file *h_file;
493         struct au_branch *br;
494         struct au_pin pin;
495
496         AuDbgVmRegion(file, vma);
497
498         dentry = file->f_dentry;
499         sb = dentry->d_sb;
500         lockdep_off();
501         si_read_lock(sb, AuLock_NOPLMW);
502         err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1);
503         if (unlikely(err))
504                 goto out;
505
506         if (wlock) {
507                 err = au_ready_to_write(file, -1, &pin);
508                 di_write_unlock(dentry);
509                 if (unlikely(err)) {
510                         fi_write_unlock(file);
511                         goto out;
512                 }
513                 au_unpin(&pin);
514         } else
515                 di_write_unlock(dentry);
516
517         bstart = au_fbstart(file);
518         br = au_sbr(sb, bstart);
519         h_file = au_hf_top(file);
520         get_file(h_file);
521         au_set_mmapped(file);
522         fi_write_unlock(file);
523         lockdep_on();
524
525         au_vm_file_reset(vma, h_file);
526         prot = au_prot_conv(vma->vm_flags);
527         err = security_file_mmap(h_file, /*reqprot*/prot, prot,
528                                  au_flag_conv(vma->vm_flags), vma->vm_start, 0);
529         if (!err)
530                 err = h_file->f_op->mmap(h_file, vma);
531         if (unlikely(err))
532                 goto out_reset;
533
534         au_vm_prfile_set(vma, file);
535         /* update without lock, I don't think it a problem */
536         fsstack_copy_attr_atime(file->f_dentry->d_inode,
537                                 h_file->f_dentry->d_inode);
538         goto out_fput; /* success */
539
540 out_reset:
541         au_unset_mmapped(file);
542         au_vm_file_reset(vma, file);
543 out_fput:
544         fput(h_file);
545         lockdep_off();
546 out:
547         si_read_unlock(sb);
548         lockdep_on();
549         AuTraceErr(err);
550         return err;
551 }
552
553 /* ---------------------------------------------------------------------- */
554
555 static int aufs_fsync_nondir(struct file *file, loff_t start, loff_t end,
556                              int datasync)
557 {
558         int err;
559         struct au_pin pin;
560         struct dentry *dentry;
561         struct inode *inode;
562         struct file *h_file;
563         struct super_block *sb;
564
565         dentry = file->f_dentry;
566         inode = dentry->d_inode;
567         sb = dentry->d_sb;
568         mutex_lock(&inode->i_mutex);
569         err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM);
570         if (unlikely(err))
571                 goto out;
572
573         err = 0; /* -EBADF; */ /* posix? */
574         if (unlikely(!(file->f_mode & FMODE_WRITE)))
575                 goto out_si;
576         err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1);
577         if (unlikely(err))
578                 goto out_si;
579
580         err = au_ready_to_write(file, -1, &pin);
581         di_downgrade_lock(dentry, AuLock_IR);
582         if (unlikely(err))
583                 goto out_unlock;
584         au_unpin(&pin);
585
586         err = -EINVAL;
587         h_file = au_hf_top(file);
588         err = vfsub_fsync(h_file, &h_file->f_path, datasync);
589         au_cpup_attr_timesizes(inode);
590
591 out_unlock:
592         di_read_unlock(dentry, AuLock_IR);
593         fi_write_unlock(file);
594 out_si:
595         si_read_unlock(sb);
596 out:
597         mutex_unlock(&inode->i_mutex);
598         return err;
599 }
600
601 /* no one supports this operation, currently */
602 #if 0
603 static int aufs_aio_fsync_nondir(struct kiocb *kio, int datasync)
604 {
605         int err;
606         struct au_pin pin;
607         struct dentry *dentry;
608         struct inode *inode;
609         struct file *file, *h_file;
610
611         file = kio->ki_filp;
612         dentry = file->f_dentry;
613         inode = dentry->d_inode;
614         au_mtx_and_read_lock(inode);
615
616         err = 0; /* -EBADF; */ /* posix? */
617         if (unlikely(!(file->f_mode & FMODE_WRITE)))
618                 goto out;
619         err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1);
620         if (unlikely(err))
621                 goto out;
622
623         err = au_ready_to_write(file, -1, &pin);
624         di_downgrade_lock(dentry, AuLock_IR);
625         if (unlikely(err))
626                 goto out_unlock;
627         au_unpin(&pin);
628
629         err = -ENOSYS;
630         h_file = au_hf_top(file);
631         if (h_file->f_op && h_file->f_op->aio_fsync) {
632                 struct dentry *h_d;
633                 struct mutex *h_mtx;
634
635                 h_d = h_file->f_dentry;
636                 h_mtx = &h_d->d_inode->i_mutex;
637                 if (!is_sync_kiocb(kio)) {
638                         get_file(h_file);
639                         fput(file);
640                 }
641                 kio->ki_filp = h_file;
642                 err = h_file->f_op->aio_fsync(kio, datasync);
643                 mutex_lock_nested(h_mtx, AuLsc_I_CHILD);
644                 if (!err)
645                         vfsub_update_h_iattr(&h_file->f_path, /*did*/NULL);
646                 /*ignore*/
647                 au_cpup_attr_timesizes(inode);
648                 mutex_unlock(h_mtx);
649         }
650
651 out_unlock:
652         di_read_unlock(dentry, AuLock_IR);
653         fi_write_unlock(file);
654 out:
655         si_read_unlock(inode->sb);
656         mutex_unlock(&inode->i_mutex);
657         return err;
658 }
659 #endif
660
661 static int aufs_fasync(int fd, struct file *file, int flag)
662 {
663         int err;
664         struct file *h_file;
665         struct dentry *dentry;
666         struct super_block *sb;
667
668         dentry = file->f_dentry;
669         sb = dentry->d_sb;
670         si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW);
671         err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0);
672         if (unlikely(err))
673                 goto out;
674
675         h_file = au_hf_top(file);
676         if (h_file->f_op && h_file->f_op->fasync)
677                 err = h_file->f_op->fasync(fd, h_file, flag);
678
679         di_read_unlock(dentry, AuLock_IR);
680         fi_read_unlock(file);
681
682 out:
683         si_read_unlock(sb);
684         return err;
685 }
686
687 /* ---------------------------------------------------------------------- */
688
689 /* no one supports this operation, currently */
690 #if 0
691 static ssize_t aufs_sendpage(struct file *file, struct page *page, int offset,
692                              size_t len, loff_t *pos , int more)
693 {
694 }
695 #endif
696
697 /* ---------------------------------------------------------------------- */
698
699 const struct file_operations aufs_file_fop = {
700         .owner          = THIS_MODULE,
701
702         .llseek         = default_llseek,
703
704         .read           = aufs_read,
705         .write          = aufs_write,
706         .aio_read       = aufs_aio_read,
707         .aio_write      = aufs_aio_write,
708 #ifdef CONFIG_AUFS_POLL
709         .poll           = aufs_poll,
710 #endif
711         .unlocked_ioctl = aufs_ioctl_nondir,
712 #ifdef CONFIG_COMPAT
713         .compat_ioctl   = aufs_ioctl_nondir, /* same */
714 #endif
715         .mmap           = aufs_mmap,
716         .open           = aufs_open_nondir,
717         .flush          = aufs_flush_nondir,
718         .release        = aufs_release_nondir,
719         .fsync          = aufs_fsync_nondir,
720         /* .aio_fsync   = aufs_aio_fsync_nondir, */
721         .fasync         = aufs_fasync,
722         /* .sendpage    = aufs_sendpage, */
723         .splice_write   = aufs_splice_write,
724         .splice_read    = aufs_splice_read,
725 #if 0
726         .aio_splice_write = aufs_aio_splice_write,
727         .aio_splice_read  = aufs_aio_splice_read
728 #endif
729 };