Patch "bcache: add code comments for bch_btree_node_get() and __bch_btree_node_alloc()" has been added to the 4.19-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 4.19-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-4.19 subdirectory.

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



commit 27c7a84f57e490d95afb18622b8eff50655240e7
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 3518088d7ff1e..de1eb7961fe61 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -1008,6 +1008,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,
@@ -1120,6 +1123,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