aboutsummaryrefslogtreecommitdiff
path: root/fs/bcachefs/inode.h
diff options
context:
space:
mode:
authorGravatar Kent Overstreet <kent.overstreet@gmail.com> 2019-10-02 18:35:36 -0400
committerGravatar Kent Overstreet <kent.overstreet@linux.dev> 2023-10-22 17:08:28 -0400
commit9638574229e3ae0175a46a63431149746c777b3a (patch)
tree01cd8a76741a838f2e3a99690ea661bca7c457a9 /fs/bcachefs/inode.h
parentbcachefs: Don't use sha256 for siphash str hash key (diff)
downloadlinux-9638574229e3ae0175a46a63431149746c777b3a.tar.gz
linux-9638574229e3ae0175a46a63431149746c777b3a.tar.bz2
linux-9638574229e3ae0175a46a63431149746c777b3a.zip
bcachefs: Factor out fs-common.c
This refactoring makes the code easier to understand by separating the bcachefs btree transactional code from the linux VFS code - but more importantly, it's also to share code with the fuse port. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/inode.h')
-rw-r--r--fs/bcachefs/inode.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/fs/bcachefs/inode.h b/fs/bcachefs/inode.h
index c5626c668639..b32c0a47c25d 100644
--- a/fs/bcachefs/inode.h
+++ b/fs/bcachefs/inode.h
@@ -51,14 +51,17 @@ struct btree_iter *bch2_inode_peek(struct btree_trans *,
int bch2_inode_write(struct btree_trans *, struct btree_iter *,
struct bch_inode_unpacked *);
+void bch2_inode_init_early(struct bch_fs *,
+ struct bch_inode_unpacked *);
+void bch2_inode_init_late(struct bch_inode_unpacked *, u64,
+ uid_t, gid_t, umode_t, dev_t,
+ struct bch_inode_unpacked *);
void bch2_inode_init(struct bch_fs *, struct bch_inode_unpacked *,
uid_t, gid_t, umode_t, dev_t,
struct bch_inode_unpacked *);
-int __bch2_inode_create(struct btree_trans *,
- struct bch_inode_unpacked *,
- u64, u64, u64 *);
-int bch2_inode_create(struct bch_fs *, struct bch_inode_unpacked *,
+int bch2_inode_create(struct btree_trans *,
+ struct bch_inode_unpacked *,
u64, u64, u64 *);
int bch2_inode_rm(struct bch_fs *, u64);
@@ -108,6 +111,11 @@ static inline u64 bch2_inode_opt_get(struct bch_inode_unpacked *inode,
}
}
+static inline u8 mode_to_type(umode_t mode)
+{
+ return (mode >> 12) & 15;
+}
+
/* i_nlink: */
static inline unsigned nlink_bias(umode_t mode)