Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 201737
b: refs/heads/master
c: 898621d
h: refs/heads/master
i:
  201735: 557f31f
v: v3
  • Loading branch information
Christoph Hellwig authored and Alex Elder committed Jul 26, 2010
1 parent 2ce7b26 commit c099e4e
Show file tree
Hide file tree
Showing 20 changed files with 104 additions and 248 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4d16e9246fc3b3cf7bc95609eff66929a39daa06
refs/heads/master: 898621d5a72c6799a9a13fce20443b4b6699899c
3 changes: 1 addition & 2 deletions trunk/fs/xfs/linux-2.6/xfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ xfs_file_fsync(
* transaction. So we play it safe and fire off the
* transaction anyway.
*/
xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
xfs_trans_ihold(tp, ip);
xfs_trans_ijoin(tp, ip);
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
xfs_trans_set_sync(tp);
error = _xfs_trans_commit(tp, 0, &log_flushed);
Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/xfs/linux-2.6/xfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1034,8 +1034,7 @@ xfs_ioctl_setattr(
}
}

xfs_trans_ijoin(tp, ip, lock_flags);
xfs_trans_ihold(tp, ip);
xfs_trans_ijoin(tp, ip);

/*
* Change file ownership. Must be the owner or privileged.
Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/xfs/linux-2.6/xfs_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1023,8 +1023,7 @@ xfs_log_inode(
* an inode in another recent transaction. So we play it safe and
* fire off the transaction anyway.
*/
xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
xfs_trans_ihold(tp, ip);
xfs_trans_ijoin(tp, ip);
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
xfs_trans_set_sync(tp);
error = xfs_trans_commit(tp, 0);
Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/xfs/linux-2.6/xfs_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,7 @@ xfs_commit_dummy_trans(

xfs_ilock(ip, XFS_ILOCK_EXCL);

xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
xfs_trans_ihold(tp, ip);
xfs_trans_ijoin(tp, ip);
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
error = xfs_trans_commit(tp, 0);
xfs_iunlock(ip, XFS_ILOCK_EXCL);
Expand Down
9 changes: 1 addition & 8 deletions trunk/fs/xfs/quota/xfs_dquot.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,14 +378,7 @@ xfs_qm_dqalloc(
return (ESRCH);
}

/*
* xfs_trans_commit normally decrements the vnode ref count
* when it unlocks the inode. Since we want to keep the quota
* inode around, we bump the vnode ref count now.
*/
IHOLD(quotip);

xfs_trans_ijoin(tp, quotip, XFS_ILOCK_EXCL);
xfs_trans_ijoin_ref(tp, quotip, XFS_ILOCK_EXCL);
nmaps = 1;
if ((error = xfs_bmapi(tp, quotip,
offset_fsb, XFS_DQUOT_CLUSTER_SIZE_FSB,
Expand Down
75 changes: 25 additions & 50 deletions trunk/fs/xfs/xfs_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,7 @@ xfs_attr_set_int(
return (error);
}

xfs_trans_ijoin(args.trans, dp, XFS_ILOCK_EXCL);
xfs_trans_ihold(args.trans, dp);
xfs_trans_ijoin(args.trans, dp);

/*
* If the attribute list is non-existent or a shortform list,
Expand Down Expand Up @@ -390,10 +389,8 @@ xfs_attr_set_int(
* bmap_finish() may have committed the last trans and started
* a new one. We need the inode to be in all transactions.
*/
if (committed) {
xfs_trans_ijoin(args.trans, dp, XFS_ILOCK_EXCL);
xfs_trans_ihold(args.trans, dp);
}
if (committed)
xfs_trans_ijoin(args.trans, dp);

/*
* Commit the leaf transformation. We'll need another (linked)
Expand Down Expand Up @@ -538,8 +535,7 @@ xfs_attr_remove_int(xfs_inode_t *dp, struct xfs_name *name, int flags)
* No need to make quota reservations here. We expect to release some
* blocks not allocate in the common case.
*/
xfs_trans_ijoin(args.trans, dp, XFS_ILOCK_EXCL);
xfs_trans_ihold(args.trans, dp);
xfs_trans_ijoin(args.trans, dp);

/*
* Decide on what work routines to call based on the inode size.
Expand Down Expand Up @@ -815,8 +811,7 @@ xfs_attr_inactive(xfs_inode_t *dp)
* No need to make quota reservations here. We expect to release some
* blocks, not allocate, in the common case.
*/
xfs_trans_ijoin(trans, dp, XFS_ILOCK_EXCL);
xfs_trans_ihold(trans, dp);
xfs_trans_ijoin(trans, dp);

/*
* Decide on what work routines to call based on the inode size.
Expand Down Expand Up @@ -975,10 +970,8 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
* bmap_finish() may have committed the last trans and started
* a new one. We need the inode to be in all transactions.
*/
if (committed) {
xfs_trans_ijoin(args->trans, dp, XFS_ILOCK_EXCL);
xfs_trans_ihold(args->trans, dp);
}
if (committed)
xfs_trans_ijoin(args->trans, dp);

/*
* Commit the current trans (including the inode) and start
Expand Down Expand Up @@ -1079,10 +1072,8 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
* and started a new one. We need the inode to be
* in all transactions.
*/
if (committed) {
xfs_trans_ijoin(args->trans, dp, XFS_ILOCK_EXCL);
xfs_trans_ihold(args->trans, dp);
}
if (committed)
xfs_trans_ijoin(args->trans, dp);
} else
xfs_da_buf_done(bp);

Expand Down Expand Up @@ -1155,10 +1146,8 @@ xfs_attr_leaf_removename(xfs_da_args_t *args)
* bmap_finish() may have committed the last trans and started
* a new one. We need the inode to be in all transactions.
*/
if (committed) {
xfs_trans_ijoin(args->trans, dp, XFS_ILOCK_EXCL);
xfs_trans_ihold(args->trans, dp);
}
if (committed)
xfs_trans_ijoin(args->trans, dp);
} else
xfs_da_buf_done(bp);
return(0);
Expand Down Expand Up @@ -1311,10 +1300,8 @@ xfs_attr_node_addname(xfs_da_args_t *args)
* and started a new one. We need the inode to be
* in all transactions.
*/
if (committed) {
xfs_trans_ijoin(args->trans, dp, XFS_ILOCK_EXCL);
xfs_trans_ihold(args->trans, dp);
}
if (committed)
xfs_trans_ijoin(args->trans, dp);

/*
* Commit the node conversion and start the next
Expand Down Expand Up @@ -1350,10 +1337,8 @@ xfs_attr_node_addname(xfs_da_args_t *args)
* bmap_finish() may have committed the last trans and started
* a new one. We need the inode to be in all transactions.
*/
if (committed) {
xfs_trans_ijoin(args->trans, dp, XFS_ILOCK_EXCL);
xfs_trans_ihold(args->trans, dp);
}
if (committed)
xfs_trans_ijoin(args->trans, dp);
} else {
/*
* Addition succeeded, update Btree hashvals.
Expand Down Expand Up @@ -1464,10 +1449,8 @@ xfs_attr_node_addname(xfs_da_args_t *args)
* and started a new one. We need the inode to be
* in all transactions.
*/
if (committed) {
xfs_trans_ijoin(args->trans, dp, XFS_ILOCK_EXCL);
xfs_trans_ihold(args->trans, dp);
}
if (committed)
xfs_trans_ijoin(args->trans, dp);
}

/*
Expand Down Expand Up @@ -1598,10 +1581,8 @@ xfs_attr_node_removename(xfs_da_args_t *args)
* bmap_finish() may have committed the last trans and started
* a new one. We need the inode to be in all transactions.
*/
if (committed) {
xfs_trans_ijoin(args->trans, dp, XFS_ILOCK_EXCL);
xfs_trans_ihold(args->trans, dp);
}
if (committed)
xfs_trans_ijoin(args->trans, dp);

/*
* Commit the Btree join operation and start a new trans.
Expand Down Expand Up @@ -1652,10 +1633,8 @@ xfs_attr_node_removename(xfs_da_args_t *args)
* and started a new one. We need the inode to be
* in all transactions.
*/
if (committed) {
xfs_trans_ijoin(args->trans, dp, XFS_ILOCK_EXCL);
xfs_trans_ihold(args->trans, dp);
}
if (committed)
xfs_trans_ijoin(args->trans, dp);
} else
xfs_da_brelse(args->trans, bp);
}
Expand Down Expand Up @@ -2093,10 +2072,8 @@ xfs_attr_rmtval_set(xfs_da_args_t *args)
* bmap_finish() may have committed the last trans and started
* a new one. We need the inode to be in all transactions.
*/
if (committed) {
xfs_trans_ijoin(args->trans, dp, XFS_ILOCK_EXCL);
xfs_trans_ihold(args->trans, dp);
}
if (committed)
xfs_trans_ijoin(args->trans, dp);

ASSERT(nmap == 1);
ASSERT((map.br_startblock != DELAYSTARTBLOCK) &&
Expand Down Expand Up @@ -2249,10 +2226,8 @@ xfs_attr_rmtval_remove(xfs_da_args_t *args)
* bmap_finish() may have committed the last trans and started
* a new one. We need the inode to be in all transactions.
*/
if (committed) {
xfs_trans_ijoin(args->trans, args->dp, XFS_ILOCK_EXCL);
xfs_trans_ihold(args->trans, args->dp);
}
if (committed)
xfs_trans_ijoin(args->trans, args->dp);

/*
* Close out trans and start the next one in the chain.
Expand Down
5 changes: 3 additions & 2 deletions trunk/fs/xfs/xfs_bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3751,9 +3751,10 @@ xfs_bmap_add_attrfork(
ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS;
}
ASSERT(ip->i_d.di_anextents == 0);
IHOLD(ip);
xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);

xfs_trans_ijoin_ref(tp, ip, XFS_ILOCK_EXCL);
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);

switch (ip->i_d.di_format) {
case XFS_DINODE_FMT_DEV:
ip->i_d.di_forkoff = roundup(sizeof(xfs_dev_t), 8) >> 3;
Expand Down
7 changes: 2 additions & 5 deletions trunk/fs/xfs/xfs_dfrag.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,8 @@ xfs_swap_extents(
}


IHOLD(ip);
xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);

IHOLD(tip);
xfs_trans_ijoin(tp, tip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
xfs_trans_ijoin_ref(tp, ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
xfs_trans_ijoin_ref(tp, tip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);

xfs_trans_log_inode(tp, ip, ilf_fields);
xfs_trans_log_inode(tp, tip, tilf_fields);
Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/xfs/xfs_fsops.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,7 @@ xfs_fs_log_dummy(
ip = mp->m_rootip;
xfs_ilock(ip, XFS_ILOCK_EXCL);

xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
xfs_trans_ihold(tp, ip);
xfs_trans_ijoin(tp, ip);
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
xfs_trans_set_sync(tp);
error = xfs_trans_commit(tp, 0);
Expand Down
14 changes: 4 additions & 10 deletions trunk/fs/xfs/xfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,7 @@ xfs_itruncate_finish(
ASSERT((*tp)->t_flags & XFS_TRANS_PERM_LOG_RES);
ASSERT(ip->i_transp == *tp);
ASSERT(ip->i_itemp != NULL);
ASSERT(ip->i_itemp->ili_flags & XFS_ILI_HOLD);
ASSERT(ip->i_itemp->ili_lock_flags == 0);


ntp = *tp;
Expand Down Expand Up @@ -1608,12 +1608,8 @@ xfs_itruncate_finish(
*/
error = xfs_bmap_finish(tp, &free_list, &committed);
ntp = *tp;
if (committed) {
/* link the inode into the next xact in the chain */
xfs_trans_ijoin(ntp, ip,
XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
xfs_trans_ihold(ntp, ip);
}
if (committed)
xfs_trans_ijoin(ntp, ip);

if (error) {
/*
Expand Down Expand Up @@ -1642,9 +1638,7 @@ xfs_itruncate_finish(
error = xfs_trans_commit(*tp, 0);
*tp = ntp;

/* link the inode into the next transaction in the chain */
xfs_trans_ijoin(ntp, ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
xfs_trans_ihold(ntp, ip);
xfs_trans_ijoin(ntp, ip);

if (error)
return error;
Expand Down
42 changes: 4 additions & 38 deletions trunk/fs/xfs/xfs_inode_item.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,19 +628,10 @@ xfs_inode_item_unlock(
{
struct xfs_inode_log_item *iip = INODE_ITEM(lip);
struct xfs_inode *ip = iip->ili_inode;
uint hold;
uint iolocked;
uint lock_flags;
unsigned short lock_flags;

ASSERT(iip != NULL);
ASSERT(iip->ili_inode->i_itemp != NULL);
ASSERT(xfs_isilocked(iip->ili_inode, XFS_ILOCK_EXCL));
ASSERT((!(iip->ili_inode->i_itemp->ili_flags &
XFS_ILI_IOLOCKED_EXCL)) ||
xfs_isilocked(iip->ili_inode, XFS_IOLOCK_EXCL));
ASSERT((!(iip->ili_inode->i_itemp->ili_flags &
XFS_ILI_IOLOCKED_SHARED)) ||
xfs_isilocked(iip->ili_inode, XFS_IOLOCK_SHARED));

/*
* Clear the transaction pointer in the inode.
Expand Down Expand Up @@ -668,35 +659,10 @@ xfs_inode_item_unlock(
iip->ili_aextents_buf = NULL;
}

/*
* Figure out if we should unlock the inode or not.
*/
hold = iip->ili_flags & XFS_ILI_HOLD;

/*
* Before clearing out the flags, remember whether we
* are holding the inode's IO lock.
*/
iolocked = iip->ili_flags & XFS_ILI_IOLOCKED_ANY;

/*
* Clear out the fields of the inode log item particular
* to the current transaction.
*/
iip->ili_flags = 0;

/*
* Unlock the inode if XFS_ILI_HOLD was not set.
*/
if (!hold) {
lock_flags = XFS_ILOCK_EXCL;
if (iolocked & XFS_ILI_IOLOCKED_EXCL) {
lock_flags |= XFS_IOLOCK_EXCL;
} else if (iolocked & XFS_ILI_IOLOCKED_SHARED) {
lock_flags |= XFS_IOLOCK_SHARED;
}
lock_flags = iip->ili_lock_flags;
iip->ili_lock_flags = 0;
if (lock_flags)
xfs_iput(iip->ili_inode, lock_flags);
}
}

/*
Expand Down
8 changes: 1 addition & 7 deletions trunk/fs/xfs/xfs_inode_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,6 @@ typedef struct xfs_inode_log_format_64 {
XFS_ILOG_ADATA | XFS_ILOG_AEXT | \
XFS_ILOG_ABROOT)

#define XFS_ILI_HOLD 0x1
#define XFS_ILI_IOLOCKED_EXCL 0x2
#define XFS_ILI_IOLOCKED_SHARED 0x4

#define XFS_ILI_IOLOCKED_ANY (XFS_ILI_IOLOCKED_EXCL | XFS_ILI_IOLOCKED_SHARED)

static inline int xfs_ilog_fbroot(int w)
{
return (w == XFS_DATA_FORK ? XFS_ILOG_DBROOT : XFS_ILOG_ABROOT);
Expand Down Expand Up @@ -137,7 +131,7 @@ typedef struct xfs_inode_log_item {
struct xfs_inode *ili_inode; /* inode ptr */
xfs_lsn_t ili_flush_lsn; /* lsn at last flush */
xfs_lsn_t ili_last_lsn; /* lsn at last transaction */
unsigned short ili_flags; /* misc flags */
unsigned short ili_lock_flags; /* lock flags */
unsigned short ili_logged; /* flushed logged data */
unsigned int ili_last_fields; /* fields when flushed */
struct xfs_bmbt_rec *ili_extents_buf; /* array of logged
Expand Down
Loading

0 comments on commit c099e4e

Please sign in to comment.