* [PATCH] xfs: clean up unused codes at xfs_bulkstat()
@ 2013-07-01 13:51 Jeff Liu
2013-07-02 10:30 ` Dave Chinner
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Liu @ 2013-07-01 13:51 UTC (permalink / raw)
To: xfs@oss.sgi.com
From: Jie Liu <jeff.liu@oracle.com>
There are some unused codes at xfs_bulkstat():
- Variable bp is defined to point to the on-disk inode cluster
buffer, but it proved to be of no practical help.
- We process the chunks of good inodes which were fetched by iterating
btree records from an AG. When processing inodes from each chunk,
the code recomputing agbno if run into the first inode of a cluster,
however, the agbno is not being used thereafter.
This patch tries to clean up those things.
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
---
fs/xfs/xfs_itable.c | 28 +---------------------------
1 file changed, 1 insertion(+), 27 deletions(-)
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
--- a/fs/xfs/xfs_itable.c
+++ b/fs/xfs/xfs_itable.c
@@ -221,7 +221,6 @@ xfs_bulkstat(
char __user *ubufp; /* pointer into user's buffer */
int ubelem; /* spaces used in user's buffer */
int ubused; /* bytes used by formatter */
- xfs_buf_t *bp; /* ptr to on-disk inode cluster buf */
/*
* Get the last inode value, see if there's nothing to do.
@@ -263,7 +262,6 @@ xfs_bulkstat(
rval = 0;
while (XFS_BULKSTAT_UBLEFT(ubleft) && agno < mp->m_sb.sb_agcount) {
cond_resched();
- bp = NULL;
error = xfs_ialloc_read_agi(mp, NULL, agno, &agbp);
if (error) {
/*
@@ -433,27 +431,7 @@ xfs_bulkstat(
irbp->ir_freecount < XFS_INODES_PER_CHUNK;
chunkidx++, clustidx++, agino++) {
ASSERT(chunkidx < XFS_INODES_PER_CHUNK);
- /*
- * Recompute agbno if this is the
- * first inode of the cluster.
- *
- * Careful with clustidx. There can be
- * multiple clusters per chunk, a single
- * cluster per chunk or a cluster that has
- * inodes represented from several different
- * chunks (if blocksize is large).
- *
- * Because of this, the starting clustidx is
- * initialized to zero in this loop but must
- * later be reset after reading in the cluster
- * buffer.
- */
- if ((chunkidx & (nicluster - 1)) == 0) {
- agbno = XFS_AGINO_TO_AGBNO(mp,
- irbp->ir_startino) +
- ((chunkidx & nimask) >>
- mp->m_sb.sb_inopblog);
- }
+
ino = XFS_AGINO_TO_INO(mp, agno, agino);
/*
* Skip if this inode is free.
@@ -499,10 +477,6 @@ xfs_bulkstat(
cond_resched();
}
-
- if (bp)
- xfs_buf_relse(bp);
-
/*
* Set up for the next loop iteration.
*/
--
1.7.9.5
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] xfs: clean up unused codes at xfs_bulkstat()
2013-07-01 13:51 [PATCH] xfs: clean up unused codes at xfs_bulkstat() Jeff Liu
@ 2013-07-02 10:30 ` Dave Chinner
2013-07-09 20:37 ` Ben Myers
0 siblings, 1 reply; 3+ messages in thread
From: Dave Chinner @ 2013-07-02 10:30 UTC (permalink / raw)
To: Jeff Liu; +Cc: xfs@oss.sgi.com
On Mon, Jul 01, 2013 at 09:51:32PM +0800, Jeff Liu wrote:
> From: Jie Liu <jeff.liu@oracle.com>
>
> There are some unused codes at xfs_bulkstat():
>
> - Variable bp is defined to point to the on-disk inode cluster
> buffer, but it proved to be of no practical help.
>
> - We process the chunks of good inodes which were fetched by iterating
> btree records from an AG. When processing inodes from each chunk,
> the code recomputing agbno if run into the first inode of a cluster,
> however, the agbno is not being used thereafter.
>
> This patch tries to clean up those things.
>
> Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: clean up unused codes at xfs_bulkstat()
2013-07-02 10:30 ` Dave Chinner
@ 2013-07-09 20:37 ` Ben Myers
0 siblings, 0 replies; 3+ messages in thread
From: Ben Myers @ 2013-07-09 20:37 UTC (permalink / raw)
To: Jeff Liu; +Cc: xfs@oss.sgi.com
On Tue, Jul 02, 2013 at 08:30:46PM +1000, Dave Chinner wrote:
> On Mon, Jul 01, 2013 at 09:51:32PM +0800, Jeff Liu wrote:
> > From: Jie Liu <jeff.liu@oracle.com>
> >
> > There are some unused codes at xfs_bulkstat():
> >
> > - Variable bp is defined to point to the on-disk inode cluster
> > buffer, but it proved to be of no practical help.
> >
> > - We process the chunks of good inodes which were fetched by iterating
> > btree records from an AG. When processing inodes from each chunk,
> > the code recomputing agbno if run into the first inode of a cluster,
> > however, the agbno is not being used thereafter.
> >
> > This patch tries to clean up those things.
> >
> > Signed-off-by: Jie Liu <jeff.liu@oracle.com>
>
> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Applied.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-07-09 20:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-01 13:51 [PATCH] xfs: clean up unused codes at xfs_bulkstat() Jeff Liu
2013-07-02 10:30 ` Dave Chinner
2013-07-09 20:37 ` Ben Myers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox