All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext4: remove unnecessary ifdefs in htree_dirblock_to_tree()
@ 2019-12-09 21:32 Eric Biggers
  2019-12-13 10:46 ` Jan Kara
  2020-01-13 18:52 ` Theodore Y. Ts'o
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Biggers @ 2019-12-09 21:32 UTC (permalink / raw)
  To: linux-ext4; +Cc: linux-fscrypt

From: Eric Biggers <ebiggers@google.com>

The ifdefs for CONFIG_FS_ENCRYPTION in htree_dirblock_to_tree() are
unnecessary, as the called functions are already stubbed out when
!CONFIG_FS_ENCRYPTION.  Remove them.

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 fs/ext4/namei.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index a856997d87b54..d4c2cc73fe71d 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1002,7 +1002,6 @@ static int htree_dirblock_to_tree(struct file *dir_file,
 	top = (struct ext4_dir_entry_2 *) ((char *) de +
 					   dir->i_sb->s_blocksize -
 					   EXT4_DIR_REC_LEN(0));
-#ifdef CONFIG_FS_ENCRYPTION
 	/* Check if the directory is encrypted */
 	if (IS_ENCRYPTED(dir)) {
 		err = fscrypt_get_encryption_info(dir);
@@ -1017,7 +1016,7 @@ static int htree_dirblock_to_tree(struct file *dir_file,
 			return err;
 		}
 	}
-#endif
+
 	for (; de < top; de = ext4_next_entry(de, dir->i_sb->s_blocksize)) {
 		if (ext4_check_dir_entry(dir, NULL, de, bh,
 				bh->b_data, bh->b_size,
@@ -1065,9 +1064,7 @@ static int htree_dirblock_to_tree(struct file *dir_file,
 	}
 errout:
 	brelse(bh);
-#ifdef CONFIG_FS_ENCRYPTION
 	fscrypt_fname_free_buffer(&fname_crypto_str);
-#endif
 	return count;
 }
 
-- 
2.24.0.393.g34dc348eaf-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: remove unnecessary ifdefs in htree_dirblock_to_tree()
  2019-12-09 21:32 [PATCH] ext4: remove unnecessary ifdefs in htree_dirblock_to_tree() Eric Biggers
@ 2019-12-13 10:46 ` Jan Kara
  2020-01-13 18:52 ` Theodore Y. Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Kara @ 2019-12-13 10:46 UTC (permalink / raw)
  To: Eric Biggers; +Cc: linux-ext4, linux-fscrypt

On Mon 09-12-19 13:32:25, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> The ifdefs for CONFIG_FS_ENCRYPTION in htree_dirblock_to_tree() are
> unnecessary, as the called functions are already stubbed out when
> !CONFIG_FS_ENCRYPTION.  Remove them.
> 
> Signed-off-by: Eric Biggers <ebiggers@google.com>

Looks good to me. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/ext4/namei.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
> index a856997d87b54..d4c2cc73fe71d 100644
> --- a/fs/ext4/namei.c
> +++ b/fs/ext4/namei.c
> @@ -1002,7 +1002,6 @@ static int htree_dirblock_to_tree(struct file *dir_file,
>  	top = (struct ext4_dir_entry_2 *) ((char *) de +
>  					   dir->i_sb->s_blocksize -
>  					   EXT4_DIR_REC_LEN(0));
> -#ifdef CONFIG_FS_ENCRYPTION
>  	/* Check if the directory is encrypted */
>  	if (IS_ENCRYPTED(dir)) {
>  		err = fscrypt_get_encryption_info(dir);
> @@ -1017,7 +1016,7 @@ static int htree_dirblock_to_tree(struct file *dir_file,
>  			return err;
>  		}
>  	}
> -#endif
> +
>  	for (; de < top; de = ext4_next_entry(de, dir->i_sb->s_blocksize)) {
>  		if (ext4_check_dir_entry(dir, NULL, de, bh,
>  				bh->b_data, bh->b_size,
> @@ -1065,9 +1064,7 @@ static int htree_dirblock_to_tree(struct file *dir_file,
>  	}
>  errout:
>  	brelse(bh);
> -#ifdef CONFIG_FS_ENCRYPTION
>  	fscrypt_fname_free_buffer(&fname_crypto_str);
> -#endif
>  	return count;
>  }
>  
> -- 
> 2.24.0.393.g34dc348eaf-goog
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: remove unnecessary ifdefs in htree_dirblock_to_tree()
  2019-12-09 21:32 [PATCH] ext4: remove unnecessary ifdefs in htree_dirblock_to_tree() Eric Biggers
  2019-12-13 10:46 ` Jan Kara
@ 2020-01-13 18:52 ` Theodore Y. Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Theodore Y. Ts'o @ 2020-01-13 18:52 UTC (permalink / raw)
  To: Eric Biggers; +Cc: linux-ext4, linux-fscrypt

On Mon, Dec 09, 2019 at 01:32:25PM -0800, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> The ifdefs for CONFIG_FS_ENCRYPTION in htree_dirblock_to_tree() are
> unnecessary, as the called functions are already stubbed out when
> !CONFIG_FS_ENCRYPTION.  Remove them.
> 
> Signed-off-by: Eric Biggers <ebiggers@google.com>

Thanks, applied.

					- Ted

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-13 18:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-09 21:32 [PATCH] ext4: remove unnecessary ifdefs in htree_dirblock_to_tree() Eric Biggers
2019-12-13 10:46 ` Jan Kara
2020-01-13 18:52 ` Theodore Y. Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.