inode->i_generation, inode);
ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_FSYNC, 1);
+#ifdef HAVE_FILE_FSYNC_4ARGS
+ rc = filemap_write_and_wait_range(inode->i_mapping, start, end);
+ mutex_lock(&inode->i_mutex);
+#else
/* fsync's caller has already called _fdata{sync,write}, we want
* that IO to finish before calling the osc and mdc sync methods */
rc = filemap_fdatawait(inode->i_mapping);
+#endif
/* catch async errors that were recorded back when async writeback
* failed for pages in this mapping. */
}
ccc_inode_lsm_put(inode, lsm);
+#ifdef HAVE_FILE_FSYNC_4ARGS
+ mutex_unlock(&inode->i_mutex);
+#endif
RETURN(rc);
}
}
flock.l_flock.pid = file_lock->fl_pid;
- /* Somewhat ugly workaround for svc lockd.
- * lockd installs custom fl_lmops->fl_compare_owner that checks
- * for the fl_owner to be the same (which it always is on local node
- * I guess between lockd processes) and then compares pid.
- * As such we assign pid to the owner field to make it all work,
- * conflict with normal locks is unlikely since pid space and
- * pointer space for current->files are not intersecting */
- if (file_lock->fl_lmops && file_lock->fl_lmops->fl_compare_owner)
- flock.l_flock.owner = (unsigned long)file_lock->fl_pid;
+ /* Somewhat ugly workaround for svc lockd.
+ * lockd installs custom fl_lmops->lm_compare_owner that checks
+ * for the fl_owner to be the same (which it always is on local node
+ * I guess between lockd processes) and then compares pid.
+ * As such we assign pid to the owner field to make it all work,
+ * conflict with normal locks is unlikely since pid space and
+ * pointer space for current->files are not intersecting */
+ if (file_lock->fl_lmops && file_lock->fl_lmops->lm_compare_owner)
+ flock.l_flock.owner = (unsigned long)file_lock->fl_pid;
switch (file_lock->fl_type) {
case F_RDLCK:
stat->nlink = inode->i_nlink;
stat->uid = inode->i_uid;
stat->gid = inode->i_gid;
- stat->rdev = kdev_t_to_nr(inode->i_rdev);
+ stat->rdev = inode->i_rdev;
stat->atime = inode->i_atime;
stat->mtime = inode->i_mtime;
stat->ctime = inode->i_ctime;