gfs2: Switch to list_{first,last}_entry
Replace open-coded versions of list_first_entry and list_last_entry with those functions. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
This commit is contained in:

committed by
Bob Peterson

szülő
40e7e86ef1
commit
969183bc68
@@ -2223,7 +2223,7 @@ void gfs2_free_journal_extents(struct gfs2_jdesc *jd)
|
||||
struct gfs2_journal_extent *jext;
|
||||
|
||||
while(!list_empty(&jd->extent_list)) {
|
||||
jext = list_entry(jd->extent_list.next, struct gfs2_journal_extent, list);
|
||||
jext = list_first_entry(&jd->extent_list, struct gfs2_journal_extent, list);
|
||||
list_del(&jext->list);
|
||||
kfree(jext);
|
||||
}
|
||||
@@ -2244,7 +2244,7 @@ static int gfs2_add_jextent(struct gfs2_jdesc *jd, u64 lblock, u64 dblock, u64 b
|
||||
struct gfs2_journal_extent *jext;
|
||||
|
||||
if (!list_empty(&jd->extent_list)) {
|
||||
jext = list_entry(jd->extent_list.prev, struct gfs2_journal_extent, list);
|
||||
jext = list_last_entry(&jd->extent_list, struct gfs2_journal_extent, list);
|
||||
if ((jext->dblock + jext->blocks) == dblock) {
|
||||
jext->blocks += blocks;
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user