Whamcloud - gitweb
- b2188: filter fixes: sync transaction, commit earlier
authoralex <alex>
Tue, 28 Oct 2003 13:19:11 +0000 (13:19 +0000)
committeralex <alex>
Tue, 28 Oct 2003 13:19:11 +0000 (13:19 +0000)
lustre/include/linux/lustre_fsfilt.h

index f3e499a..4c27fb5 100644 (file)
@@ -46,6 +46,8 @@ struct fsfilt_operations {
         void   *(* fs_brw_start)(int objcount, struct fsfilt_objinfo *fso,
                                  int niocount, void *desc_private);
         int     (* fs_commit)(struct inode *inode, void *handle,int force_sync);
+        int     (* fs_commit_async)(struct inode *inode, void **handle);
+        int     (* fs_commit_wait)(struct inode *inode, void *handle);
         int     (* fs_setattr)(struct dentry *dentry, void *handle,
                                struct iattr *iattr, int do_trunc);
         int     (* fs_iocontrol)(struct inode *inode, struct file *file,
@@ -144,6 +146,29 @@ static inline int fsfilt_commit(struct obd_device *obd, struct inode *inode,
         return rc;
 }
 
+static inline int fsfilt_commit_async(struct obd_device *obd,
+                                         struct inode *inode,
+                                         void **handle)
+{
+        unsigned long now = jiffies;
+        int rc = obd->obd_fsops->fs_commit_async(inode, handle);
+        CDEBUG(D_HA, "committing handle %p (async)\n", *handle);
+        if (time_after(jiffies, now + 15 * HZ))
+                CERROR("long journal start time %lus\n", (jiffies - now) / HZ);
+        return rc;
+}
+
+static inline int fsfilt_commit_wait(struct obd_device *obd, struct inode *inode,
+                                        void *handle)
+{
+        unsigned long now = jiffies;
+        int rc = obd->obd_fsops->fs_commit_wait(inode, handle);
+        CDEBUG(D_HA, "waiting for completion %p\n", handle);
+        if (time_after(jiffies, now + 15 * HZ))
+                CERROR("long journal start time %lus\n", (jiffies - now) / HZ);
+        return rc;
+}
+
 static inline int fsfilt_setattr(struct obd_device *obd, struct dentry *dentry,
                                  void *handle, struct iattr *iattr,int do_trunc)
 {