diff options
author | Christoph Hellwig <hch@infradead.org> | 2010-06-23 21:36:58 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2010-07-26 14:16:36 -0400 |
commit | 898621d5a72c6799a9a13fce20443b4b6699899c (patch) | |
tree | 6cd994bd8d24f4f4f6ac5b5b57e0b99ee02d4ba6 /fs/xfs/linux-2.6 | |
parent | 4d16e9246fc3b3cf7bc95609eff66929a39daa06 (diff) |
xfs: simplify inode to transaction joining
Currently we need to either call IHOLD or xfs_trans_ihold on an inode when
joining it to a transaction via xfs_trans_ijoin.
This patches instead makes xfs_trans_ijoin usable on it's own by doing
an implicity xfs_trans_ihold, which also allows us to drop the third
argument. For the case where we want to hold a reference on the inode
a xfs_trans_ijoin_ref wrapper is added which does the IHOLD and marks
the inode for needing an xfs_iput. In addition to the cleaner interface
to the caller this also simplifies the implementation.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_file.c | 3 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_ioctl.c | 3 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 3 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_sync.c | 3 |
4 files changed, 4 insertions, 8 deletions
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c index 8d26d93648b4..9a9b446a58a7 100644 --- a/fs/xfs/linux-2.6/xfs_file.c +++ b/fs/xfs/linux-2.6/xfs_file.c | |||
@@ -158,8 +158,7 @@ xfs_file_fsync( | |||
158 | * transaction. So we play it safe and fire off the | 158 | * transaction. So we play it safe and fire off the |
159 | * transaction anyway. | 159 | * transaction anyway. |
160 | */ | 160 | */ |
161 | xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); | 161 | xfs_trans_ijoin(tp, ip); |
162 | xfs_trans_ihold(tp, ip); | ||
163 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); | 162 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); |
164 | xfs_trans_set_sync(tp); | 163 | xfs_trans_set_sync(tp); |
165 | error = _xfs_trans_commit(tp, 0, &log_flushed); | 164 | error = _xfs_trans_commit(tp, 0, &log_flushed); |
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c index 8aa54f0eec15..a12dddad126e 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl.c +++ b/fs/xfs/linux-2.6/xfs_ioctl.c | |||
@@ -1034,8 +1034,7 @@ xfs_ioctl_setattr( | |||
1034 | } | 1034 | } |
1035 | } | 1035 | } |
1036 | 1036 | ||
1037 | xfs_trans_ijoin(tp, ip, lock_flags); | 1037 | xfs_trans_ijoin(tp, ip); |
1038 | xfs_trans_ihold(tp, ip); | ||
1039 | 1038 | ||
1040 | /* | 1039 | /* |
1041 | * Change file ownership. Must be the owner or privileged. | 1040 | * Change file ownership. Must be the owner or privileged. |
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 4b90e4b531b7..b8ad17e730b6 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -1023,8 +1023,7 @@ xfs_log_inode( | |||
1023 | * an inode in another recent transaction. So we play it safe and | 1023 | * an inode in another recent transaction. So we play it safe and |
1024 | * fire off the transaction anyway. | 1024 | * fire off the transaction anyway. |
1025 | */ | 1025 | */ |
1026 | xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); | 1026 | xfs_trans_ijoin(tp, ip); |
1027 | xfs_trans_ihold(tp, ip); | ||
1028 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); | 1027 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); |
1029 | xfs_trans_set_sync(tp); | 1028 | xfs_trans_set_sync(tp); |
1030 | error = xfs_trans_commit(tp, 0); | 1029 | error = xfs_trans_commit(tp, 0); |
diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c index 850b4198bf60..0283b88bc16c 100644 --- a/fs/xfs/linux-2.6/xfs_sync.c +++ b/fs/xfs/linux-2.6/xfs_sync.c | |||
@@ -362,8 +362,7 @@ xfs_commit_dummy_trans( | |||
362 | 362 | ||
363 | xfs_ilock(ip, XFS_ILOCK_EXCL); | 363 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
364 | 364 | ||
365 | xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); | 365 | xfs_trans_ijoin(tp, ip); |
366 | xfs_trans_ihold(tp, ip); | ||
367 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); | 366 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); |
368 | error = xfs_trans_commit(tp, 0); | 367 | error = xfs_trans_commit(tp, 0); |
369 | xfs_iunlock(ip, XFS_ILOCK_EXCL); | 368 | xfs_iunlock(ip, XFS_ILOCK_EXCL); |