linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: [PATCH 04/11] btrfs: move btrfs_name_hash to dir-item.h
Date: Wed, 23 Aug 2023 09:51:30 -0400	[thread overview]
Message-ID: <0739f7926fe01f0861a0f69da55f080fd7f464e4.1692798556.git.josef@toxicpanda.com> (raw)
In-Reply-To: <cover.1692798556.git.josef@toxicpanda.com>

This is related to the name hashing for dir items, move it into
dir-item.h.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/ctree.h        | 5 -----
 fs/btrfs/dir-item.h     | 5 +++++
 fs/btrfs/props.c        | 1 +
 fs/btrfs/tree-checker.c | 1 +
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 7b8e52fd6d99..9c2e96b8711f 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -470,11 +470,6 @@ static inline u32 BTRFS_MAX_XATTR_SIZE(const struct btrfs_fs_info *info)
 #define BTRFS_BYTES_TO_BLKS(fs_info, bytes) \
 				((bytes) >> (fs_info)->sectorsize_bits)
 
-static inline u64 btrfs_name_hash(const char *name, int len)
-{
-       return crc32c((u32)~1, name, len);
-}
-
 static inline gfp_t btrfs_alloc_write_mask(struct address_space *mapping)
 {
 	return mapping_gfp_constraint(mapping, ~__GFP_FS);
diff --git a/fs/btrfs/dir-item.h b/fs/btrfs/dir-item.h
index aab4b7cc7fa0..951b4dda46fe 100644
--- a/fs/btrfs/dir-item.h
+++ b/fs/btrfs/dir-item.h
@@ -39,4 +39,9 @@ struct btrfs_dir_item *btrfs_match_dir_item_name(struct btrfs_fs_info *fs_info,
 						 const char *name,
 						 int name_len);
 
+static inline u64 btrfs_name_hash(const char *name, int len)
+{
+       return crc32c((u32)~1, name, len);
+}
+
 #endif
diff --git a/fs/btrfs/props.c b/fs/btrfs/props.c
index 0755af0e53e3..f9bf591a0718 100644
--- a/fs/btrfs/props.c
+++ b/fs/btrfs/props.c
@@ -15,6 +15,7 @@
 #include "fs.h"
 #include "accessors.h"
 #include "super.h"
+#include "dir-item.h"
 
 #define BTRFS_PROP_HANDLERS_HT_BITS 8
 static DEFINE_HASHTABLE(prop_handlers_ht, BTRFS_PROP_HANDLERS_HT_BITS);
diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
index ab08a0b01311..8ad92aa43924 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -29,6 +29,7 @@
 #include "accessors.h"
 #include "file-item.h"
 #include "inode-item.h"
+#include "dir-item.h"
 
 /*
  * Error message should follow the following format:
-- 
2.41.0


  parent reply	other threads:[~2023-08-23 13:51 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-23 13:51 [PATCH 00/11] btrfs: ctree.[ch] cleanups Josef Bacik
2023-08-23 13:51 ` [PATCH 01/11] btrfs: move btrfs_crc32c_final into free-space-cache.c Josef Bacik
2023-08-23 14:25   ` Anand Jain
2023-08-28 10:56   ` Johannes Thumshirn
2023-08-23 13:51 ` [PATCH 02/11] btrfs: remove btrfs_crc32c wrapper Josef Bacik
2023-08-23 14:26   ` Anand Jain
2023-08-28 10:58   ` Johannes Thumshirn
2023-08-23 13:51 ` [PATCH 03/11] btrfs: move btrfs_extref_hash into inode-item.h Josef Bacik
2023-08-23 14:29   ` Anand Jain
2023-08-28 10:59   ` Johannes Thumshirn
2023-08-23 13:51 ` Josef Bacik [this message]
2023-08-23 14:34   ` [PATCH 04/11] btrfs: move btrfs_name_hash to dir-item.h Anand Jain
2023-08-28 11:00   ` Johannes Thumshirn
2023-08-23 13:51 ` [PATCH 05/11] btrfs: include asm/unaligned.h in accessors.h Josef Bacik
2023-08-28 11:04   ` Johannes Thumshirn
2023-08-23 13:51 ` [PATCH 06/11] btrfs: include linux/crc32c in dir-item and inode-item Josef Bacik
2023-08-23 14:43   ` Anand Jain
2023-08-23 13:51 ` [PATCH 07/11] btrfs: include linux/iomap.h in file.c Josef Bacik
2023-08-28 11:05   ` Johannes Thumshirn
2023-08-23 13:51 ` [PATCH 08/11] btrfs: add fscrypt related dependencies to respective headers Josef Bacik
2023-08-28 11:06   ` Johannes Thumshirn
2023-08-23 13:51 ` [PATCH 09/11] btrfs: add btrfs_delayed_ref_head declaration to extent-tree.h Josef Bacik
2023-08-28 11:06   ` Johannes Thumshirn
2023-08-23 13:51 ` [PATCH 10/11] btrfs: include trace header in where necessary Josef Bacik
2023-08-28 11:07   ` Johannes Thumshirn
2023-08-23 13:51 ` [PATCH 11/11] btrfs: remove extraneous includes from ctree.h Josef Bacik
2023-08-25 14:21   ` kernel test robot
2023-08-28 11:08     ` Johannes Thumshirn
2023-08-28 13:29       ` Josef Bacik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0739f7926fe01f0861a0f69da55f080fd7f464e4.1692798556.git.josef@toxicpanda.com \
    --to=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).