Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1272114 > unrolled thread

[PATCH 2/3] net/ceph: do not define list_entry_next

Started bySergey Senozhatsky <sergey.senozhatsky@gmail.com>
First post2015-11-18 13:20 +0100
Last post2015-11-18 14:30 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 2/3] net/ceph: do not define list_entry_next Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2015-11-18 13:20 +0100
    Re: [PATCH 2/3] net/ceph: do not define list_entry_next Ilya Dryomov <idryomov@gmail.com> - 2015-11-18 14:20 +0100
      Re: [PATCH 2/3] net/ceph: do not define list_entry_next Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2015-11-18 14:30 +0100

#1272114 — [PATCH 2/3] net/ceph: do not define list_entry_next

FromSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Date2015-11-18 13:20 +0100
Subject[PATCH 2/3] net/ceph: do not define list_entry_next
Message-ID<qw9Sq-2Jt-5@gated-at.bofh.it>
Cosmetic.

Do not define list_entry_next() and use list_next_entry()
from list.h.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
 net/ceph/messenger.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 9981039..77ccca9 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -10,6 +10,7 @@
 #include <linux/slab.h>
 #include <linux/socket.h>
 #include <linux/string.h>
+#include <linux/list.h>
 #ifdef	CONFIG_BLOCK
 #include <linux/bio.h>
 #endif	/* CONFIG_BLOCK */
@@ -23,9 +24,6 @@
 #include <linux/ceph/pagelist.h>
 #include <linux/export.h>
 
-#define list_entry_next(pos, member)					\
-	list_entry(pos->member.next, typeof(*pos), member)
-
 /*
  * Ceph uses the messenger to exchange ceph_msg messages with other
  * hosts in the system.  The messenger provides ordered and reliable
@@ -1042,7 +1040,7 @@ static bool ceph_msg_data_pagelist_advance(struct ceph_msg_data_cursor *cursor,
 	/* Move on to the next page */
 
 	BUG_ON(list_is_last(&cursor->page->lru, &pagelist->head));
-	cursor->page = list_entry_next(cursor->page, lru);
+	cursor->page = list_next_entry(cursor->page, lru);
 	cursor->last_piece = cursor->resid <= PAGE_SIZE;
 
 	return true;
@@ -1166,7 +1164,7 @@ static bool ceph_msg_data_advance(struct ceph_msg_data_cursor *cursor,
 	if (!cursor->resid && cursor->total_resid) {
 		WARN_ON(!cursor->last_piece);
 		BUG_ON(list_is_last(&cursor->data->links, cursor->data_head));
-		cursor->data = list_entry_next(cursor->data, links);
+		cursor->data = list_next_entry(cursor->data, links);
 		__ceph_msg_data_cursor_init(cursor);
 		new_piece = true;
 	}
-- 
2.6.2.280.g74301d6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1272138

FromIlya Dryomov <idryomov@gmail.com>
Date2015-11-18 14:20 +0100
Message-ID<qwaOu-3p0-7@gated-at.bofh.it>
In reply to#1272114
On Wed, Nov 18, 2015 at 1:13 PM, Sergey Senozhatsky
<sergey.senozhatsky@gmail.com> wrote:
> Cosmetic.
>
> Do not define list_entry_next() and use list_next_entry()
> from list.h.
>
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> ---
>  net/ceph/messenger.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
> index 9981039..77ccca9 100644
> --- a/net/ceph/messenger.c
> +++ b/net/ceph/messenger.c
> @@ -10,6 +10,7 @@
>  #include <linux/slab.h>
>  #include <linux/socket.h>
>  #include <linux/string.h>
> +#include <linux/list.h>
>  #ifdef CONFIG_BLOCK
>  #include <linux/bio.h>
>  #endif /* CONFIG_BLOCK */
> @@ -23,9 +24,6 @@
>  #include <linux/ceph/pagelist.h>
>  #include <linux/export.h>
>
> -#define list_entry_next(pos, member)                                   \
> -       list_entry(pos->member.next, typeof(*pos), member)
> -
>  /*
>   * Ceph uses the messenger to exchange ceph_msg messages with other
>   * hosts in the system.  The messenger provides ordered and reliable
> @@ -1042,7 +1040,7 @@ static bool ceph_msg_data_pagelist_advance(struct ceph_msg_data_cursor *cursor,
>         /* Move on to the next page */
>
>         BUG_ON(list_is_last(&cursor->page->lru, &pagelist->head));
> -       cursor->page = list_entry_next(cursor->page, lru);
> +       cursor->page = list_next_entry(cursor->page, lru);
>         cursor->last_piece = cursor->resid <= PAGE_SIZE;
>
>         return true;
> @@ -1166,7 +1164,7 @@ static bool ceph_msg_data_advance(struct ceph_msg_data_cursor *cursor,
>         if (!cursor->resid && cursor->total_resid) {
>                 WARN_ON(!cursor->last_piece);
>                 BUG_ON(list_is_last(&cursor->data->links, cursor->data_head));
> -               cursor->data = list_entry_next(cursor->data, links);
> +               cursor->data = list_next_entry(cursor->data, links);
>                 __ceph_msg_data_cursor_init(cursor);
>                 new_piece = true;
>         }

Someone beat you to it ;)

https://github.com/ceph/ceph-client/commit/76b4a27faebb369c1c50df01ef08b614a2854fc5

Thanks,

                Ilya
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1272149

FromSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Date2015-11-18 14:30 +0100
Message-ID<qwaYb-3sP-19@gated-at.bofh.it>
In reply to#1272138
On (11/18/15 14:13), Ilya Dryomov wrote:
[..]
> 
> Someone beat you to it ;)
> 
> https://github.com/ceph/ceph-client/commit/76b4a27faebb369c1c50df01ef08b614a2854fc5

Oh, OK then :) Thanks!

	-ss
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web