summaryrefslogtreecommitdiff
path: root/fs/nfsd/blocklayout.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-09-03 07:40:57 +0200
committerJens Axboe <axboe@kernel.dk>2020-09-25 08:18:57 -0600
commitfa01b1e9733fd59ecb8b5b6d85dfb481d2025fbf (patch)
treef627199fb47da3dc4fa57dcbf305fff12997a918 /fs/nfsd/blocklayout.c
parent250eec9e390e2be6f672f9a77cf29791c189f7da (diff)
block: add a bdev_is_partition helper
Add a littler helper to make the somewhat arcane bd_contains checks a little more obvious. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/nfsd/blocklayout.c')
-rw-r--r--fs/nfsd/blocklayout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfsd/blocklayout.c b/fs/nfsd/blocklayout.c
index 311e5ce80cfc..a07c39c94bbd 100644
--- a/fs/nfsd/blocklayout.c
+++ b/fs/nfsd/blocklayout.c
@@ -170,7 +170,7 @@ nfsd4_block_proc_getdeviceinfo(struct super_block *sb,
struct nfs4_client *clp,
struct nfsd4_getdeviceinfo *gdp)
{
- if (sb->s_bdev != sb->s_bdev->bd_contains)
+ if (bdev_is_partition(sb->s_bdev))
return nfserr_inval;
return nfserrno(nfsd4_block_get_device_info_simple(sb, gdp));
}
@@ -382,7 +382,7 @@ nfsd4_scsi_proc_getdeviceinfo(struct super_block *sb,
struct nfs4_client *clp,
struct nfsd4_getdeviceinfo *gdp)
{
- if (sb->s_bdev != sb->s_bdev->bd_contains)
+ if (bdev_is_partition(sb->s_bdev))
return nfserr_inval;
return nfserrno(nfsd4_block_get_device_info_scsi(sb, clp, gdp));
}