diff mbox

[1/6] libceph: record bio length

Message ID 515F4F56.3000905@inktank.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alex Elder April 5, 2013, 10:25 p.m. UTC
The bio is the only data item type that doesn't record its full
length.  Fix that.

Signed-off-by: Alex Elder <elder@inktank.com>
---
 include/linux/ceph/messenger.h |    5 ++++-
 net/ceph/messenger.c           |    1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

 	msg->data_length = length;

Comments

Josh Durgin April 8, 2013, 11:58 p.m. UTC | #1
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>

On 04/05/2013 03:25 PM, Alex Elder wrote:
> The bio is the only data item type that doesn't record its full
> length.  Fix that.
>
> Signed-off-by: Alex Elder <elder@inktank.com>
> ---
>   include/linux/ceph/messenger.h |    5 ++++-
>   net/ceph/messenger.c           |    1 +
>   2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
> index cdeebae..4fb870a 100644
> --- a/include/linux/ceph/messenger.h
> +++ b/include/linux/ceph/messenger.h
> @@ -116,7 +116,10 @@ struct ceph_msg_data {
>   	enum ceph_msg_data_type		type;
>   	union {
>   #ifdef CONFIG_BLOCK
> -		struct bio		*bio;
> +		struct {
> +			struct bio	*bio;
> +			size_t		bio_length;
> +		};
>   #endif /* CONFIG_BLOCK */
>   		struct {
>   			struct page	**pages;	/* NOT OWNER. */
> diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
> index ae825e44..9571d03 100644
> --- a/net/ceph/messenger.c
> +++ b/net/ceph/messenger.c
> @@ -3030,6 +3030,7 @@ void ceph_msg_data_set_bio(struct ceph_msg *msg,
> struct bio *bio,
>   	data = ceph_msg_data_create(CEPH_MSG_DATA_BIO);
>   	BUG_ON(!data);
>   	data->bio = bio;
> +	data->bio_length = length;
>
>   	msg->data = data;
>   	msg->data_length = length;
>

--
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
diff mbox

Patch

diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index cdeebae..4fb870a 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -116,7 +116,10 @@  struct ceph_msg_data {
 	enum ceph_msg_data_type		type;
 	union {
 #ifdef CONFIG_BLOCK
-		struct bio		*bio;
+		struct {
+			struct bio	*bio;
+			size_t		bio_length;
+		};
 #endif /* CONFIG_BLOCK */
 		struct {
 			struct page	**pages;	/* NOT OWNER. */
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index ae825e44..9571d03 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -3030,6 +3030,7 @@  void ceph_msg_data_set_bio(struct ceph_msg *msg,
struct bio *bio,
 	data = ceph_msg_data_create(CEPH_MSG_DATA_BIO);
 	BUG_ON(!data);
 	data->bio = bio;
+	data->bio_length = length;

 	msg->data = data;