From 44c27209bc60b34a010170a431113c730e885ab5 Mon Sep 17 00:00:00 2001 From: Vlad Apostolov Date: Thu, 28 Sep 2006 11:06:15 +1000 Subject: [PATCH] --- yaml --- r: 37167 b: refs/heads/master c: 6f1f21684078884b62cfff2ea80a1a6c07f79824 h: refs/heads/master i: 37165: 9a8e60bed1cb94d56de8c8d810dd8ec29a573f2c 37163: 08269e39a9a46f8fe38b7fe17541590165236a60 37159: 47972181c1b28d5809f45545eb039cdf34ab1599 37151: 3f6e74b4320b464602c1b6fd0e2e7a3d65d1876e v: v3 --- [refs] | 2 +- trunk/fs/xfs/xfs_itable.c | 24 ++++++++++++++---------- trunk/fs/xfs/xfs_itable.h | 5 +++++ 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index c5e64f01e92a..c4d7f7d17276 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6216ff18839bf302805f67c93e8bc344387c513b +refs/heads/master: 6f1f21684078884b62cfff2ea80a1a6c07f79824 diff --git a/trunk/fs/xfs/xfs_itable.c b/trunk/fs/xfs/xfs_itable.c index 136c6b06f1c9..80e5b96f5027 100644 --- a/trunk/fs/xfs/xfs_itable.c +++ b/trunk/fs/xfs/xfs_itable.c @@ -39,6 +39,16 @@ #include "xfs_error.h" #include "xfs_btree.h" +int +xfs_internal_inum( + xfs_mount_t *mp, + xfs_ino_t ino) +{ + return (ino == mp->m_sb.sb_rbmino || ino == mp->m_sb.sb_rsumino || + (XFS_SB_VERSION_HASQUOTA(&mp->m_sb) && + (ino == mp->m_sb.sb_uquotino || ino == mp->m_sb.sb_gquotino))); +} + STATIC int xfs_bulkstat_one_iget( xfs_mount_t *mp, /* mount point for filesystem */ @@ -213,17 +223,12 @@ xfs_bulkstat_one( xfs_dinode_t *dip; /* dinode inode pointer */ dip = (xfs_dinode_t *)dibuff; + *stat = BULKSTAT_RV_NOTHING; - if (!buffer || ino == mp->m_sb.sb_rbmino || ino == mp->m_sb.sb_rsumino || - (XFS_SB_VERSION_HASQUOTA(&mp->m_sb) && - (ino == mp->m_sb.sb_uquotino || ino == mp->m_sb.sb_gquotino))) { - *stat = BULKSTAT_RV_NOTHING; + if (!buffer || xfs_internal_inum(mp, ino)) return XFS_ERROR(EINVAL); - } - if (ubsize < sizeof(*buf)) { - *stat = BULKSTAT_RV_NOTHING; + if (ubsize < sizeof(*buf)) return XFS_ERROR(ENOMEM); - } buf = kmem_alloc(sizeof(*buf), KM_SLEEP); @@ -239,8 +244,7 @@ xfs_bulkstat_one( } if (copy_to_user(buffer, buf, sizeof(*buf))) { - *stat = BULKSTAT_RV_NOTHING; - error = EFAULT; + error = EFAULT; goto out_free; } diff --git a/trunk/fs/xfs/xfs_itable.h b/trunk/fs/xfs/xfs_itable.h index 6926c373a0a9..f25a28862a17 100644 --- a/trunk/fs/xfs/xfs_itable.h +++ b/trunk/fs/xfs/xfs_itable.h @@ -81,6 +81,11 @@ xfs_bulkstat_one( void *dibuff, int *stat); +int +xfs_internal_inum( + xfs_mount_t *mp, + xfs_ino_t ino); + int /* error status */ xfs_inumbers( xfs_mount_t *mp, /* mount point for filesystem */