All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bcachefs: push cpuid variable down into bch2_inode_create()
@ 2023-01-25 16:43 Brian Foster
  0 siblings, 0 replies; only message in thread
From: Brian Foster @ 2023-01-25 16:43 UTC (permalink / raw)
  To: linux-bcachefs

From: root <root@fs-i40c-08.fs.lab.eng.bos.redhat.com>

The cpu id number only appears to be used by inode number sharding,
which is isolated to the inode create function. Push it down a function
to eliminate an unnecessary parameter.

Signed-off-by: Brian Foster <bfoster@redhat.com>
---

Just a small, random cleanup from roving around the code...

Brian

 fs/bcachefs/fs-common.c | 3 +--
 fs/bcachefs/inode.c     | 3 ++-
 fs/bcachefs/inode.h     | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/bcachefs/fs-common.c b/fs/bcachefs/fs-common.c
index 1f2e1fc4f6b2..abde0b5ea30e 100644
--- a/fs/bcachefs/fs-common.c
+++ b/fs/bcachefs/fs-common.c
@@ -32,7 +32,6 @@ int bch2_create_trans(struct btree_trans *trans,
 	struct btree_iter inode_iter = { NULL };
 	subvol_inum new_inum = dir;
 	u64 now = bch2_current_time(c);
-	u64 cpu = raw_smp_processor_id();
 	u64 dir_target;
 	u32 snapshot;
 	unsigned dir_type = mode_to_type(mode);
@@ -53,7 +52,7 @@ int bch2_create_trans(struct btree_trans *trans,
 		if (flags & BCH_CREATE_TMPFILE)
 			new_inode->bi_flags |= BCH_INODE_UNLINKED;
 
-		ret = bch2_inode_create(trans, &inode_iter, new_inode, snapshot, cpu);
+		ret = bch2_inode_create(trans, &inode_iter, new_inode, snapshot);
 		if (ret)
 			goto err;
 
diff --git a/fs/bcachefs/inode.c b/fs/bcachefs/inode.c
index 560545a7ea03..9b3df4256219 100644
--- a/fs/bcachefs/inode.c
+++ b/fs/bcachefs/inode.c
@@ -628,13 +628,14 @@ static inline u32 bkey_generation(struct bkey_s_c k)
 int bch2_inode_create(struct btree_trans *trans,
 		      struct btree_iter *iter,
 		      struct bch_inode_unpacked *inode_u,
-		      u32 snapshot, u64 cpu)
+		      u32 snapshot)
 {
 	struct bch_fs *c = trans->c;
 	struct bkey_s_c k;
 	u64 min, max, start, pos, *hint;
 	int ret = 0;
 	unsigned bits = (c->opts.inodes_32bit ? 31 : 63);
+	u64 cpu = raw_smp_processor_id();
 
 	if (c->opts.shard_inode_numbers) {
 		bits -= c->inode_shard_bits;
diff --git a/fs/bcachefs/inode.h b/fs/bcachefs/inode.h
index f5066afb4886..86cb32503a23 100644
--- a/fs/bcachefs/inode.h
+++ b/fs/bcachefs/inode.h
@@ -101,7 +101,7 @@ void bch2_inode_init(struct bch_fs *, struct bch_inode_unpacked *,
 		     struct bch_inode_unpacked *);
 
 int bch2_inode_create(struct btree_trans *, struct btree_iter *,
-		      struct bch_inode_unpacked *, u32, u64);
+		      struct bch_inode_unpacked *, u32);
 
 int bch2_inode_rm(struct bch_fs *, subvol_inum);
 
-- 
2.39.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-25 16:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-25 16:43 [PATCH] bcachefs: push cpuid variable down into bch2_inode_create() Brian Foster

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.