summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2019-01-16 10:11:58 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2019-02-04 09:31:11 -0800
commit1f8459099f66cde4c9716ecc43b5b65c28f61eb4 (patch)
tree522fea0becafb6c10346926ba2478cc735fd7680
parenta2580f14db35ba693c10d5044c2d7163f05026a8 (diff)
xfs: use generic fillattr to reduce redundant codescrub-fixes_2019-02-04
Refactor xfs_vn_getattr to use generic_fillattr to fill out parts of the kstat structure instead of open-coding the same pieces. This eliminates redundant code and fixes a bug where we fail to set the AUTOMOUNT attribute. Obviously, we retain all the xfs-specific parts. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-rw-r--r--fs/xfs/xfs_iops.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index f48ffd7a8d3e..169bd7824479 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -501,16 +501,9 @@ xfs_vn_getattr(
if (XFS_FORCED_SHUTDOWN(mp))
return -EIO;
+ generic_fillattr(inode, stat);
stat->size = XFS_ISIZE(ip);
- stat->dev = inode->i_sb->s_dev;
- stat->mode = inode->i_mode;
- stat->nlink = inode->i_nlink;
- stat->uid = inode->i_uid;
- stat->gid = inode->i_gid;
stat->ino = ip->i_ino;
- stat->atime = inode->i_atime;
- stat->mtime = inode->i_mtime;
- stat->ctime = inode->i_ctime;
stat->blocks =
XFS_FSB_TO_BB(mp, ip->i_d.di_nblocks + ip->i_delayed_blks);
@@ -533,7 +526,6 @@ xfs_vn_getattr(
case S_IFBLK:
case S_IFCHR:
stat->blksize = BLKDEV_IOSIZE;
- stat->rdev = inode->i_rdev;
break;
default:
if (XFS_IS_REALTIME_INODE(ip)) {