Skip to content

Commit afabc24

Browse files
Christoph HellwigFelix Blyakher
authored andcommitted
xfs: improve xfs_inobt_update prototype
Both callers of xfs_inobt_update have the record in form of a xfs_inobt_rec_incore_t, so just pass a pointer to it instead of the individual variables. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Alex Elder <aelder@sgi.com> Signed-off-by: Felix Blyakher <felixb@sgi.com>
1 parent 2e287a7 commit afabc24

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

fs/xfs/xfs_ialloc.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,22 +110,19 @@ xfs_inobt_lookup_le(
110110
}
111111

112112
/*
113-
* Update the record referred to by cur to the value given
114-
* by [ino, fcnt, free].
113+
* Update the record referred to by cur to the value given.
115114
* This either works (return 0) or gets an EFSCORRUPTED error.
116115
*/
117116
STATIC int /* error */
118117
xfs_inobt_update(
119118
struct xfs_btree_cur *cur, /* btree cursor */
120-
xfs_agino_t ino, /* starting inode of chunk */
121-
__int32_t fcnt, /* free inode count */
122-
xfs_inofree_t free) /* free inode mask */
119+
xfs_inobt_rec_incore_t *irec) /* btree record */
123120
{
124121
union xfs_btree_rec rec;
125122

126-
rec.inobt.ir_startino = cpu_to_be32(ino);
127-
rec.inobt.ir_freecount = cpu_to_be32(fcnt);
128-
rec.inobt.ir_free = cpu_to_be64(free);
123+
rec.inobt.ir_startino = cpu_to_be32(irec->ir_startino);
124+
rec.inobt.ir_freecount = cpu_to_be32(irec->ir_freecount);
125+
rec.inobt.ir_free = cpu_to_be64(irec->ir_free);
129126
return xfs_btree_update(cur, &rec);
130127
}
131128

@@ -946,8 +943,8 @@ xfs_dialloc(
946943
ino = XFS_AGINO_TO_INO(mp, agno, rec.ir_startino + offset);
947944
rec.ir_free &= ~XFS_INOBT_MASK(offset);
948945
rec.ir_freecount--;
949-
if ((error = xfs_inobt_update(cur, rec.ir_startino, rec.ir_freecount,
950-
rec.ir_free)))
946+
error = xfs_inobt_update(cur, &rec);
947+
if (error)
951948
goto error0;
952949
be32_add_cpu(&agi->agi_freecount, -1);
953950
xfs_ialloc_log_agi(tp, agbp, XFS_AGI_FREECOUNT);
@@ -1149,12 +1146,14 @@ xfs_difree(
11491146
} else {
11501147
*delete = 0;
11511148

1152-
if ((error = xfs_inobt_update(cur, rec.ir_startino, rec.ir_freecount, rec.ir_free))) {
1149+
error = xfs_inobt_update(cur, &rec);
1150+
if (error) {
11531151
cmn_err(CE_WARN,
1154-
"xfs_difree: xfs_inobt_update() returned an error %d on %s. Returning error.",
1152+
"xfs_difree: xfs_inobt_update returned an error %d on %s.",
11551153
error, mp->m_fsname);
11561154
goto error0;
11571155
}
1156+
11581157
/*
11591158
* Change the inode free counts and log the ag/sb changes.
11601159
*/

0 commit comments

Comments
 (0)