Commit 1dee7094 authored by Nathan Scott's avatar Nathan Scott

[XFS] Remove unused transaction pointer from bulkstat.

SGI Modid: xfs-linux:xfs-kern:171081a
parent 0a9bde57
......@@ -941,7 +941,7 @@ xfs_ioc_bulkstat(
return -XFS_ERROR(EINVAL);
if (cmd == XFS_IOC_FSINUMBERS)
error = xfs_inumbers(mp, NULL, &inlast, &count,
error = xfs_inumbers(mp, &inlast, &count,
bulkreq.ubuffer);
else if (cmd == XFS_IOC_FSBULKSTAT_SINGLE)
error = xfs_bulkstat_single(mp, &inlast,
......@@ -952,7 +952,7 @@ xfs_ioc_bulkstat(
error = xfs_bulkstat_single(mp, &inlast,
bulkreq.ubuffer, &done);
} else {
error = xfs_bulkstat(mp, NULL, &inlast, &count,
error = xfs_bulkstat(mp, &inlast, &count,
(bulkstat_one_pf)xfs_bulkstat_one, NULL,
sizeof(xfs_bstat_t), bulkreq.ubuffer,
BULKSTAT_FG_QUICK, &done);
......
......@@ -1734,7 +1734,6 @@ xfs_qm_get_rtblks(
STATIC int
xfs_qm_dqusage_adjust(
xfs_mount_t *mp, /* mount point for filesystem */
xfs_trans_t *tp, /* transaction pointer - NULL */
xfs_ino_t ino, /* inode number to get data for */
void *buffer, /* not used */
int ubsize, /* not used */
......@@ -1766,7 +1765,7 @@ xfs_qm_dqusage_adjust(
* the case in all other instances. It's OK that we do this because
* quotacheck is done only at mount time.
*/
if ((error = xfs_iget(mp, tp, ino, XFS_ILOCK_EXCL, &ip, bno))) {
if ((error = xfs_iget(mp, NULL, ino, XFS_ILOCK_EXCL, &ip, bno))) {
*res = BULKSTAT_RV_NOTHING;
return (error);
}
......@@ -1903,7 +1902,7 @@ xfs_qm_quotacheck(
* Iterate thru all the inodes in the file system,
* adjusting the corresponding dquot counters in core.
*/
if ((error = xfs_bulkstat(mp, NULL, &lastino, &count,
if ((error = xfs_bulkstat(mp, &lastino, &count,
xfs_qm_dqusage_adjust, NULL,
structsz, NULL,
BULKSTAT_FG_IGET|BULKSTAT_FG_VFSLOCKED,
......
......@@ -1298,7 +1298,6 @@ xfs_qm_internalqcheck_dqadjust(
STATIC int
xfs_qm_internalqcheck_adjust(
xfs_mount_t *mp, /* mount point for filesystem */
xfs_trans_t *tp, /* transaction pointer */
xfs_ino_t ino, /* inode number to get data for */
void *buffer, /* not used */
int ubsize, /* not used */
......@@ -1327,7 +1326,7 @@ xfs_qm_internalqcheck_adjust(
ipreleased = B_FALSE;
again:
lock_flags = XFS_ILOCK_SHARED;
if ((error = xfs_iget(mp, tp, ino, lock_flags, &ip, bno))) {
if ((error = xfs_iget(mp, NULL, ino, lock_flags, &ip, bno))) {
*res = BULKSTAT_RV_NOTHING;
return (error);
}
......@@ -1405,7 +1404,7 @@ xfs_qm_internalqcheck(
* Iterate thru all the inodes in the file system,
* adjusting the corresponding dquot counters
*/
if ((error = xfs_bulkstat(mp, NULL, &lastino, &count,
if ((error = xfs_bulkstat(mp, &lastino, &count,
xfs_qm_internalqcheck_adjust, NULL,
0, NULL, BULKSTAT_FG_IGET, &done))) {
break;
......
......@@ -55,14 +55,18 @@
#include "xfs_itable.h"
#include "xfs_error.h"
#ifndef HAVE_USERACC
#define useracc(ubuffer, size, flags, foo) (0)
#define unuseracc(ubuffer, size, flags)
#endif
/*
* Return stat information for one inode.
* Return 0 if ok, else errno.
*/
int /* error status */
int /* error status */
xfs_bulkstat_one(
xfs_mount_t *mp, /* mount point for filesystem */
xfs_trans_t *tp, /* transaction pointer */
xfs_ino_t ino, /* inode number to get data for */
void *buffer, /* buffer to place output in */
int ubsize, /* size of buffer */
......@@ -98,7 +102,7 @@ xfs_bulkstat_one(
/* We're not being passed a pointer to a dinode. This happens
* if BULKSTAT_FG_IGET is selected. Do the iget.
*/
error = xfs_iget(mp, tp, ino, XFS_ILOCK_SHARED, &ip, bno);
error = xfs_iget(mp, NULL, ino, XFS_ILOCK_SHARED, &ip, bno);
if (error) {
*stat = BULKSTAT_RV_NOTHING;
return error;
......@@ -236,7 +240,6 @@ xfs_bulkstat_one(
int /* error status */
xfs_bulkstat(
xfs_mount_t *mp, /* mount point for filesystem */
xfs_trans_t *tp, /* transaction pointer */
xfs_ino_t *lastinop, /* last inode returned */
int *ubcountp, /* size of buffer/count returned */
bulkstat_one_pf formatter, /* func that'd fill a single buf */
......@@ -311,13 +314,11 @@ xfs_bulkstat(
* Lock down the user's buffer. If a buffer was not sent, as in the case
* disk quota code calls here, we skip this.
*/
#if defined(HAVE_USERACC)
if (ubuffer &&
(error = useracc(ubuffer, ubcount * statstruct_size,
(B_READ|B_PHYS), NULL))) {
return error;
}
#endif
/*
* Allocate a page-sized buffer for inode btree records.
* We could try allocating something smaller, but for normal
......@@ -333,7 +334,7 @@ xfs_bulkstat(
while (ubleft >= statstruct_size && agno < mp->m_sb.sb_agcount) {
bp = NULL;
down_read(&mp->m_peraglock);
error = xfs_ialloc_read_agi(mp, tp, agno, &agbp);
error = xfs_ialloc_read_agi(mp, NULL, agno, &agbp);
up_read(&mp->m_peraglock);
if (error) {
/*
......@@ -347,7 +348,7 @@ xfs_bulkstat(
/*
* Allocate and initialize a btree cursor for ialloc btree.
*/
cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_INO,
cur = xfs_btree_init_cursor(mp, NULL, agbp, agno, XFS_BTNUM_INO,
(xfs_inode_t *)0, 0);
irbp = irbuf;
irbufend = irbuf + nirbuf;
......@@ -461,7 +462,7 @@ xfs_bulkstat(
* when calling iget.
*/
xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
xfs_trans_brelse(tp, agbp);
xfs_buf_relse(agbp);
/*
* Now format all the good inodes into the user's buffer.
*/
......@@ -534,8 +535,8 @@ xfs_bulkstat(
ip->i_ino = ino;
ip->i_mount = mp;
if (bp)
xfs_trans_brelse(tp, bp);
error = xfs_itobp(mp, tp, ip,
xfs_buf_relse(bp);
error = xfs_itobp(mp, NULL, ip,
&dip, &bp, bno);
if (!error)
clustidx = ip->i_boffset / mp->m_sb.sb_inodesize;
......@@ -580,7 +581,7 @@ xfs_bulkstat(
* in xfs_qm_quotacheck.
*/
ubused = statstruct_size;
error = formatter(mp, tp, ino, ubufp,
error = formatter(mp, ino, ubufp,
ubleft, private_data,
bno, &ubused, dip, &fmterror);
if (fmterror == BULKSTAT_RV_NOTHING) {
......@@ -603,7 +604,7 @@ xfs_bulkstat(
}
if (bp)
xfs_trans_brelse(tp, bp);
xfs_buf_relse(bp);
/*
* Set up for the next loop iteration.
......@@ -621,10 +622,8 @@ xfs_bulkstat(
* Done, we're either out of filesystem or space to put the data.
*/
kmem_free(irbuf, NBPC);
#if defined(HAVE_USERACC)
if (ubuffer)
unuseracc(ubuffer, ubcount * statstruct_size, (B_READ|B_PHYS));
#endif
*ubcountp = ubelem;
if (agno >= mp->m_sb.sb_agcount) {
/*
......@@ -667,7 +666,7 @@ xfs_bulkstat_single(
*/
ino = (xfs_ino_t)*lastinop;
error = xfs_bulkstat_one(mp, NULL, ino, &bstat, sizeof(bstat),
error = xfs_bulkstat_one(mp, ino, &bstat, sizeof(bstat),
NULL, 0, NULL, NULL, &res);
if (error) {
/*
......@@ -676,7 +675,7 @@ xfs_bulkstat_single(
*/
(*lastinop)--;
count = 1;
if (xfs_bulkstat(mp, NULL, lastinop, &count, xfs_bulkstat_one,
if (xfs_bulkstat(mp, lastinop, &count, xfs_bulkstat_one,
NULL,
sizeof(bstat), buffer, BULKSTAT_FG_IGET, done))
return error;
......@@ -698,7 +697,6 @@ xfs_bulkstat_single(
int /* error status */
xfs_inumbers(
xfs_mount_t *mp, /* mount point for filesystem */
xfs_trans_t *tp, /* transaction pointer */
xfs_ino_t *lastino, /* last inode returned */
int *count, /* size of buffer/count returned */
xfs_caddr_t ubuffer) /* buffer with inode descriptions */
......@@ -732,7 +730,7 @@ xfs_inumbers(
while (left > 0 && agno < mp->m_sb.sb_agcount) {
if (agbp == NULL) {
down_read(&mp->m_peraglock);
error = xfs_ialloc_read_agi(mp, tp, agno, &agbp);
error = xfs_ialloc_read_agi(mp, NULL, agno, &agbp);
up_read(&mp->m_peraglock);
if (error) {
/*
......@@ -745,13 +743,13 @@ xfs_inumbers(
agino = 0;
continue;
}
cur = xfs_btree_init_cursor(mp, tp, agbp, agno,
cur = xfs_btree_init_cursor(mp, NULL, agbp, agno,
XFS_BTNUM_INO, (xfs_inode_t *)0, 0);
error = xfs_inobt_lookup_ge(cur, agino, 0, 0, &tmp);
if (error) {
xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
cur = NULL;
xfs_trans_brelse(tp, agbp);
xfs_buf_relse(agbp);
agbp = NULL;
/*
* Move up the the last inode in the current
......@@ -765,7 +763,7 @@ xfs_inumbers(
if ((error = xfs_inobt_get_rec(cur, &gino, &gcnt, &gfree,
&i, ARCH_NOCONVERT)) ||
i == 0) {
xfs_trans_brelse(tp, agbp);
xfs_buf_relse(agbp);
agbp = NULL;
xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
cur = NULL;
......@@ -794,7 +792,7 @@ xfs_inumbers(
if (error) {
xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
cur = NULL;
xfs_trans_brelse(tp, agbp);
xfs_buf_relse(agbp);
agbp = NULL;
/*
* The agino value has already been bumped.
......@@ -820,6 +818,6 @@ xfs_inumbers(
xfs_btree_del_cursor(cur, (error ? XFS_BTREE_ERROR :
XFS_BTREE_NOERROR));
if (agbp)
xfs_trans_brelse(tp, agbp);
xfs_buf_relse(agbp);
return error;
}
......@@ -39,7 +39,6 @@
* see xfs_bulkstat_one() and xfs_dm_bulkstat_one() in dmapi_xfs.c
*/
typedef int (*bulkstat_one_pf)(struct xfs_mount *mp,
struct xfs_trans *tp,
xfs_ino_t ino,
void *buffer,
int ubsize,
......@@ -69,7 +68,6 @@ typedef int (*bulkstat_one_pf)(struct xfs_mount *mp,
int /* error status */
xfs_bulkstat(
xfs_mount_t *mp, /* mount point for filesystem */
xfs_trans_t *tp, /* transaction pointer */
xfs_ino_t *lastino, /* last inode returned */
int *count, /* size of buffer/count returned */
bulkstat_one_pf formatter, /* func that'd fill a single buf */
......@@ -89,7 +87,6 @@ xfs_bulkstat_single(
int
xfs_bulkstat_one(
xfs_mount_t *mp,
xfs_trans_t *tp,
xfs_ino_t ino,
void *buffer,
int ubsize,
......@@ -102,7 +99,6 @@ xfs_bulkstat_one(
int /* error status */
xfs_inumbers(
xfs_mount_t *mp, /* mount point for filesystem */
xfs_trans_t *tp, /* transaction pointer */
xfs_ino_t *last, /* last inode returned */
int *count, /* size of buffer/count returned */
xfs_caddr_t buffer);/* buffer with inode descriptions */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment