]> git.itanic.dy.fi Git - linux-stable/commit
xfs: clean up the xfs_reserve_blocks interface
authorChristoph Hellwig <hch@lst.de>
Mon, 4 Dec 2023 17:40:56 +0000 (18:40 +0100)
committerChandan Babu R <chandanbabu@kernel.org>
Thu, 7 Dec 2023 09:21:07 +0000 (14:51 +0530)
commit646ddf0c4df5181a7057ecccd29e535baaf034b2
treee8cd6ffe4e34d364935e144c9b929288bad42a1f
parentc2c2620de7577db66a859b934715e98e4501e4f4
xfs: clean up the xfs_reserve_blocks interface

xfs_reserve_blocks has a very odd interface that can only be explained
by it directly deriving from the IRIX fcntl handler back in the day.

Split reporting out the reserved blocks out of xfs_reserve_blocks into
the only caller that cares.  This means that the value reported from
XFS_IOC_SET_RESBLKS isn't atomically sampled in the same critical
section as when it was set anymore, but as the values could change
right after setting them anyway that does not matter.  It does
provide atomic sampling of both values for XFS_IOC_GET_RESBLKS now,
though.

Also pass a normal scalar integer value for the requested value instead
of the pointless pointer.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
fs/xfs/xfs_fsops.c
fs/xfs/xfs_fsops.h
fs/xfs/xfs_ioctl.c
fs/xfs/xfs_mount.c
fs/xfs/xfs_super.c