Patch "bcache: add code comments for bch_btree_node_get() and __bch_btree_node_alloc()" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    bcache: add code comments for bch_btree_node_get() and __bch_btree_node_alloc()

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     bcache-add-code-comments-for-bch_btree_node_get-and-.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 203d63eff2fd180577a9ad817811d5deb61915a6
Author: Coly Li <colyli@xxxxxxx>
Date:   Mon Nov 20 13:25:02 2023 +0800

    bcache: add code comments for bch_btree_node_get() and __bch_btree_node_alloc()
    
    [ Upstream commit 31f5b956a197d4ec25c8a07cb3a2ab69d0c0b82f ]
    
    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 <colyli@xxxxxxx>
    Link: https://lore.kernel.org/r/20231120052503.6122-10-colyli@xxxxxxx
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index c7878ba35f3cc..e22dfcf1ed6d8 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -974,6 +974,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,
@@ -1085,6 +1088,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)




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux