From: alex Date: Tue, 28 Oct 2003 13:19:11 +0000 (+0000) Subject: - b2188: filter fixes: sync transaction, commit earlier X-Git-Tag: v1_7_100~1^368~43 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=333512ca0cf567bb5fbc83141f47d141e9a9bb4d;p=fs%2Flustre-release.git - b2188: filter fixes: sync transaction, commit earlier --- diff --git a/lustre/include/linux/lustre_fsfilt.h b/lustre/include/linux/lustre_fsfilt.h index f3e499a..4c27fb5 100644 --- a/lustre/include/linux/lustre_fsfilt.h +++ b/lustre/include/linux/lustre_fsfilt.h @@ -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) {