diff options
Diffstat (limited to 'fs/xfs/xfs_super.c')
-rw-r--r-- | fs/xfs/xfs_super.c | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 3eca58f51ae..8a899496fd5 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c | |||
@@ -869,27 +869,6 @@ xfs_fs_dirty_inode( | |||
869 | } | 869 | } |
870 | 870 | ||
871 | STATIC int | 871 | STATIC int |
872 | xfs_log_inode( | ||
873 | struct xfs_inode *ip) | ||
874 | { | ||
875 | struct xfs_mount *mp = ip->i_mount; | ||
876 | struct xfs_trans *tp; | ||
877 | int error; | ||
878 | |||
879 | tp = xfs_trans_alloc(mp, XFS_TRANS_FSYNC_TS); | ||
880 | error = xfs_trans_reserve(tp, 0, XFS_FSYNC_TS_LOG_RES(mp), 0, 0, 0); | ||
881 | if (error) { | ||
882 | xfs_trans_cancel(tp, 0); | ||
883 | return error; | ||
884 | } | ||
885 | |||
886 | xfs_ilock(ip, XFS_ILOCK_EXCL); | ||
887 | xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); | ||
888 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); | ||
889 | return xfs_trans_commit(tp, 0); | ||
890 | } | ||
891 | |||
892 | STATIC int | ||
893 | xfs_fs_write_inode( | 872 | xfs_fs_write_inode( |
894 | struct inode *inode, | 873 | struct inode *inode, |
895 | struct writeback_control *wbc) | 874 | struct writeback_control *wbc) |
@@ -902,10 +881,8 @@ xfs_fs_write_inode( | |||
902 | 881 | ||
903 | if (XFS_FORCED_SHUTDOWN(mp)) | 882 | if (XFS_FORCED_SHUTDOWN(mp)) |
904 | return -XFS_ERROR(EIO); | 883 | return -XFS_ERROR(EIO); |
905 | if (!ip->i_update_core) | ||
906 | return 0; | ||
907 | 884 | ||
908 | if (wbc->sync_mode == WB_SYNC_ALL) { | 885 | if (wbc->sync_mode == WB_SYNC_ALL || wbc->for_kupdate) { |
909 | /* | 886 | /* |
910 | * Make sure the inode has made it it into the log. Instead | 887 | * Make sure the inode has made it it into the log. Instead |
911 | * of forcing it all the way to stable storage using a | 888 | * of forcing it all the way to stable storage using a |
@@ -913,11 +890,14 @@ xfs_fs_write_inode( | |||
913 | * ->sync_fs call do that for thus, which reduces the number | 890 | * ->sync_fs call do that for thus, which reduces the number |
914 | * of synchronous log forces dramatically. | 891 | * of synchronous log forces dramatically. |
915 | */ | 892 | */ |
916 | error = xfs_log_inode(ip); | 893 | error = xfs_log_dirty_inode(ip, NULL, 0); |
917 | if (error) | 894 | if (error) |
918 | goto out; | 895 | goto out; |
919 | return 0; | 896 | return 0; |
920 | } else { | 897 | } else { |
898 | if (!ip->i_update_core) | ||
899 | return 0; | ||
900 | |||
921 | /* | 901 | /* |
922 | * We make this non-blocking if the inode is contended, return | 902 | * We make this non-blocking if the inode is contended, return |
923 | * EAGAIN to indicate to the caller that they did not succeed. | 903 | * EAGAIN to indicate to the caller that they did not succeed. |