Skip to content

Commit ec88b41

Browse files
author
Darrick J. Wong
committed
xfs: clean up log item accesses in xfs_qm_dqflush{,_done}
Clean up these functions a little bit before we move on to the real modifications, and make the variable naming consistent for dquot log items. Signed-off-by: "Darrick J. Wong" <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent a40fe30 commit ec88b41

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

fs/xfs/xfs_dquot.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,8 +1142,9 @@ static void
11421142
xfs_qm_dqflush_done(
11431143
struct xfs_log_item *lip)
11441144
{
1145-
struct xfs_dq_logitem *qip = (struct xfs_dq_logitem *)lip;
1146-
struct xfs_dquot *dqp = qip->qli_dquot;
1145+
struct xfs_dq_logitem *qlip =
1146+
container_of(lip, struct xfs_dq_logitem, qli_item);
1147+
struct xfs_dquot *dqp = qlip->qli_dquot;
11471148
struct xfs_ail *ailp = lip->li_ailp;
11481149
xfs_lsn_t tail_lsn;
11491150

@@ -1156,12 +1157,12 @@ xfs_qm_dqflush_done(
11561157
* holding the lock before removing the dquot from the AIL.
11571158
*/
11581159
if (test_bit(XFS_LI_IN_AIL, &lip->li_flags) &&
1159-
((lip->li_lsn == qip->qli_flush_lsn) ||
1160+
(lip->li_lsn == qlip->qli_flush_lsn ||
11601161
test_bit(XFS_LI_FAILED, &lip->li_flags))) {
11611162

11621163
spin_lock(&ailp->ail_lock);
11631164
xfs_clear_li_failed(lip);
1164-
if (lip->li_lsn == qip->qli_flush_lsn) {
1165+
if (lip->li_lsn == qlip->qli_flush_lsn) {
11651166
/* xfs_ail_update_finish() drops the AIL lock */
11661167
tail_lsn = xfs_ail_delete_one(ailp, lip);
11671168
xfs_ail_update_finish(ailp, tail_lsn);
@@ -1319,7 +1320,7 @@ xfs_qm_dqflush(
13191320
dqp->q_flags &= ~XFS_DQFLAG_DIRTY;
13201321

13211322
xfs_trans_ail_copy_lsn(mp->m_ail, &dqp->q_logitem.qli_flush_lsn,
1322-
&dqp->q_logitem.qli_item.li_lsn);
1323+
&lip->li_lsn);
13231324

13241325
/*
13251326
* copy the lsn into the on-disk dquot now while we have the in memory
@@ -1331,7 +1332,7 @@ xfs_qm_dqflush(
13311332
* of a dquot without an up-to-date CRC getting to disk.
13321333
*/
13331334
if (xfs_has_crc(mp)) {
1334-
dqblk->dd_lsn = cpu_to_be64(dqp->q_logitem.qli_item.li_lsn);
1335+
dqblk->dd_lsn = cpu_to_be64(lip->li_lsn);
13351336
xfs_update_cksum((char *)dqblk, sizeof(struct xfs_dqblk),
13361337
XFS_DQUOT_CRC_OFF);
13371338
}
@@ -1341,7 +1342,7 @@ xfs_qm_dqflush(
13411342
* the AIL and release the flush lock once the dquot is synced to disk.
13421343
*/
13431344
bp->b_flags |= _XBF_DQUOTS;
1344-
list_add_tail(&dqp->q_logitem.qli_item.li_bio_list, &bp->b_li_list);
1345+
list_add_tail(&lip->li_bio_list, &bp->b_li_list);
13451346

13461347
/*
13471348
* If the buffer is pinned then push on the log so we won't

0 commit comments

Comments
 (0)