Commit 0cc12838 authored by Ryusuke Konishi's avatar Ryusuke Konishi

nilfs2: use list_first_entry

This uses list_first_entry macro instead of list_entry if it's used to
get the first entry.
Signed-off-by: default avatarRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
parent 293ce0ed
...@@ -387,9 +387,9 @@ static int nilfs_scan_dsync_log(struct the_nilfs *nilfs, sector_t start_blocknr, ...@@ -387,9 +387,9 @@ static int nilfs_scan_dsync_log(struct the_nilfs *nilfs, sector_t start_blocknr,
static void dispose_recovery_list(struct list_head *head) static void dispose_recovery_list(struct list_head *head)
{ {
while (!list_empty(head)) { while (!list_empty(head)) {
struct nilfs_recovery_block *rb struct nilfs_recovery_block *rb;
= list_entry(head->next,
struct nilfs_recovery_block, list); rb = list_first_entry(head, struct nilfs_recovery_block, list);
list_del(&rb->list); list_del(&rb->list);
kfree(rb); kfree(rb);
} }
...@@ -416,9 +416,9 @@ static int nilfs_segment_list_add(struct list_head *head, __u64 segnum) ...@@ -416,9 +416,9 @@ static int nilfs_segment_list_add(struct list_head *head, __u64 segnum)
void nilfs_dispose_segment_list(struct list_head *head) void nilfs_dispose_segment_list(struct list_head *head)
{ {
while (!list_empty(head)) { while (!list_empty(head)) {
struct nilfs_segment_entry *ent struct nilfs_segment_entry *ent;
= list_entry(head->next,
struct nilfs_segment_entry, list); ent = list_first_entry(head, struct nilfs_segment_entry, list);
list_del(&ent->list); list_del(&ent->list);
kfree(ent); kfree(ent);
} }
......
...@@ -957,8 +957,8 @@ static int nilfs_segctor_apply_buffers(struct nilfs_sc_info *sci, ...@@ -957,8 +957,8 @@ static int nilfs_segctor_apply_buffers(struct nilfs_sc_info *sci,
dispose_buffers: dispose_buffers:
while (!list_empty(listp)) { while (!list_empty(listp)) {
bh = list_entry(listp->next, struct buffer_head, bh = list_first_entry(listp, struct buffer_head,
b_assoc_buffers); b_assoc_buffers);
list_del_init(&bh->b_assoc_buffers); list_del_init(&bh->b_assoc_buffers);
brelse(bh); brelse(bh);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment