All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: [PATCH 22/26] btrfs: move verity prototypes into verity.h
Date: Wed, 26 Oct 2022 15:08:37 -0400	[thread overview]
Message-ID: <13e4b83f430478460fcee9eb6e4ab160346fb0d5.1666811039.git.josef@toxicpanda.com> (raw)
In-Reply-To: <cover.1666811038.git.josef@toxicpanda.com>

Move these out of ctree.h into verity.h to cut down on code in ctree.h.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/ctree.h  | 22 ----------------------
 fs/btrfs/inode.c  |  1 +
 fs/btrfs/send.c   |  1 +
 fs/btrfs/super.c  |  1 +
 fs/btrfs/verity.c |  1 +
 fs/btrfs/verity.h | 27 +++++++++++++++++++++++++++
 6 files changed, 31 insertions(+), 22 deletions(-)
 create mode 100644 fs/btrfs/verity.h

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 84bc33ff003f..15bb90536460 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -741,28 +741,6 @@ static inline int is_fstree(u64 rootid)
 	return 0;
 }
 
-/* verity.c */
-#ifdef CONFIG_FS_VERITY
-
-extern const struct fsverity_operations btrfs_verityops;
-int btrfs_drop_verity_items(struct btrfs_inode *inode);
-int btrfs_get_verity_descriptor(struct inode *inode, void *buf, size_t buf_size);
-
-#else
-
-static inline int btrfs_drop_verity_items(struct btrfs_inode *inode)
-{
-	return 0;
-}
-
-static inline int btrfs_get_verity_descriptor(struct inode *inode, void *buf,
-					      size_t buf_size)
-{
-	return -EPERM;
-}
-
-#endif
-
 /* Sanity test specific functions */
 #ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
 void btrfs_test_destroy_inode(struct inode *inode);
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index fd733fc3c583..6a172ccd7847 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -67,6 +67,7 @@
 #include "file.h"
 #include "acl.h"
 #include "relocation.h"
+#include "verity.h"
 
 struct btrfs_iget_args {
 	u64 ino;
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 1ee8149c0440..50063ac83830 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -31,6 +31,7 @@
 #include "dir-item.h"
 #include "file-item.h"
 #include "ioctl.h"
+#include "verity.h"
 
 /*
  * Maximum number of references an extent can have in order for us to attempt to
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 4bfda9be4556..ae49bdf71d32 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -56,6 +56,7 @@
 #include "dir-item.h"
 #include "ioctl.h"
 #include "scrub.h"
+#include "verity.h"
 #define CREATE_TRACE_POINTS
 #include <trace/events/btrfs.h>
 
diff --git a/fs/btrfs/verity.c b/fs/btrfs/verity.c
index 00ba5143a17d..b31d6c7627ff 100644
--- a/fs/btrfs/verity.c
+++ b/fs/btrfs/verity.c
@@ -19,6 +19,7 @@
 #include "fs.h"
 #include "accessors.h"
 #include "ioctl.h"
+#include "verity.h"
 
 /*
  * Implementation of the interface defined in struct fsverity_operations.
diff --git a/fs/btrfs/verity.h b/fs/btrfs/verity.h
new file mode 100644
index 000000000000..960ce3556b33
--- /dev/null
+++ b/fs/btrfs/verity.h
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#ifndef BTRFS_VERITY_H
+#define BTRFS_VERITY_H
+
+#ifdef CONFIG_FS_VERITY
+
+extern const struct fsverity_operations btrfs_verityops;
+int btrfs_drop_verity_items(struct btrfs_inode *inode);
+int btrfs_get_verity_descriptor(struct inode *inode, void *buf, size_t buf_size);
+
+#else
+
+static inline int btrfs_drop_verity_items(struct btrfs_inode *inode)
+{
+	return 0;
+}
+
+static inline int btrfs_get_verity_descriptor(struct inode *inode, void *buf,
+					      size_t buf_size)
+{
+	return -EPERM;
+}
+
+#endif /* CONFIG_FS_VERITY */
+
+#endif /* BTRFS_VERITY_H */
-- 
2.26.3


  parent reply	other threads:[~2022-10-26 19:12 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 19:08 [PATCH 00/26] btrfs: final ctree.h cleanups Josef Bacik
2022-10-26 19:08 ` [PATCH 01/26] btrfs: convert discard stat defs to enum Josef Bacik
2022-10-27  6:43   ` Johannes Thumshirn
2022-10-26 19:08 ` [PATCH 02/26] btrfs: move btrfs_chunk_item_size out of ctree.h Josef Bacik
2022-10-27  6:43   ` Johannes Thumshirn
2022-10-27 13:40     ` David Sterba
2022-10-26 19:08 ` [PATCH 03/26] btrfs: add dependencies to fs.h and block-rsv.h Josef Bacik
2022-10-27  6:45   ` Johannes Thumshirn
2022-10-26 19:08 ` [PATCH 04/26] btrfs: add blk_types.h include to compression.h Josef Bacik
2022-10-27  6:45   ` Johannes Thumshirn
2022-10-26 19:08 ` [PATCH 05/26] btrfs: move the printk and assert helpers to messages.c Josef Bacik
2022-10-28  5:22   ` Anand Jain
2022-10-28 19:37     ` David Sterba
2022-10-31  7:51       ` Anand Jain
2022-10-26 19:08 ` [PATCH 06/26] btrfs: move inode prototypes to btrfs_inode.h Josef Bacik
2022-10-27  6:54   ` Johannes Thumshirn
2022-10-26 19:08 ` [PATCH 07/26] btrfs: rename tree-defrag.c to defrag.c Josef Bacik
2022-10-27  6:55   ` Johannes Thumshirn
2022-10-26 19:08 ` [PATCH 08/26] btrfs: move the auto defrag code " Josef Bacik
2022-10-28  5:30   ` Anand Jain
2022-10-26 19:08 ` [PATCH 09/26] btrfs: move the file defrag code into defrag.c Josef Bacik
2022-10-28  5:28   ` Anand Jain
2022-10-26 19:08 ` [PATCH 10/26] btrfs: move defrag related prototypes to their own header Josef Bacik
2022-10-27  7:17   ` Johannes Thumshirn
2022-10-26 19:08 ` [PATCH 11/26] btrfs: move dir-item prototypes into dir-item.h Josef Bacik
2022-10-27  7:17   ` Johannes Thumshirn
2022-10-26 19:08 ` [PATCH 12/26] btrfs: move file-item prototypes into their own header Josef Bacik
2022-10-27  7:35   ` Johannes Thumshirn
2022-10-26 19:08 ` [PATCH 13/26] btrfs: move uuid tree prototypes to uuid-tree.h Josef Bacik
2022-10-27  9:41   ` Johannes Thumshirn
2022-10-26 19:08 ` [PATCH 14/26] btrfs: move ioctl prototypes into ioctl.h Josef Bacik
2022-10-27  9:42   ` Johannes Thumshirn
2022-10-26 19:08 ` [PATCH 15/26] btrfs: move file prototypes to file.h Josef Bacik
2022-10-27 10:04   ` Johannes Thumshirn
2022-10-26 19:08 ` [PATCH 16/26] btrfs: move the 32bit warn defines into messages.h Josef Bacik
2022-10-27 10:08   ` Johannes Thumshirn
2022-10-26 19:08 ` [PATCH 17/26] btrfs: move the snapshot drop related prototypes to extent-tree.h Josef Bacik
2022-10-27 10:10   ` Johannes Thumshirn
2022-10-26 19:08 ` [PATCH 18/26] btrfs: move acl prototypes into acl.h Josef Bacik
2022-10-27 10:10   ` Johannes Thumshirn
2022-10-26 19:08 ` [PATCH 19/26] btrfs: move relocation prototypes into relocation.h Josef Bacik
2022-10-27 10:18   ` Johannes Thumshirn
2022-10-26 19:08 ` [PATCH 20/26] btrfs: move scrub prototypes into scrub.h Josef Bacik
2022-10-27 10:18   ` Johannes Thumshirn
2022-10-26 19:08 ` [PATCH 21/26] btrfs: move dev-replace prototypes into dev-replace.h Josef Bacik
2022-10-27 10:19   ` Johannes Thumshirn
2022-10-26 19:08 ` Josef Bacik [this message]
2022-10-27 10:19   ` [PATCH 22/26] btrfs: move verity prototypes into verity.h Johannes Thumshirn
2022-10-26 19:08 ` [PATCH 23/26] btrfs: move CONFIG_BTRFS_FS_RUN_SANITY_TESTS checks to fs.h Josef Bacik
2022-10-27 10:20   ` Johannes Thumshirn
2022-10-26 19:08 ` [PATCH 24/26] btrfs: move super prototypes into super.h Josef Bacik
2022-10-27 10:20   ` Johannes Thumshirn
2022-10-26 19:08 ` [PATCH 25/26] btrfs: move super_block specific helpers " Josef Bacik
2022-10-27 10:21   ` Johannes Thumshirn
2022-10-26 19:08 ` [PATCH 26/26] btrfs: move orphan prototypes into orphan.h Josef Bacik
2022-10-26 20:52   ` kernel test robot
2022-10-27 14:02     ` David Sterba
2022-10-27 11:32   ` kernel test robot

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=13e4b83f430478460fcee9eb6e4ab160346fb0d5.1666811039.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 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.