diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-09-19 11:00:54 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2011-10-11 22:15:08 -0400 |
commit | ddc3415aba1cb2f86d1fcad720cea834ee178f54 (patch) | |
tree | 7a31a932ce0b7080557be062ccc7c3c0e181b140 /fs/xfs/xfs_attr.c | |
parent | 23bb0be1a237c8732ce1a43140e5cb103a676b92 (diff) |
xfs: simplify xfs_trans_ijoin* again
There is no reason to keep a reference to the inode even if we unlock
it during transaction commit because we never drop a reference between
the ijoin and commit. Also use this fact to merge xfs_trans_ijoin_ref
back into xfs_trans_ijoin - the third argument decides if an unlock
is needed now.
I'm actually starting to wonder if allowing inodes to be unlocked
at transaction commit really is worth the effort. The only real
benefit is that they can be unlocked earlier when commiting a
synchronous transactions, but that could be solved by doing the
log force manually after the unlock, too.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_attr.c')
-rw-r--r-- | fs/xfs/xfs_attr.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c index 5484766938f9..981a0624f382 100644 --- a/fs/xfs/xfs_attr.c +++ b/fs/xfs/xfs_attr.c | |||
@@ -319,7 +319,7 @@ xfs_attr_set_int( | |||
319 | return (error); | 319 | return (error); |
320 | } | 320 | } |
321 | 321 | ||
322 | xfs_trans_ijoin(args.trans, dp); | 322 | xfs_trans_ijoin(args.trans, dp, 0); |
323 | 323 | ||
324 | /* | 324 | /* |
325 | * If the attribute list is non-existent or a shortform list, | 325 | * If the attribute list is non-existent or a shortform list, |
@@ -389,7 +389,7 @@ xfs_attr_set_int( | |||
389 | * a new one. We need the inode to be in all transactions. | 389 | * a new one. We need the inode to be in all transactions. |
390 | */ | 390 | */ |
391 | if (committed) | 391 | if (committed) |
392 | xfs_trans_ijoin(args.trans, dp); | 392 | xfs_trans_ijoin(args.trans, dp, 0); |
393 | 393 | ||
394 | /* | 394 | /* |
395 | * Commit the leaf transformation. We'll need another (linked) | 395 | * Commit the leaf transformation. We'll need another (linked) |
@@ -537,7 +537,7 @@ xfs_attr_remove_int(xfs_inode_t *dp, struct xfs_name *name, int flags) | |||
537 | * No need to make quota reservations here. We expect to release some | 537 | * No need to make quota reservations here. We expect to release some |
538 | * blocks not allocate in the common case. | 538 | * blocks not allocate in the common case. |
539 | */ | 539 | */ |
540 | xfs_trans_ijoin(args.trans, dp); | 540 | xfs_trans_ijoin(args.trans, dp, 0); |
541 | 541 | ||
542 | /* | 542 | /* |
543 | * Decide on what work routines to call based on the inode size. | 543 | * Decide on what work routines to call based on the inode size. |
@@ -809,7 +809,7 @@ xfs_attr_inactive(xfs_inode_t *dp) | |||
809 | * No need to make quota reservations here. We expect to release some | 809 | * No need to make quota reservations here. We expect to release some |
810 | * blocks, not allocate, in the common case. | 810 | * blocks, not allocate, in the common case. |
811 | */ | 811 | */ |
812 | xfs_trans_ijoin(trans, dp); | 812 | xfs_trans_ijoin(trans, dp, 0); |
813 | 813 | ||
814 | /* | 814 | /* |
815 | * Decide on what work routines to call based on the inode size. | 815 | * Decide on what work routines to call based on the inode size. |
@@ -961,7 +961,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args) | |||
961 | * a new one. We need the inode to be in all transactions. | 961 | * a new one. We need the inode to be in all transactions. |
962 | */ | 962 | */ |
963 | if (committed) | 963 | if (committed) |
964 | xfs_trans_ijoin(args->trans, dp); | 964 | xfs_trans_ijoin(args->trans, dp, 0); |
965 | 965 | ||
966 | /* | 966 | /* |
967 | * Commit the current trans (including the inode) and start | 967 | * Commit the current trans (including the inode) and start |
@@ -1063,7 +1063,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args) | |||
1063 | * in all transactions. | 1063 | * in all transactions. |
1064 | */ | 1064 | */ |
1065 | if (committed) | 1065 | if (committed) |
1066 | xfs_trans_ijoin(args->trans, dp); | 1066 | xfs_trans_ijoin(args->trans, dp, 0); |
1067 | } else | 1067 | } else |
1068 | xfs_da_buf_done(bp); | 1068 | xfs_da_buf_done(bp); |
1069 | 1069 | ||
@@ -1137,7 +1137,7 @@ xfs_attr_leaf_removename(xfs_da_args_t *args) | |||
1137 | * a new one. We need the inode to be in all transactions. | 1137 | * a new one. We need the inode to be in all transactions. |
1138 | */ | 1138 | */ |
1139 | if (committed) | 1139 | if (committed) |
1140 | xfs_trans_ijoin(args->trans, dp); | 1140 | xfs_trans_ijoin(args->trans, dp, 0); |
1141 | } else | 1141 | } else |
1142 | xfs_da_buf_done(bp); | 1142 | xfs_da_buf_done(bp); |
1143 | return(0); | 1143 | return(0); |
@@ -1291,7 +1291,7 @@ restart: | |||
1291 | * in all transactions. | 1291 | * in all transactions. |
1292 | */ | 1292 | */ |
1293 | if (committed) | 1293 | if (committed) |
1294 | xfs_trans_ijoin(args->trans, dp); | 1294 | xfs_trans_ijoin(args->trans, dp, 0); |
1295 | 1295 | ||
1296 | /* | 1296 | /* |
1297 | * Commit the node conversion and start the next | 1297 | * Commit the node conversion and start the next |
@@ -1328,7 +1328,7 @@ restart: | |||
1328 | * a new one. We need the inode to be in all transactions. | 1328 | * a new one. We need the inode to be in all transactions. |
1329 | */ | 1329 | */ |
1330 | if (committed) | 1330 | if (committed) |
1331 | xfs_trans_ijoin(args->trans, dp); | 1331 | xfs_trans_ijoin(args->trans, dp, 0); |
1332 | } else { | 1332 | } else { |
1333 | /* | 1333 | /* |
1334 | * Addition succeeded, update Btree hashvals. | 1334 | * Addition succeeded, update Btree hashvals. |
@@ -1440,7 +1440,7 @@ restart: | |||
1440 | * in all transactions. | 1440 | * in all transactions. |
1441 | */ | 1441 | */ |
1442 | if (committed) | 1442 | if (committed) |
1443 | xfs_trans_ijoin(args->trans, dp); | 1443 | xfs_trans_ijoin(args->trans, dp, 0); |
1444 | } | 1444 | } |
1445 | 1445 | ||
1446 | /* | 1446 | /* |
@@ -1572,7 +1572,7 @@ xfs_attr_node_removename(xfs_da_args_t *args) | |||
1572 | * a new one. We need the inode to be in all transactions. | 1572 | * a new one. We need the inode to be in all transactions. |
1573 | */ | 1573 | */ |
1574 | if (committed) | 1574 | if (committed) |
1575 | xfs_trans_ijoin(args->trans, dp); | 1575 | xfs_trans_ijoin(args->trans, dp, 0); |
1576 | 1576 | ||
1577 | /* | 1577 | /* |
1578 | * Commit the Btree join operation and start a new trans. | 1578 | * Commit the Btree join operation and start a new trans. |
@@ -1623,7 +1623,7 @@ xfs_attr_node_removename(xfs_da_args_t *args) | |||
1623 | * in all transactions. | 1623 | * in all transactions. |
1624 | */ | 1624 | */ |
1625 | if (committed) | 1625 | if (committed) |
1626 | xfs_trans_ijoin(args->trans, dp); | 1626 | xfs_trans_ijoin(args->trans, dp, 0); |
1627 | } else | 1627 | } else |
1628 | xfs_da_brelse(args->trans, bp); | 1628 | xfs_da_brelse(args->trans, bp); |
1629 | } | 1629 | } |
@@ -2060,7 +2060,7 @@ xfs_attr_rmtval_set(xfs_da_args_t *args) | |||
2060 | * a new one. We need the inode to be in all transactions. | 2060 | * a new one. We need the inode to be in all transactions. |
2061 | */ | 2061 | */ |
2062 | if (committed) | 2062 | if (committed) |
2063 | xfs_trans_ijoin(args->trans, dp); | 2063 | xfs_trans_ijoin(args->trans, dp, 0); |
2064 | 2064 | ||
2065 | ASSERT(nmap == 1); | 2065 | ASSERT(nmap == 1); |
2066 | ASSERT((map.br_startblock != DELAYSTARTBLOCK) && | 2066 | ASSERT((map.br_startblock != DELAYSTARTBLOCK) && |
@@ -2207,7 +2207,7 @@ xfs_attr_rmtval_remove(xfs_da_args_t *args) | |||
2207 | * a new one. We need the inode to be in all transactions. | 2207 | * a new one. We need the inode to be in all transactions. |
2208 | */ | 2208 | */ |
2209 | if (committed) | 2209 | if (committed) |
2210 | xfs_trans_ijoin(args->trans, args->dp); | 2210 | xfs_trans_ijoin(args->trans, args->dp, 0); |
2211 | 2211 | ||
2212 | /* | 2212 | /* |
2213 | * Close out trans and start the next one in the chain. | 2213 | * Close out trans and start the next one in the chain. |