Whamcloud - gitweb
- add fs_sink filter method which blocks until the backing filter is synced.
authorzab <zab>
Thu, 23 Jan 2003 19:09:24 +0000 (19:09 +0000)
committerzab <zab>
Thu, 23 Jan 2003 19:09:24 +0000 (19:09 +0000)
  ext* uses ext*_force_commit, reiser is unimplemented
- add /proc/sys/lustre/filter_sync_on_commit tunable, disabled by default.
  when enabled it calls the filter sync after each filter_commitrw for write

lustre/include/linux/lustre_fsfilt.h
lustre/obdclass/fsfilt_ext3.c

index eeae647..341d082 100644 (file)
@@ -56,6 +56,7 @@ struct fsfilt_operations {
         int     (* fs_set_last_rcvd)(struct obd_device *obd, __u64 last_rcvd,
                                      void *handle, fsfilt_cb_t cb_func);
         int     (* fs_statfs)(struct super_block *sb, struct obd_statfs *osfs);
+        int     (* fs_sync)(struct super_block *sb);
 };
 
 extern int fsfilt_register_ops(struct fsfilt_operations *fs_ops);
@@ -146,6 +147,11 @@ static inline int fsfilt_statfs(struct obd_device *obd, struct super_block *fs,
         return obd->obd_fsops->fs_statfs(fs, osfs);
 }
 
+static inline int fsfilt_sync(struct obd_device *obd, struct super_block *fs)
+{
+        return obd->obd_fsops->fs_sync(fs);
+}
+
 #endif /* __KERNEL__ */
 
 #endif
index e979c37..5c52b43 100644 (file)
@@ -271,6 +271,11 @@ static int fsfilt_ext3_statfs(struct super_block *sb, struct statfs *sfs)
         return rc;
 }
 
+static int fsfilt_ext3_sync(struct super_block *sb)
+{
+        return ext3_force_commit(sb);
+}
+
 static struct fsfilt_operations fsfilt_ext3_ops = {
         fs_type:                "ext3",
         fs_owner:               THIS_MODULE,
@@ -283,6 +288,7 @@ static struct fsfilt_operations fsfilt_ext3_ops = {
         fs_journal_data:        fsfilt_ext3_journal_data,
         fs_set_last_rcvd:       fsfilt_ext3_set_last_rcvd,
         fs_statfs:              fsfilt_ext3_statfs,
+        fs_sync:                fsfilt_ext3_sync,
 };
 
 static int __init fsfilt_ext3_init(void)