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>
This commit is contained in:
Josef Bacik 2022-10-26 15:08:37 -04:00 committed by David Sterba
parent 77407dc032
commit 5c11adcc38
6 changed files with 32 additions and 22 deletions

View File

@ -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);

View File

@ -67,6 +67,7 @@
#include "file.h"
#include "acl.h"
#include "relocation.h"
#include "verity.h"
struct btrfs_iget_args {
u64 ino;

View File

@ -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

View File

@ -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>

View File

@ -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.

28
fs/btrfs/verity.h Normal file
View File

@ -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