Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 37167
b: refs/heads/master
c: 6f1f216
h: refs/heads/master
i:
  37165: 9a8e60b
  37163: 08269e3
  37159: 4797218
  37151: 3f6e74b
v: v3
  • Loading branch information
Vlad Apostolov authored and Tim Shimmin committed Sep 28, 2006
1 parent 5e2f7ae commit 44c2720
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6216ff18839bf302805f67c93e8bc344387c513b
refs/heads/master: 6f1f21684078884b62cfff2ea80a1a6c07f79824
24 changes: 14 additions & 10 deletions trunk/fs/xfs/xfs_itable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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);

Expand All @@ -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;
}

Expand Down
5 changes: 5 additions & 0 deletions trunk/fs/xfs/xfs_itable.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 44c2720

Please sign in to comment.