From 45028bcb5f173e182937a8af26df7a74eb1c3442 Mon Sep 17 00:00:00 2001 From: Coly Li Date: Apr 13 2024 06:53:35 +0000 Subject: bcache: add code comments for bch_btree_node_get() and __bch_btree_node_alloc() (git-fixes). --- diff --git a/patches.suse/bcache-add-code-comments-for-bch_btree_node_get-and--31f5.patch b/patches.suse/bcache-add-code-comments-for-bch_btree_node_get-and--31f5.patch new file mode 100644 index 0000000..5bfd443 --- /dev/null +++ b/patches.suse/bcache-add-code-comments-for-bch_btree_node_get-and--31f5.patch @@ -0,0 +1,49 @@ +From 31f5b956a197d4ec25c8a07cb3a2ab69d0c0b82f Mon Sep 17 00:00:00 2001 +From: Coly Li +Date: Mon, 20 Nov 2023 13:25:02 +0800 +Subject: [PATCH] bcache: add code comments for bch_btree_node_get() and + __bch_btree_node_alloc() +Git-commit: 31f5b956a197d4ec25c8a07cb3a2ab69d0c0b82f +Patch-mainline: v6.7-rc3 +References: git-fixes + +This patch adds code comments to bch_btree_node_get() and +__bch_btree_node_alloc() that NULL pointer will not be returned and it +is unnecessary to check NULL pointer by the callers of these routines. + +Signed-off-by: Coly Li +Link: https://lore.kernel.org/r/20231120052503.6122-10-colyli@suse.de +Signed-off-by: Jens Axboe + +--- + drivers/md/bcache/btree.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c +index 79f1fa4a0d55..de3019972b35 100644 +--- a/drivers/md/bcache/btree.c ++++ b/drivers/md/bcache/btree.c +@@ -1000,6 +1000,9 @@ static struct btree *mca_alloc(struct cache_set *c, struct btree_op *op, + * + * The btree node will have either a read or a write lock held, depending on + * level and op->lock. ++ * ++ * Note: Only error code or btree pointer will be returned, it is unncessary ++ * for callers to check NULL pointer. + */ + struct btree *bch_btree_node_get(struct cache_set *c, struct btree_op *op, + struct bkey *k, int level, bool write, +@@ -1111,6 +1114,10 @@ static void btree_node_free(struct btree *b) + mutex_unlock(&b->c->bucket_lock); + } + ++/* ++ * Only error code or btree pointer will be returned, it is unncessary for ++ * callers to check NULL pointer. ++ */ + struct btree *__bch_btree_node_alloc(struct cache_set *c, struct btree_op *op, + int level, bool wait, + struct btree *parent) +-- +2.35.3 + diff --git a/series.conf b/series.conf index dabede2..b6232eb 100644 --- a/series.conf +++ b/series.conf @@ -44850,6 +44850,7 @@ patches.suse/bcache-fixup-lock-c-root-error-e348.patch patches.suse/bcache-fixup-multi-threaded-bch_sectors_dirty_init-w-2faa.patch patches.suse/bcache-replace-a-mistaken-IS_ERR-by-IS_ERR_OR_NULL-i-f72f.patch + patches.suse/bcache-add-code-comments-for-bch_btree_node_get-and--31f5.patch patches.suse/md-fix-bi_status-reporting-in-md_end_clone_io-45b4.patch patches.suse/s390-dasd-protect-device-queue-against-concurrent-access.patch patches.suse/nvmet-nul-terminate-the-NQNs-passed-in-the-connect-c.patch