diff mbox series

[5/9] btrfs: document byte swap optimization of root_item::flags accessors

Message ID aa044ee1e458071530d3f74f53cddc72010f3f63.1621961965.git.dsterba@suse.com (mailing list archive)
State New, archived
Headers show
Series Misc fixups and cleanups | expand

Commit Message

David Sterba May 25, 2021, 5:08 p.m. UTC
Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/ctree.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Anand Jain May 26, 2021, 7:28 a.m. UTC | #1
On 26/05/2021 01:08, David Sterba wrote:
> Signed-off-by: David Sterba <dsterba@suse.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>

Thanks.

> ---
>   fs/btrfs/ctree.h | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index d78cb2d89d7e..a3b628ea4d64 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -2216,11 +2216,13 @@ BTRFS_SETGET_STACK_FUNCS(root_rtransid, struct btrfs_root_item,
>   
>   static inline bool btrfs_root_readonly(const struct btrfs_root *root)
>   {
> +	/* Byte-swap the constant at compile time, root_item::flags is LE */
>   	return (root->root_item.flags & cpu_to_le64(BTRFS_ROOT_SUBVOL_RDONLY)) != 0;
>   }
>   
>   static inline bool btrfs_root_dead(const struct btrfs_root *root)
>   {
> +	/* Byte-swap the constant at compile time, root_item::flags is LE */
>   	return (root->root_item.flags & cpu_to_le64(BTRFS_ROOT_SUBVOL_DEAD)) != 0;
>   }
>   
>
diff mbox series

Patch

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index d78cb2d89d7e..a3b628ea4d64 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2216,11 +2216,13 @@  BTRFS_SETGET_STACK_FUNCS(root_rtransid, struct btrfs_root_item,
 
 static inline bool btrfs_root_readonly(const struct btrfs_root *root)
 {
+	/* Byte-swap the constant at compile time, root_item::flags is LE */
 	return (root->root_item.flags & cpu_to_le64(BTRFS_ROOT_SUBVOL_RDONLY)) != 0;
 }
 
 static inline bool btrfs_root_dead(const struct btrfs_root *root)
 {
+	/* Byte-swap the constant at compile time, root_item::flags is LE */
 	return (root->root_item.flags & cpu_to_le64(BTRFS_ROOT_SUBVOL_DEAD)) != 0;
 }