From: Alex Elder <elder@inktank.com>
To: "ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>
Subject: [PATCH 6/9] ceph: define ceph_writepages_osd_request()
Date: Thu, 04 Apr 2013 11:19:37 -0500 [thread overview]
Message-ID: <515DA819.4080204@inktank.com> (raw)
In-Reply-To: <515DA755.2090504@inktank.com>
Mostly for readability, define ceph_writepages_osd_request() and
use it to allocate the osd request for ceph_writepages_start().
Signed-off-by: Alex Elder <elder@inktank.com>
---
fs/ceph/addr.c | 34 ++++++++++++++++++++++++----------
1 file changed, 24 insertions(+), 10 deletions(-)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index de7aac0..5b4ac17 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -654,6 +654,26 @@ static void alloc_page_vec(struct ceph_fs_client *fsc,
}
}
+static struct ceph_osd_request *
+ceph_writepages_osd_request(struct inode *inode, u64 offset, u64 *len,
+ struct ceph_snap_context *snapc,
+ int num_ops, struct ceph_osd_req_op *ops)
+{
+ struct ceph_fs_client *fsc;
+ struct ceph_inode_info *ci;
+ struct ceph_vino vino;
+
+ fsc = ceph_inode_to_client(inode);
+ ci = ceph_inode(inode);
+ vino = ceph_vino(inode);
+ /* BUG_ON(vino.snap != CEPH_NOSNAP); */
+
+ return ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout,
+ vino, offset, len, num_ops, ops, CEPH_OSD_OP_WRITE,
+ CEPH_OSD_FLAG_WRITE|CEPH_OSD_FLAG_ONDISK,
+ snapc, ci->i_truncate_seq, ci->i_truncate_size, true);
+}
+
/*
* initiate async writeback
*/
@@ -835,16 +855,9 @@ get_more_pages:
/* prepare async write request */
offset = (u64) page_offset(page);
len = wsize;
- vino = ceph_vino(inode);
- /* BUG_ON(vino.snap != CEPH_NOSNAP); */
- req = ceph_osdc_new_request(&fsc->client->osdc,
- &ci->i_layout, vino, offset, &len,
- num_ops, ops,
- CEPH_OSD_OP_WRITE,
- CEPH_OSD_FLAG_WRITE |
- CEPH_OSD_FLAG_ONDISK,
- snapc, ci->i_truncate_seq,
- ci->i_truncate_size, true);
+ req = ceph_writepages_osd_request(inode,
+ offset, &len, snapc,
+ num_ops, ops);
if (IS_ERR(req)) {
rc = PTR_ERR(req);
@@ -852,6 +865,7 @@ get_more_pages:
break;
}
+ vino = ceph_vino(inode);
ceph_osdc_build_request(req, offset,
num_ops, ops, snapc, vino.snap,
&inode->i_mtime);
--
1.7.9.5
next prev parent reply other threads:[~2013-04-04 16:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-04 16:16 [PATCH 0/9] Alex Elder
2013-04-04 16:18 ` [PATCH 1/9] ceph: use page_offset() in ceph_writepages_start() Alex Elder
2013-04-04 16:18 ` [PATCH 2/9] libceph: drop ceph_osd_request->r_con_filling_msg Alex Elder
2013-04-04 16:18 ` [PATCH 3/9] libceph: record length of bio list with bio Alex Elder
2013-04-04 16:19 ` [PATCH 4/9] libceph: record message data length Alex Elder
2013-04-04 18:34 ` [PATCH 4/9, v2] " Alex Elder
2013-04-04 16:19 ` [PATCH 5/9] libceph: don't build request in ceph_osdc_new_request() Alex Elder
2013-04-04 16:19 ` Alex Elder [this message]
2013-04-04 16:19 ` [PATCH 7/9] ceph: kill ceph alloc_page_vec() Alex Elder
2013-04-04 16:20 ` [PATCH 8/9] libceph: hold off building osd request Alex Elder
2013-04-04 16:20 ` [PATCH 9/9] ceph: build osd request message later for writepages Alex Elder
2013-04-05 3:03 ` [PATCH 0/9] Josh Durgin
2013-04-05 12:09 ` Alex Elder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=515DA819.4080204@inktank.com \
--to=elder@inktank.com \
--cc=ceph-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.