git://git.camperquake.de
/
zfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Register .sync_fs handler
[zfs.git]
/
module
/
zfs
/
zfs_vfsops.c
diff --git
a/module/zfs/zfs_vfsops.c
b/module/zfs/zfs_vfsops.c
index
028638d
..
1e8e6af
100644
(file)
--- a/
module/zfs/zfs_vfsops.c
+++ b/
module/zfs/zfs_vfsops.c
@@
-69,8
+69,10
@@
/*ARGSUSED*/
int
/*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.
/*
* 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);
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.
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);
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.
/*
* 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 (s
ys_shutdown && s
pa_suspended(dp->dp_spa)) {
+ if (spa_suspended(dp->dp_spa)) {
ZFS_EXIT(zsb);
return (0);
}
ZFS_EXIT(zsb);
return (0);
}
-#endif /* HAVE_SHUTDOWN */
if (zsb->z_log != NULL)
zil_commit(zsb->z_log, 0);
if (zsb->z_log != NULL)
zil_commit(zsb->z_log, 0);
@@
-1029,7
+1033,7
@@
zfs_statvfs(struct dentry *dentry, struct kstatfs *statp)
*/
statp->f_ffree = MIN(availobjs, statp->f_bfree);
statp->f_files = statp->f_ffree + usedobjs;
*/
statp->f_ffree = MIN(availobjs, statp->f_bfree);
statp->f_files = statp->f_ffree + usedobjs;
- statp->f_fsid.val[0] =
0; /* XXX: Map up some unique ID */
+ statp->f_fsid.val[0] =
dentry->d_sb->s_dev;
statp->f_fsid.val[1] = 0;
statp->f_type = ZFS_SUPER_MAGIC;
statp->f_namelen = ZFS_MAXNAMELEN;
statp->f_fsid.val[1] = 0;
statp->f_type = ZFS_SUPER_MAGIC;
statp->f_namelen = ZFS_MAXNAMELEN;