From: Kaixu Xia Date: Wed, 20 Apr 2022 22:47:54 +0000 (+1000) Subject: xfs: simplify local variable assignment in file write code X-Git-Tag: v6.6.17~7370^2~66^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2d9ac4319b9959bf3195fedf88bdfd224c67593b;p=platform%2Fkernel%2Flinux-rpi.git xfs: simplify local variable assignment in file write code Get the struct inode pointer from iocb->ki_filp->f_mapping->host directly and the other variables are unnecessary, so simplify the local variables assignment. Signed-off-by: Kaixu Xia Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner --- diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index c5541d0..442bfae 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -694,9 +694,7 @@ xfs_file_buffered_write( struct kiocb *iocb, struct iov_iter *from) { - struct file *file = iocb->ki_filp; - struct address_space *mapping = file->f_mapping; - struct inode *inode = mapping->host; + struct inode *inode = iocb->ki_filp->f_mapping->host; struct xfs_inode *ip = XFS_I(inode); ssize_t ret; bool cleared_space = false; @@ -767,9 +765,7 @@ xfs_file_write_iter( struct kiocb *iocb, struct iov_iter *from) { - struct file *file = iocb->ki_filp; - struct address_space *mapping = file->f_mapping; - struct inode *inode = mapping->host; + struct inode *inode = iocb->ki_filp->f_mapping->host; struct xfs_inode *ip = XFS_I(inode); ssize_t ret; size_t ocount = iov_iter_count(from);