aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2009-08-31 19:57:03 -0400
committerFelix Blyakher <felixb@sgi.com>2009-09-01 13:45:08 -0400
commitafabc24a73bfee2656724b0a70395f1693eaa62b (patch)
tree0cd8058f3a014a64941934d05db47c88e5a823c3 /fs/xfs
parent2e287a731e0607e0371dc6165b7dd3ebc67fa8e1 (diff)
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>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_ialloc.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c
index 72fa3bfc56eb..8819cdacf702 100644
--- a/fs/xfs/xfs_ialloc.c
+++ b/fs/xfs/xfs_ialloc.c
@@ -110,22 +110,19 @@ xfs_inobt_lookup_le(
110} 110}
111 111
112/* 112/*
113 * Update the record referred to by cur to the value given 113 * Update the record referred to by cur to the value given.
114 * by [ino, fcnt, free].
115 * This either works (return 0) or gets an EFSCORRUPTED error. 114 * This either works (return 0) or gets an EFSCORRUPTED error.
116 */ 115 */
117STATIC int /* error */ 116STATIC int /* error */
118xfs_inobt_update( 117xfs_inobt_update(
119 struct xfs_btree_cur *cur, /* btree cursor */ 118 struct xfs_btree_cur *cur, /* btree cursor */
120 xfs_agino_t ino, /* starting inode of chunk */ 119 xfs_inobt_rec_incore_t *irec) /* btree record */
121 __int32_t fcnt, /* free inode count */
122 xfs_inofree_t free) /* free inode mask */
123{ 120{
124 union xfs_btree_rec rec; 121 union xfs_btree_rec rec;
125 122
126 rec.inobt.ir_startino = cpu_to_be32(ino); 123 rec.inobt.ir_startino = cpu_to_be32(irec->ir_startino);
127 rec.inobt.ir_freecount = cpu_to_be32(fcnt); 124 rec.inobt.ir_freecount = cpu_to_be32(irec->ir_freecount);
128 rec.inobt.ir_free = cpu_to_be64(free); 125 rec.inobt.ir_free = cpu_to_be64(irec->ir_free);
129 return xfs_btree_update(cur, &rec); 126 return xfs_btree_update(cur, &rec);
130} 127}
131 128
@@ -946,8 +943,8 @@ nextag:
946 ino = XFS_AGINO_TO_INO(mp, agno, rec.ir_startino + offset); 943 ino = XFS_AGINO_TO_INO(mp, agno, rec.ir_startino + offset);
947 rec.ir_free &= ~XFS_INOBT_MASK(offset); 944 rec.ir_free &= ~XFS_INOBT_MASK(offset);
948 rec.ir_freecount--; 945 rec.ir_freecount--;
949 if ((error = xfs_inobt_update(cur, rec.ir_startino, rec.ir_freecount, 946 error = xfs_inobt_update(cur, &rec);
950 rec.ir_free))) 947 if (error)
951 goto error0; 948 goto error0;
952 be32_add_cpu(&agi->agi_freecount, -1); 949 be32_add_cpu(&agi->agi_freecount, -1);
953 xfs_ialloc_log_agi(tp, agbp, XFS_AGI_FREECOUNT); 950 xfs_ialloc_log_agi(tp, agbp, XFS_AGI_FREECOUNT);
@@ -1149,12 +1146,14 @@ xfs_difree(
1149 } else { 1146 } else {
1150 *delete = 0; 1147 *delete = 0;
1151 1148
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) {
1153 cmn_err(CE_WARN, 1151 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.",
1155 error, mp->m_fsname); 1153 error, mp->m_fsname);
1156 goto error0; 1154 goto error0;
1157 } 1155 }
1156
1158 /* 1157 /*
1159 * Change the inode free counts and log the ag/sb changes. 1158 * Change the inode free counts and log the ag/sb changes.
1160 */ 1159 */