From 6aeb32117945ae2ab3d9d6299325db013bff9283 Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Mon, 26 Jun 2006 00:24:40 -0700 Subject: [PATCH] --- yaml --- r: 30183 b: refs/heads/master c: 1bfba4e8ea0e555e3a0296051517d96253660ccc h: refs/heads/master i: 30181: 5eec5207bde6358bcdc6d285576600e88d63af16 30179: e020ff93508aadc6f3727f715f5f7a88a5938afb 30175: 21c38ba34b697e4322c90f0ec175e2b9372409ca v: v3 --- [refs] | 2 +- trunk/drivers/base/power/resume.c | 6 ++---- trunk/drivers/base/power/suspend.c | 13 +++++-------- trunk/fs/dcache.c | 3 +-- trunk/fs/libfs.c | 10 ++++------ trunk/fs/namespace.c | 6 ++---- trunk/fs/pnode.c | 9 +++------ trunk/fs/sysfs/dir.c | 10 ++++------ trunk/mm/swap.c | 3 +-- 9 files changed, 23 insertions(+), 39 deletions(-) diff --git a/[refs] b/[refs] index d00319322a68..15f99e9882c1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a7addcea6ac7c0e9733a48cda06ca0880f116a48 +refs/heads/master: 1bfba4e8ea0e555e3a0296051517d96253660ccc diff --git a/trunk/drivers/base/power/resume.c b/trunk/drivers/base/power/resume.c index 520679ce53a8..826093ef4c7e 100644 --- a/trunk/drivers/base/power/resume.c +++ b/trunk/drivers/base/power/resume.c @@ -53,8 +53,7 @@ void dpm_resume(void) struct device * dev = to_device(entry); get_device(dev); - list_del_init(entry); - list_add_tail(entry, &dpm_active); + list_move_tail(entry, &dpm_active); up(&dpm_list_sem); if (!dev->power.prev_state.event) @@ -101,8 +100,7 @@ void dpm_power_up(void) struct device * dev = to_device(entry); get_device(dev); - list_del_init(entry); - list_add_tail(entry, &dpm_active); + list_move_tail(entry, &dpm_active); resume_device(dev); put_device(dev); } diff --git a/trunk/drivers/base/power/suspend.c b/trunk/drivers/base/power/suspend.c index 1a1fe43a3057..69509e02f703 100644 --- a/trunk/drivers/base/power/suspend.c +++ b/trunk/drivers/base/power/suspend.c @@ -116,12 +116,10 @@ int device_suspend(pm_message_t state) /* Check if the device got removed */ if (!list_empty(&dev->power.entry)) { /* Move it to the dpm_off or dpm_off_irq list */ - if (!error) { - list_del(&dev->power.entry); - list_add(&dev->power.entry, &dpm_off); - } else if (error == -EAGAIN) { - list_del(&dev->power.entry); - list_add(&dev->power.entry, &dpm_off_irq); + if (!error) + list_move(&dev->power.entry, &dpm_off); + else if (error == -EAGAIN) { + list_move(&dev->power.entry, &dpm_off_irq); error = 0; } } @@ -139,8 +137,7 @@ int device_suspend(pm_message_t state) */ while (!list_empty(&dpm_off_irq)) { struct list_head * entry = dpm_off_irq.next; - list_del(entry); - list_add(entry, &dpm_off); + list_move(entry, &dpm_off); } dpm_resume(); } diff --git a/trunk/fs/dcache.c b/trunk/fs/dcache.c index 6aa635fbfa0a..48b44a714b35 100644 --- a/trunk/fs/dcache.c +++ b/trunk/fs/dcache.c @@ -522,8 +522,7 @@ void shrink_dcache_sb(struct super_block * sb) dentry = list_entry(tmp, struct dentry, d_lru); if (dentry->d_sb != sb) continue; - list_del(tmp); - list_add(tmp, &dentry_unused); + list_move(tmp, &dentry_unused); } /* diff --git a/trunk/fs/libfs.c b/trunk/fs/libfs.c index fc785d8befb9..ac02ea602c3d 100644 --- a/trunk/fs/libfs.c +++ b/trunk/fs/libfs.c @@ -149,10 +149,9 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir) /* fallthrough */ default: spin_lock(&dcache_lock); - if (filp->f_pos == 2) { - list_del(q); - list_add(q, &dentry->d_subdirs); - } + if (filp->f_pos == 2) + list_move(q, &dentry->d_subdirs); + for (p=q->next; p != &dentry->d_subdirs; p=p->next) { struct dentry *next; next = list_entry(p, struct dentry, d_u.d_child); @@ -164,8 +163,7 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir) return 0; spin_lock(&dcache_lock); /* next is still alive */ - list_del(q); - list_add(q, p); + list_move(q, p); p = q; filp->f_pos++; } diff --git a/trunk/fs/namespace.c b/trunk/fs/namespace.c index 866430bb024d..b3ed212ea416 100644 --- a/trunk/fs/namespace.c +++ b/trunk/fs/namespace.c @@ -526,10 +526,8 @@ void umount_tree(struct vfsmount *mnt, int propagate, struct list_head *kill) { struct vfsmount *p; - for (p = mnt; p; p = next_mnt(p, mnt)) { - list_del(&p->mnt_hash); - list_add(&p->mnt_hash, kill); - } + for (p = mnt; p; p = next_mnt(p, mnt)) + list_move(&p->mnt_hash, kill); if (propagate) propagate_umount(kill); diff --git a/trunk/fs/pnode.c b/trunk/fs/pnode.c index 37b568ed0e05..da42ee61c1df 100644 --- a/trunk/fs/pnode.c +++ b/trunk/fs/pnode.c @@ -53,8 +53,7 @@ static int do_make_slave(struct vfsmount *mnt) if (master) { list_for_each_entry(slave_mnt, &mnt->mnt_slave_list, mnt_slave) slave_mnt->mnt_master = master; - list_del(&mnt->mnt_slave); - list_add(&mnt->mnt_slave, &master->mnt_slave_list); + list_move(&mnt->mnt_slave, &master->mnt_slave_list); list_splice(&mnt->mnt_slave_list, master->mnt_slave_list.prev); INIT_LIST_HEAD(&mnt->mnt_slave_list); } else { @@ -283,10 +282,8 @@ static void __propagate_umount(struct vfsmount *mnt) * umount the child only if the child has no * other children */ - if (child && list_empty(&child->mnt_mounts)) { - list_del(&child->mnt_hash); - list_add_tail(&child->mnt_hash, &mnt->mnt_hash); - } + if (child && list_empty(&child->mnt_mounts)) + list_move_tail(&child->mnt_hash, &mnt->mnt_hash); } } diff --git a/trunk/fs/sysfs/dir.c b/trunk/fs/sysfs/dir.c index 610b5bdbe75b..61c42430cba3 100644 --- a/trunk/fs/sysfs/dir.c +++ b/trunk/fs/sysfs/dir.c @@ -430,10 +430,9 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir) i++; /* fallthrough */ default: - if (filp->f_pos == 2) { - list_del(q); - list_add(q, &parent_sd->s_children); - } + if (filp->f_pos == 2) + list_move(q, &parent_sd->s_children); + for (p=q->next; p!= &parent_sd->s_children; p=p->next) { struct sysfs_dirent *next; const char * name; @@ -455,8 +454,7 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir) dt_type(next)) < 0) return 0; - list_del(q); - list_add(q, p); + list_move(q, p); p = q; filp->f_pos++; } diff --git a/trunk/mm/swap.c b/trunk/mm/swap.c index 03ae2076f92f..990868afc1c6 100644 --- a/trunk/mm/swap.c +++ b/trunk/mm/swap.c @@ -86,8 +86,7 @@ int rotate_reclaimable_page(struct page *page) zone = page_zone(page); spin_lock_irqsave(&zone->lru_lock, flags); if (PageLRU(page) && !PageActive(page)) { - list_del(&page->lru); - list_add_tail(&page->lru, &zone->inactive_list); + list_move_tail(&page->lru, &zone->inactive_list); inc_page_state(pgrotated); } if (!test_clear_page_writeback(page))