fs/xfs: Combine xfs_diflags_to_linux() and xfs_diflags_to_iflags()
authorIra Weiny <ira.weiny@intel.com>
Mon, 4 May 2020 16:02:43 +0000 (09:02 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 4 May 2020 16:03:43 +0000 (09:03 -0700)
commit840d493dff1abb0cb0d73417148a3eeecd5f30d9
tree93a9ed41f55cefc42c04596e22681b8c7641163e
parent32dbc5655f1ccb3bffa5785523146f60fa4bf905
fs/xfs: Combine xfs_diflags_to_linux() and xfs_diflags_to_iflags()

The functionality in xfs_diflags_to_linux() and xfs_diflags_to_iflags() are
nearly identical.  The only difference is that *_to_linux() is called after
inode setup and disallows changing the DAX flag.

Combining them can be done with a flag which indicates if this is the initial
setup to allow the DAX flag to be properly set only at init time.

So remove xfs_diflags_to_linux() and call the modified xfs_diflags_to_iflags()
directly.

While we are here simplify xfs_diflags_to_iflags() to take struct xfs_inode and
use xfs_ip2xflags() to ensure future diflags are included correctly.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_inode.h
fs/xfs/xfs_ioctl.c
fs/xfs/xfs_iops.c