diff options
author | Josef Bacik <josef@toxicpanda.com> | 2022-10-26 15:08:37 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-12-05 18:00:47 +0100 |
commit | 5c11adcc383a94cacd652461c9435bf7a5c53c9c (patch) | |
tree | 15747ede6f5fa06b37b71b368db1bef7bf17d028 | |
parent | 77407dc032e29f205a1e3922564c0abfd2e23d15 (diff) |
btrfs: move verity prototypes into verity.h
Move these out of ctree.h into verity.h to cut down on code in ctree.h.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/ctree.h | 22 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 1 | ||||
-rw-r--r-- | fs/btrfs/send.c | 1 | ||||
-rw-r--r-- | fs/btrfs/super.c | 1 | ||||
-rw-r--r-- | fs/btrfs/verity.c | 1 | ||||
-rw-r--r-- | fs/btrfs/verity.h | 28 |
6 files changed, 32 insertions, 22 deletions
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 d8856e621e01..0fda1c5ba28e 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 e9b7deccc5fe..3befc0d2d866 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..91c10f7d0a46 --- /dev/null +++ b/fs/btrfs/verity.h @@ -0,0 +1,28 @@ +/* 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 + +#endif |