summaryrefslogtreecommitdiffstats
path: root/fs/xfs/quota/xfs_qm.c
diff options
context:
space:
mode:
authorLinus Torvalds2006-03-24 00:28:51 +0100
committerLinus Torvalds2006-03-24 00:28:51 +0100
commitdebf798b1ed82053689d900670eb27fb2f1b4bd3 (patch)
tree00684a077494864a990e3be82ad2796367f825f9 /fs/xfs/quota/xfs_qm.c
parent[PATCH] reduce size of bio mempools (diff)
parentMerge HEAD from ../linux-2.6 (diff)
downloadkernel-qcow2-linux-debf798b1ed82053689d900670eb27fb2f1b4bd3.tar.gz
kernel-qcow2-linux-debf798b1ed82053689d900670eb27fb2f1b4bd3.tar.xz
kernel-qcow2-linux-debf798b1ed82053689d900670eb27fb2f1b4bd3.zip
Merge git://oss.sgi.com:8090/oss/git/xfs-2.6
* git://oss.sgi.com:8090/oss/git/xfs-2.6: (71 commits) [XFS] Sync up one/two other minor changes missed in previous merges. [XFS] Reenable the noikeep (delete inode cluster space) option by default. [XFS] Check that a page has dirty buffers before finding it acceptable for [XFS] Fixup naming inconsistencies found by Pekka Enberg and one from Jan [XFS] Explain the race closed by the addition of vn_iowait() to the start [XFS] Fixing the error caused by the conflict between DIO Write's [XFS] Fixing KDB's xrwtrc command, also added the current process id into [XFS] Fix compiler warning from xfs_file_compat_invis_ioctl prototype. [XFS] remove bogus INT_GET for u8 variables in xfs_dir_leaf.c [XFS] endianess annotations for xfs_da_node_hdr_t [XFS] endianess annotations for xfs_da_node_entry_t [XFS] store xfs_attr_inactive_list_t in native endian [XFS] store xfs_attr_sf_sort in native endian [XFS] endianess annotations for xfs_attr_shortform_t [XFS] endianess annotations for xfs_attr_leaf_name_remote_t [XFS] endianess annotations for xfs_attr_leaf_name_local_t [XFS] endianess annotations for xfs_attr_leaf_entry_t [XFS] endianess annotations for xfs_attr_leaf_hdr_t [XFS] remove bogus INT_GET on u8 variables in xfs_dir2_block.c [XFS] endianess annotations for xfs_da_blkinfo_t ...
Diffstat (limited to 'fs/xfs/quota/xfs_qm.c')
-rw-r--r--fs/xfs/quota/xfs_qm.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c
index 7c0e39dc6189..1fb757ef3f41 100644
--- a/fs/xfs/quota/xfs_qm.c
+++ b/fs/xfs/quota/xfs_qm.c
@@ -1704,9 +1704,9 @@ xfs_qm_get_rtblks(
xfs_qcnt_t *O_rtblks)
{
xfs_filblks_t rtblks; /* total rt blks */
+ xfs_extnum_t idx; /* extent record index */
xfs_ifork_t *ifp; /* inode fork pointer */
xfs_extnum_t nextents; /* number of extent entries */
- xfs_bmbt_rec_t *base; /* base of extent array */
xfs_bmbt_rec_t *ep; /* pointer to an extent entry */
int error;
@@ -1717,10 +1717,11 @@ xfs_qm_get_rtblks(
return error;
}
rtblks = 0;
- nextents = ifp->if_bytes / sizeof(xfs_bmbt_rec_t);
- base = &ifp->if_u1.if_extents[0];
- for (ep = base; ep < &base[nextents]; ep++)
+ nextents = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t);
+ for (idx = 0; idx < nextents; idx++) {
+ ep = xfs_iext_get_ext(ifp, idx);
rtblks += xfs_bmbt_get_blockcount(ep);
+ }
*O_rtblks = (xfs_qcnt_t)rtblks;
return 0;
}
@@ -2788,9 +2789,7 @@ xfs_qm_freelist_destroy(xfs_frlist_t *ql)
xfs_qm_dqdestroy(dqp);
dqp = nextdqp;
}
- /*
- * Don't bother about unlocking.
- */
+ mutex_unlock(&ql->qh_lock);
mutex_destroy(&ql->qh_lock);
ASSERT(ql->qh_nelems == 0);