summaryrefslogtreecommitdiff
path: root/fs/ntfs3
diff options
context:
space:
mode:
authorKari Argillander <kari.argillander@gmail.com>2021-09-09 21:09:41 +0300
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2021-09-20 18:53:11 +0300
commit0e59a87ee619915c2eb189eb232a972c276681fb (patch)
treea6fc429dcb35ca25632b0e8fe684e2b474a3d696 /fs/ntfs3
parent0056b273757b3057a5aff73f96a7fa134641caf4 (diff)
fs/ntfs3: Initialize pointer before use place in fill_super
Initializing should be as close as possible when we use it so that we do not need to scroll up to see what is happening. Also bdev_get_queue() can never return NULL so we do not need to check for !rq. Signed-off-by: Kari Argillander <kari.argillander@gmail.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3')
-rw-r--r--fs/ntfs3/super.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 8ce0d4f439a1..3d034eac2bd1 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -875,7 +875,7 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)
int err;
struct ntfs_sb_info *sbi = sb->s_fs_info;
struct block_device *bdev = sb->s_bdev;
- struct request_queue *rq = bdev_get_queue(bdev);
+ struct request_queue *rq;
struct inode *inode;
struct ntfs_inode *ni;
size_t i, tt;
@@ -904,9 +904,8 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)
return -EINVAL;
}
- if (!rq || !blk_queue_discard(rq) || !rq->limits.discard_granularity) {
- ;
- } else {
+ rq = bdev_get_queue(bdev);
+ if (blk_queue_discard(rq) && rq->limits.discard_granularity) {
sbi->discard_granularity = rq->limits.discard_granularity;
sbi->discard_granularity_mask_inv =
~(u64)(sbi->discard_granularity - 1);