])
])
+# LC_FLUSH_OWNER_ID
+# starting from 2.6.18 the file_operations .flush
+# method has a new "fl_owner_t id" parameter
+#
+AC_DEFUN([LC_FLUSH_OWNER_ID],
+[AC_MSG_CHECKING([if file_operations .flush has an fl_owner_t id])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+],[
+ struct file_operations *fops = NULL;
+ fl_owner_t id;
+ int i;
+
+ i = fops->flush(NULL, id);
+],[
+ AC_DEFINE(HAVE_FLUSH_OWNER_ID, 1,
+ [file_operations .flush method has an fl_owner_t id])
+ AC_MSG_RESULT([yes])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
#
# LC_STATFS_DENTRY_PARAM
# starting from 2.6.18 linux kernel uses dentry instead of
LC_UMOUNTBEGIN_HAS_VFSMOUNT
LC_SEQ_LOCK
LC_EXPORT_FILEMAP_FDATAWRITE_RANGE
+ LC_FLUSH_OWNER_ID
if test x$enable_server = xyes ; then
LC_EXPORT_INVALIDATE_MAPPING_PAGES
fi
RETURN(retval);
}
+#ifdef HAVE_FLUSH_OWNER_ID
+int ll_flush(struct file *file, fl_owner_t id)
+#else
+int ll_flush(struct file *file)
+#endif
+{
+ struct inode *inode = file->f_dentry->d_inode;
+ struct ll_inode_info *lli = ll_i2info(inode);
+ struct lov_stripe_md *lsm = lli->lli_smd;
+ int rc, err;
+
+ /* catch async errors that were recorded back when async writeback
+ * failed for pages in this mapping. */
+ rc = lli->lli_async_rc;
+ lli->lli_async_rc = 0;
+ if (lsm) {
+ err = lov_test_and_clear_async_rc(lsm);
+ if (rc == 0)
+ rc = err;
+ }
+
+ return rc ? -EIO : 0;
+}
+
int ll_fsync(struct file *file, struct dentry *dentry, int data)
{
struct inode *inode = dentry->d_inode;
.splice_read = ll_file_splice_read,
#endif
.fsync = ll_fsync,
+ .flush = ll_flush
};
struct file_operations ll_file_operations_flock = {
.splice_read = ll_file_splice_read,
#endif
.fsync = ll_fsync,
+ .flush = ll_flush,
#ifdef HAVE_F_OP_FLOCK
.flock = ll_file_flock,
#endif
.splice_read = ll_file_splice_read,
#endif
.fsync = ll_fsync,
+ .flush = ll_flush,
#ifdef HAVE_F_OP_FLOCK
.flock = ll_file_noflock,
#endif