[-next] ceph: use list_move instead of list_del/list_add
diff mbox

Message ID 1471079428-9951-1-git-send-email-weiyj.lk@gmail.com
State New
Headers show

Commit Message

Wei Yongjun Aug. 13, 2016, 9:10 a.m. UTC
Using list_move() instead of list_del() + list_add().

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
---
 fs/ceph/mds_client.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)




--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Ilya Dryomov Aug. 24, 2016, 1:41 p.m. UTC | #1
On Sat, Aug 13, 2016 at 11:10 AM, Wei Yongjun <weiyj.lk@gmail.com> wrote:
> Using list_move() instead of list_del() + list_add().
>
> Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
> ---
>  fs/ceph/mds_client.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index f72d4ae..d55df51 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -1150,8 +1150,7 @@ static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap,
>                 while (!list_empty(&ci->i_cap_flush_list)) {
>                         cf = list_first_entry(&ci->i_cap_flush_list,
>                                               struct ceph_cap_flush, i_list);
> -                       list_del(&cf->i_list);
> -                       list_add(&cf->i_list, &to_remove);
> +                       list_move(&cf->i_list, &to_remove);
>                 }
>
>                 spin_lock(&mdsc->cap_dirty_lock);

Applied.

Thanks,

                Ilya
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index f72d4ae..d55df51 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -1150,8 +1150,7 @@  static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap,
 		while (!list_empty(&ci->i_cap_flush_list)) {
 			cf = list_first_entry(&ci->i_cap_flush_list,
 					      struct ceph_cap_flush, i_list);
-			list_del(&cf->i_list);
-			list_add(&cf->i_list, &to_remove);
+			list_move(&cf->i_list, &to_remove);
 		}
 
 		spin_lock(&mdsc->cap_dirty_lock);