aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2011-05-04 23:56:51 -0400
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2011-05-10 09:21:56 -0400
commit0cc1283881d3fcc9011c713e067795ccec322ae7 (patch)
tree3d4c314f98b3fdcf2a7d2309e4dc468aa0d98ec4
parent293ce0ed8c2d22ff044e6e9fa7b1d4be425d189b (diff)
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: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-rw-r--r--fs/nilfs2/recovery.c12
-rw-r--r--fs/nilfs2/segment.c4
2 files changed, 8 insertions, 8 deletions
diff --git a/fs/nilfs2/recovery.c b/fs/nilfs2/recovery.c
index ba4a64518f38..a604ac0331b2 100644
--- a/fs/nilfs2/recovery.c
+++ b/fs/nilfs2/recovery.c
@@ -387,9 +387,9 @@ static int nilfs_scan_dsync_log(struct the_nilfs *nilfs, sector_t start_blocknr,
387static void dispose_recovery_list(struct list_head *head) 387static void dispose_recovery_list(struct list_head *head)
388{ 388{
389 while (!list_empty(head)) { 389 while (!list_empty(head)) {
390 struct nilfs_recovery_block *rb 390 struct nilfs_recovery_block *rb;
391 = list_entry(head->next, 391
392 struct nilfs_recovery_block, list); 392 rb = list_first_entry(head, struct nilfs_recovery_block, list);
393 list_del(&rb->list); 393 list_del(&rb->list);
394 kfree(rb); 394 kfree(rb);
395 } 395 }
@@ -416,9 +416,9 @@ static int nilfs_segment_list_add(struct list_head *head, __u64 segnum)
416void nilfs_dispose_segment_list(struct list_head *head) 416void nilfs_dispose_segment_list(struct list_head *head)
417{ 417{
418 while (!list_empty(head)) { 418 while (!list_empty(head)) {
419 struct nilfs_segment_entry *ent 419 struct nilfs_segment_entry *ent;
420 = list_entry(head->next, 420
421 struct nilfs_segment_entry, list); 421 ent = list_first_entry(head, struct nilfs_segment_entry, list);
422 list_del(&ent->list); 422 list_del(&ent->list);
423 kfree(ent); 423 kfree(ent);
424 } 424 }
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index 8a2b428b1838..186cabbe54d7 100644
--- a/fs/nilfs2/segment.c
+++ b/fs/nilfs2/segment.c
@@ -957,8 +957,8 @@ static int nilfs_segctor_apply_buffers(struct nilfs_sc_info *sci,
957 957
958 dispose_buffers: 958 dispose_buffers:
959 while (!list_empty(listp)) { 959 while (!list_empty(listp)) {
960 bh = list_entry(listp->next, struct buffer_head, 960 bh = list_first_entry(listp, struct buffer_head,
961 b_assoc_buffers); 961 b_assoc_buffers);
962 list_del_init(&bh->b_assoc_buffers); 962 list_del_init(&bh->b_assoc_buffers);
963 brelse(bh); 963 brelse(bh);
964 } 964 }