Re: [PATCH 2/2] fs: fix dentry_lru_prune()

2013-03-09 Thread Dave Chinner
On Fri, Mar 08, 2013 at 02:40:46PM +0800, Yan, Zheng wrote: > On 03/08/2013 02:27 PM, Dave Chinner wrote: > > On Fri, Mar 08, 2013 at 10:43:00AM +0800, Yan, Zheng wrote: > >> On 03/08/2013 10:04 AM, Dave Chinner wrote: > >>> On Thu, Mar 07, 2013 at 07:37:36PM +0800, Yan, Zheng wrote: > From: "

[PATCH 0/8] libceph: miscellaneous cleanups

2013-03-09 Thread Alex Elder
This series contains a bunch of small cleanups. All of them I've created while working on other things, and most of them were done in order to allow upcoming work to be easier, or easier to understand. I've moved them all to the front of my stack of patches and now I'm posting them as a set for r

[PATCH 1/8] libceph: define CEPH_MSG_MAX_MIDDLE_LEN

2013-03-09 Thread Alex Elder
This is probably unnecessary but the code read as if it were wrong in read_partial_message(). Signed-off-by: Alex Elder --- include/linux/ceph/libceph.h |1 + net/ceph/messenger.c |2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/ceph/libceph.h b/

[PATCH 2/8] libceph: minor byte order problems in

2013-03-09 Thread Alex Elder
Some values printed are not (necessarily) in CPU order. We already have a copy of the converted versions, so use them. Signed-off-by: Alex Elder --- net/ceph/messenger.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index b8d0

[PATCH 3/8] libceph: change type of ceph_tcp_sendpage() "more"

2013-03-09 Thread Alex Elder
Change the type of the "more" parameter from int to bool. Signed-off-by: Alex Elder --- net/ceph/messenger.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index d9ace97..962b2cd 100644 --- a/net/ceph/messenger.c +++ b/net

[PATCH 4/8] libceph: kill args in read_partial_message_bio()

2013-03-09 Thread Alex Elder
There is only one caller for read_partial_message_bio(), and it always passes &msg->bio_iter and &bio_seg as the second and third arguments. Furthermore, the message in question is always the connection's in_msg, and we can get that inside the called function. So drop those two parameters and use

[PATCH 5/8] libceph: define and use in_msg_pos_next()

2013-03-09 Thread Alex Elder
Define a new function in_msg_pos_next() to match out_msg_pos_next(), and use it in place of code at the end of read_partial_message_pages() and read_partial_message_bio(). Signed-off-by: Alex Elder --- net/ceph/messenger.c | 57 -- 1 file changed

[PATCH 6/8] libceph: advance pagelist with list_rotate_left()

2013-03-09 Thread Alex Elder
While processing an outgoing pagelist (either the data pagelist or trail) in a ceph message, the messenger cycles through each of the pages on the list. This is accomplished in out_msg_pos_next(), if the end of the first page on the list is reached, the first page is moved to the end of the list.

[PATCH 7/8] libceph: simplify new message initialization

2013-03-09 Thread Alex Elder
Rather than explicitly initializing many fields to 0, NULL, or false in a newly-allocated message, just use kzalloc() for allocating new messages. This will become a much more convenient way of doing things anyway for upcoming patches that abstract the data field. Signed-off-by: Alex Elder ---

[PATCH 8/8] libceph: record byte count not page count

2013-03-09 Thread Alex Elder
Record the byte count for an osd request rather than the page count. The number of pages can always be derived from the byte count (and alignment/offset) but the reverse is not true. Signed-off-by: Alex Elder --- drivers/block/rbd.c |2 +- fs/ceph/addr.c | 33 +

Re: [PATCH 0/8] libceph: miscellaneous cleanups

2013-03-09 Thread Alex Elder
On 03/09/2013 09:11 AM, Alex Elder wrote: > This series contains a bunch of small cleanups. All of > them I've created while working on other things, and most > of them were done in order to allow upcoming work to be > easier, or easier to understand. I've moved them all to > the front of my stac

[PATCH 0/7, v2] libceph: abstract message data information

2013-03-09 Thread Alex Elder
Over half of these have been reviewed already, but I'm re-posting them because I've rebased them to be on top of the series I just posted (that is, these are based on branch "review/wip-cleanup" or 60b789f libceph: record byte count not page count), and because I've added two more patches since the

[PATCH 1/7] libceph: isolate message page field manipulation

2013-03-09 Thread Alex Elder
Define a function ceph_msg_data_set_pages(), which more clearly abstracts the assignment page-related fields for data in a ceph message structure. Use this new function in the osd client and mds client. Ideally, these fields would never be set more than once (with BUG_ON() calls to guarantee that

[PATCH 2/7] libceph: set page info with byte length

2013-03-09 Thread Alex Elder
When setting page array information for message data, provide the byte length rather than the page count ceph_msg_data_set_pages(). Signed-off-by: Alex Elder --- fs/ceph/mds_client.c |2 +- include/linux/ceph/messenger.h |2 +- net/ceph/messenger.c |4 ++-- net/ce

[PATCH 3/7] libceph: isolate other message data fields

2013-03-09 Thread Alex Elder
Define ceph_msg_data_set_pagelist(), ceph_msg_data_set_bio(), and ceph_msg_data_set_trail() to clearly abstract the assignment the remaining data-related fields in a ceph message structure. Use the new functions in the osd client and mds client. This partially resolves: http://tracker.ceph.co

[PATCH 4/7] ceph: only set message data pointers if non-empty

2013-03-09 Thread Alex Elder
Change it so we only assign outgoing data information for messages if there is outgoing data to send. This then allows us to add a few more (currently commented-out) assertions. This is related to: http://tracker.ceph.com/issues/4284 Signed-off-by: Alex Elder Reviewed-by: Greg Farnum ---

[PATCH 5/7] libceph: record message data byte length

2013-03-09 Thread Alex Elder
Record the number of bytes of data in a page array rather than the number of pages in the array. It can be assumed that the page array is of sufficient size to hold the number of bytes indicated (and offset by the indicated alignment). Signed-off-by: Alex Elder --- include/linux/ceph/messenger.

[PATCH 6/7] libceph: set response data fields earlier

2013-03-09 Thread Alex Elder
When an incoming message is destined for the osd client, the messenger calls the osd client's alloc_msg method. That function looks up which request has the tid matching the incoming message, and returns the request message that was preallocated to receive the response. The response message is th

[PATCH 7/7] libceph: activate message data assignment checks

2013-03-09 Thread Alex Elder
The mds client no longer tries to assign zero-length message data, and the osd client no longer sets its data info more than once. This allows us to activate assertions in the messenger to verify these things never happen. This resolves both of these: http://tracker.ceph.com/issues/4263 ht

Re: [PATCH 0/7, v2] libceph: abstract message data information

2013-03-09 Thread Alex Elder
On 03/09/2013 10:00 AM, Alex Elder wrote: > Over half of these have been reviewed already, but I'm re-posting > them because I've rebased them to be on top of the series I just > posted (that is, these are based on branch "review/wip-cleanup" > or 60b789f libceph: record byte count not page count),

[PATCH] libceph: don't clear bio_iter in prepare_write_message()

2013-03-09 Thread Alex Elder
This patch is available in the branch "review/wip-msgr-refactor" (prior to 6 other patches) in the ceph-client git repository. That branch is based on branch "review/wip-abstract-2". -Alex At one time it was necessary to clear a message's bio_iter field to

[PATCH 0/6] libceph: refactor messenger for multiple data sources

2013-03-09 Thread Alex Elder
This series factors out blocks of common code and generally aims to simplify and make more consistent the way the ceph messenger processes the data portions of both incoming and outgoing messages. They can be found in the "review/wip-msgr-refactor" branch of the ceph-client git repository. (That

[PATCH 1/6] libceph: use local variables for message positions

2013-03-09 Thread Alex Elder
There are several places where a message's out_msg_pos or in_msg_pos field is used repeatedly within a function. Use a local pointer variable for this purpose to unclutter the code. This and the upcoming cleanup patches are related to: http://tracker.ceph.com/issues/4403 Signed-off-by: Alex

[PATCH 2/6] libceph: consolidate message prep code

2013-03-09 Thread Alex Elder
In prepare_write_message_data(), various fields are initialized in preparation for writing message data out. Meanwhile, in read_partial_message(), there is essentially the same block of code, operating on message variables associated with an incoming message. Generalize prepare_write_message_data

[PATCH 3/6] libceph: small write_partial_msg_pages() refactor

2013-03-09 Thread Alex Elder
Define local variables page_offset and length to represent the range of bytes within a page that will be sent by ceph_tcp_sendpage() in write_partial_msg_pages(). Signed-off-by: Alex Elder --- net/ceph/messenger.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --

[PATCH 4/6] libceph: encapsulate reading message data

2013-03-09 Thread Alex Elder
Pull the code that reads the data portion into a message into a separate function read_partial_msg_data(). Rename write_partial_msg_pages() to be write_partial_message_data() to match its read counterpart, and to reflect its more generic purpose. Signed-off-by: Alex Elder --- net/ceph/messenger

[PATCH 5/6] libceph: define and use ceph_tcp_recvpage()

2013-03-09 Thread Alex Elder
Define a new function ceph_tcp_recvpage() that behaves in a way comparable to ceph_tcp_sendpage(). Rearrange the code in both read_partial_message_pages() and read_partial_message_bio() so they have matching structure, (similar to what's in write_partial_msg_pages()), and use this new function. S

[PATCH 6/6] libceph: define and use ceph_crc32c_page()

2013-03-09 Thread Alex Elder
Factor out a common block of code that updates a CRC calculation over a range of data in a page. This and the preceding patches are related to: http://tracker.ceph.com/issues/4403 Signed-off-by: Alex Elder --- net/ceph/messenger.c | 47 --- 1 fi

[PATCH 4/6, v2] libceph: encapsulate reading message data

2013-03-09 Thread Alex Elder
The previously posted edition of this patch erroneously moved the initialization of the message position information so it happened every time the message was read rather than just when the message was first initialized. This one no longer does that. Pull the code that reads the data portion into