xfs: close the RT and log block devices in xfs_free_buftarg
authorChristoph Hellwig <hch@lst.de>
Wed, 9 Aug 2023 22:05:37 +0000 (15:05 -0700)
committerChristian Brauner <brauner@kernel.org>
Thu, 10 Aug 2023 08:34:54 +0000 (10:34 +0200)
commit41233576e9a4515dc9b0bd1cbbb896b520a1f486
tree7989ca3d6c7ce3b1910db449b05c1956bd674e2a
parentd3ef7e94ee36adc8f0006d253a9ad45793b874cd
xfs: close the RT and log block devices in xfs_free_buftarg

Closing the block devices logically belongs into xfs_free_buftarg,  So
instead of open coding it in the caller move it there and add a check
for the s_bdev so that the main device isn't close as that's done by the
VFS helper.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Message-Id: <20230809220545.1308228-6-hch@lst.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/xfs/xfs_buf.c