xfs
[Top] [All Lists]

[PATCH v3 02/10] xfs: remove xfs_bulkstat_single

To: "xfs@xxxxxxxxxxx" <xfs@xxxxxxxxxxx>
Subject: [PATCH v3 02/10] xfs: remove xfs_bulkstat_single
From: Jeff Liu <jeff.liu@xxxxxxxxxx>
Date: Tue, 03 Jun 2014 17:18:02 +0800
Delivered-to: xfs@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0
From: Christoph Hellwig <hch@xxxxxx>

xfs_bukstat_one doesn't have any failure case that would go away when
called through xfs_bulkstat, so remove the fallback and the now unessecary
xfs_bulkstat_single function.

Reviewed-by: Jie Liu <jeff.liu@xxxxxxxxxx>
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
Signed-off-by: Jie Liu <jeff.liu@xxxxxxxxxx>
---
 fs/xfs/xfs_ioctl.c  |  4 ++--
 fs/xfs/xfs_itable.c | 48 ------------------------------------------------
 fs/xfs/xfs_itable.h |  7 -------
 3 files changed, 2 insertions(+), 57 deletions(-)

diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 55724c8..eb5a366 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -799,8 +799,8 @@ xfs_ioc_bulkstat(
                error = xfs_inumbers(mp, &inlast, &count,
                                        bulkreq.ubuffer, xfs_inumbers_fmt);
        else if (cmd == XFS_IOC_FSBULKSTAT_SINGLE)
-               error = xfs_bulkstat_single(mp, &inlast,
-                                               bulkreq.ubuffer, &done);
+               error = xfs_bulkstat_one(mp, inlast, bulkreq.ubuffer,
+                                       sizeof(xfs_bstat_t), NULL, &done);
        else    /* XFS_IOC_FSBULKSTAT */
                error = xfs_bulkstat(mp, &inlast, &count, xfs_bulkstat_one,
                                     sizeof(xfs_bstat_t), bulkreq.ubuffer,
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
index 2e7b397..4d62e63 100644
--- a/fs/xfs/xfs_itable.c
+++ b/fs/xfs/xfs_itable.c
@@ -509,54 +509,6 @@ xfs_bulkstat(
        return rval;
 }
 
-/*
- * Return stat information in bulk (by-inode) for the filesystem.
- * Special case for non-sequential one inode bulkstat.
- */
-int                                    /* error status */
-xfs_bulkstat_single(
-       xfs_mount_t             *mp,    /* mount point for filesystem */
-       xfs_ino_t               *lastinop, /* inode to return */
-       char                    __user *buffer, /* buffer with inode stats */
-       int                     *done)  /* 1 if there are more stats to get */
-{
-       int                     count;  /* count value for bulkstat call */
-       int                     error;  /* return value */
-       xfs_ino_t               ino;    /* filesystem inode number */
-       int                     res;    /* result from bs1 */
-
-       /*
-        * note that requesting valid inode numbers which are not allocated
-        * to inodes will most likely cause xfs_imap_to_bp to generate warning
-        * messages about bad magic numbers. This is ok. The fact that
-        * the inode isn't actually an inode is handled by the
-        * error check below. Done this way to make the usual case faster
-        * at the expense of the error case.
-        */
-
-       ino = *lastinop;
-       error = xfs_bulkstat_one(mp, ino, buffer, sizeof(xfs_bstat_t),
-                                NULL, &res);
-       if (error) {
-               /*
-                * Special case way failed, do it the "long" way
-                * to see if that works.
-                */
-               (*lastinop)--;
-               count = 1;
-               if (xfs_bulkstat(mp, lastinop, &count, xfs_bulkstat_one,
-                               sizeof(xfs_bstat_t), buffer, done))
-                       return error;
-               if (count == 0 || (xfs_ino_t)*lastinop != ino)
-                       return error == EFSCORRUPTED ?
-                               XFS_ERROR(EINVAL) : error;
-               else
-                       return 0;
-       }
-       *done = 0;
-       return 0;
-}
-
 int
 xfs_inumbers_fmt(
        void                    __user *ubuffer, /* buffer to write to */
diff --git a/fs/xfs/xfs_itable.h b/fs/xfs/xfs_itable.h
index 97295d9..6ea8b39 100644
--- a/fs/xfs/xfs_itable.h
+++ b/fs/xfs/xfs_itable.h
@@ -50,13 +50,6 @@ xfs_bulkstat(
        char            __user *ubuffer,/* buffer with inode stats */
        int             *done);         /* 1 if there are more stats to get */
 
-int
-xfs_bulkstat_single(
-       xfs_mount_t             *mp,
-       xfs_ino_t               *lastinop,
-       char                    __user *buffer,
-       int                     *done);
-
 typedef int (*bulkstat_one_fmt_pf)(  /* used size in bytes or negative error */
        void                    __user *ubuffer, /* buffer to write to */
        int                     ubsize,          /* remaining user buffer sz */
-- 
1.8.3.2

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH v3 02/10] xfs: remove xfs_bulkstat_single, Jeff Liu <=