git: sys/kern: Don't implement .vfs_sync unless sync is supported

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Thu Jun 2 16:47:33 PDT 2016


commit ef560bee278f06774ef808da1d503e9b1350f938
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Wed May 25 00:09:48 2016 +0900

    sys/kern: Don't implement .vfs_sync unless sync is supported
    
    The only reason filesystems without requirement of syncing
    (e.g. no backing storage) need to implement .vfs_sync is because
    those fs need a sync with a return value of 0 on unmount.
    
    If unmount allows sync with return value of EOPNOTSUPP for fs
    that do not support sync, those fs no longer have to implement
    .vfs_sync with vfs_stdsync() only to pass dounmount().
    
    The drawback is when there is a sync (other than vfs_stdnosync)
    that returns EOPNOTSUPP for real errors. The existing fs in
    DragonFly don't do this (and shouldn't either).
    
    Also see https://bugs.dragonflybsd.org/issues/2912.
    
     # grep "\.vfs_sync" sys/vfs sys/gnu/vfs -rI | grep vfs_stdsync
     sys/vfs/udf/udf_vfsops.c:       .vfs_sync =             vfs_stdsync,
     sys/vfs/portal/portal_vfsops.c: .vfs_sync =             vfs_stdsync
     sys/vfs/devfs/devfs_vfsops.c:   .vfs_sync       = vfs_stdsync,
     sys/vfs/isofs/cd9660/cd9660_vfsops.c:   .vfs_sync =             vfs_stdsync,
     sys/vfs/autofs/autofs_vfsops.c: .vfs_sync =             vfs_stdsync,    /* for unmount(2) */
     sys/vfs/tmpfs/tmpfs_vfsops.c:   .vfs_sync =                     vfs_stdsync,
     sys/vfs/dirfs/dirfs_vfsops.c:   .vfs_sync =                     vfs_stdsync,
     sys/vfs/ntfs/ntfs_vfsops.c:     .vfs_sync =             vfs_stdsync,
     sys/vfs/procfs/procfs_vfsops.c: .vfs_sync =             vfs_stdsync
     sys/vfs/hpfs/hpfs_vfsops.c:     .vfs_sync =             vfs_stdsync,
     sys/vfs/nullfs/null_vfsops.c:   .vfs_sync =             vfs_stdsync,

Summary of changes:
 sys/kern/vfs_syscalls.c              | 16 ++++++++--------
 sys/vfs/devfs/devfs_vfsops.c         |  1 -
 sys/vfs/dirfs/dirfs_vfsops.c         |  1 -
 sys/vfs/hpfs/hpfs_vfsops.c           |  1 -
 sys/vfs/isofs/cd9660/cd9660_vfsops.c |  1 -
 sys/vfs/ntfs/ntfs_vfsops.c           |  1 -
 sys/vfs/nullfs/null_vfsops.c         |  1 -
 sys/vfs/portal/portal_vfsops.c       |  1 -
 sys/vfs/procfs/procfs_vfsops.c       |  1 -
 sys/vfs/tmpfs/tmpfs_vfsops.c         |  1 -
 sys/vfs/udf/udf_vfsops.c             |  1 -
 11 files changed, 8 insertions(+), 18 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/ef560bee278f06774ef808da1d503e9b1350f938


-- 
DragonFly BSD source repository


More information about the Commits mailing list