X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fzfs_vfsops.c;h=e71aa91e1d689e9f38ae0b714e8579a6088ee73c;hb=10715a018760e1d862b8348e31dc505e832a0904;hp=ea7e9cec9330a58285e67285ce8e5e8aaa5e55bf;hpb=53cf50e0816a89749b3ea4d51d5d9c9605bcc3e8;p=zfs.git diff --git a/module/zfs/zfs_vfsops.c b/module/zfs/zfs_vfsops.c index ea7e9ce..e71aa91 100644 --- a/module/zfs/zfs_vfsops.c +++ b/module/zfs/zfs_vfsops.c @@ -69,8 +69,10 @@ /*ARGSUSED*/ int -zfs_sync(zfs_sb_t *zsb, short flag, cred_t *cr) +zfs_sync(struct super_block *sb, int wait, cred_t *cr) { + zfs_sb_t *zsb = sb->s_fs_info; + /* * Data integrity is job one. We don't want a compromised kernel * writing to the storage pool, so we never sync during panic. @@ -78,6 +80,13 @@ zfs_sync(zfs_sb_t *zsb, short flag, cred_t *cr) if (unlikely(oops_in_progress)) return (0); + /* + * Semantically, the only requirement is that the sync be initiated. + * The DMU syncs out txgs frequently, so there's nothing to do. + */ + if (!wait) + return (0); + if (zsb != NULL) { /* * Sync a specific filesystem. @@ -87,19 +96,14 @@ zfs_sync(zfs_sb_t *zsb, short flag, cred_t *cr) ZFS_ENTER(zsb); dp = dmu_objset_pool(zsb->z_os); -#ifdef HAVE_SHUTDOWN /* * If the system is shutting down, then skip any * filesystems which may exist on a suspended pool. - * - * XXX: This can be implemented using the Linux reboot - * notifiers: {un}register_reboot_notifier(). */ - if (sys_shutdown && spa_suspended(dp->dp_spa)) { + if (spa_suspended(dp->dp_spa)) { ZFS_EXIT(zsb); return (0); } -#endif /* HAVE_SHUTDOWN */ if (zsb->z_log != NULL) zil_commit(zsb->z_log, 0); @@ -1084,7 +1088,7 @@ zfsvfs_teardown(zfs_sb_t *zsb, boolean_t unmounting) * for non-snapshots. */ shrink_dcache_sb(zsb->z_parent->z_sb); - invalidate_inodes(zsb->z_parent->z_sb); + (void) spl_invalidate_inodes(zsb->z_parent->z_sb, 0); } /* @@ -1202,9 +1206,7 @@ zfs_domount(struct super_block *sb, void *data, int silent) /* Set callback operations for the file system. */ sb->s_op = &zpl_super_operations; sb->s_xattr = zpl_xattr_handlers; -#ifdef HAVE_EXPORTS - sb->s_export_op = &zpl_export_operations; -#endif /* HAVE_EXPORTS */ + sb->s_export_op = &zpl_export_operations; /* Set features for file system. */ zfs_set_fuid_feature(zsb); @@ -1288,6 +1290,46 @@ zfs_umount(struct super_block *sb) EXPORT_SYMBOL(zfs_umount); int +zfs_remount(struct super_block *sb, int *flags, char *data) +{ + zfs_sb_t *zsb = sb->s_fs_info; + boolean_t readonly = B_FALSE; + boolean_t setuid = B_TRUE; + boolean_t exec = B_TRUE; + boolean_t devices = B_TRUE; + boolean_t atime = B_TRUE; + + if (*flags & MS_RDONLY) + readonly = B_TRUE; + + if (*flags & MS_NOSUID) { + devices = B_FALSE; + setuid = B_FALSE; + } else { + if (*flags & MS_NODEV) + devices = B_FALSE; + } + + if (*flags & MS_NOEXEC) + exec = B_FALSE; + + if (*flags & MS_NOATIME) + atime = B_FALSE; + + /* + * Invoke our callbacks to set required flags. + */ + readonly_changed_cb(zsb, readonly); + setuid_changed_cb(zsb, setuid); + exec_changed_cb(zsb, exec); + devices_changed_cb(zsb, devices); + atime_changed_cb(zsb, atime); + + return (0); +} +EXPORT_SYMBOL(zfs_remount); + +int zfs_vget(struct vfsmount *vfsp, struct inode **ipp, fid_t *fidp) { zfs_sb_t *zsb = VTOZSB(vfsp);