diff mbox series

btrfs: Remove unused variable mode in btrfs_mount

Message ID 20181005122615.da52bp6a6ie4jzzw@merlin (mailing list archive)
State New, archived
Headers show
Series btrfs: Remove unused variable mode in btrfs_mount | expand

Commit Message

Goldwyn Rodrigues Oct. 5, 2018, 12:26 p.m. UTC
Code cleanup.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>

Comments

Nikolay Borisov Oct. 5, 2018, 12:27 p.m. UTC | #1
On  5.10.2018 15:26, Goldwyn Rodrigues wrote:
> Code cleanup.
> 
> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>

Reviewed-by: Nikolay Borisov <nborisov@suse.com>

> 
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index e7f702761cb7..f7b8b7a6b86a 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -1661,14 +1661,10 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
>  {
>  	struct vfsmount *mnt_root;
>  	struct dentry *root;
> -	fmode_t mode = FMODE_READ;
>  	char *subvol_name = NULL;
>  	u64 subvol_objectid = 0;
>  	int error = 0;
>  
> -	if (!(flags & SB_RDONLY))
> -		mode |= FMODE_WRITE;
> -
>  	error = btrfs_parse_subvol_options(data, &subvol_name,
>  					&subvol_objectid);
>  	if (error) {
>
David Sterba Oct. 8, 2018, 1:03 p.m. UTC | #2
On Fri, Oct 05, 2018 at 07:26:15AM -0500, Goldwyn Rodrigues wrote:
> Code cleanup.

Have you check when and why the variable become unused? Thanks.
Goldwyn Rodrigues Oct. 8, 2018, 2:44 p.m. UTC | #3
On 15:03 08/10, David Sterba wrote:
> On Fri, Oct 05, 2018 at 07:26:15AM -0500, Goldwyn Rodrigues wrote:
> > Code cleanup.
> 
> Have you check when and why the variable become unused? Thanks.

No, I did not check it earlier. git blame points to
312c89fbca06 ("btrfs: cleanup btrfs_mount() using btrfs_mount_root()")
Author cc'd.
diff mbox series

Patch

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index e7f702761cb7..f7b8b7a6b86a 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1661,14 +1661,10 @@  static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
 {
 	struct vfsmount *mnt_root;
 	struct dentry *root;
-	fmode_t mode = FMODE_READ;
 	char *subvol_name = NULL;
 	u64 subvol_objectid = 0;
 	int error = 0;
 
-	if (!(flags & SB_RDONLY))
-		mode |= FMODE_WRITE;
-
 	error = btrfs_parse_subvol_options(data, &subvol_name,
 					&subvol_objectid);
 	if (error) {