Skip to contentSkip to conversation

gfs2: Replace list_prepare_entry() with list_entry()

PATCH New Andreas Gruenbacher 1 participant 1 message Apr 6, 2022 GFS2 file system

lore
Share & tools
lore

Andreas Gruenbacher

author maintainer
#0 lore raw

PATCH 1/1 gfs2: Replace list_prepare_entry() with list_entry()

In gfs2_before_commit(), use list_entry() instead of list_prepare_entry() for letting the iterator variables point at the list head.

---
 fs/gfs2/lops.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
fs/gfs2/lops.c +3 -2
index 6ba51cbb94cf..9816d9330456 100644
@@ -653,7 +653,7 @@ static void gfs2_before_commit(struct gfs2_sbd *sdp, unsigned int limit,
 				bool is_databuf)
 {
 	struct gfs2_log_descriptor *ld;
-	struct gfs2_bufdata *bd1 = NULL, *bd2;
+	struct gfs2_bufdata *bd1, *bd2;
 	struct page *page;
 	unsigned int num;
 	unsigned n;
@@ -661,7 +661,8 @@ static void gfs2_before_commit(struct gfs2_sbd *sdp, unsigned int limit,
 
 	gfs2_log_lock(sdp);
 	list_sort(NULL, blist, blocknr_cmp);
-	bd1 = bd2 = list_prepare_entry(bd1, blist, bd_list);
+	/* bd1 and bd2 initially point at the list head */
+	bd1 = bd2 = list_entry(blist, struct gfs2_bufdata, bd_list);
 	while(total) {
 		num = total;
 		if (total > limit)
Signature · 1 line
2.35.1