#
c99d2d4a |
| 05-Apr-2013 |
Alex Elder <elder@inktank.com> |
libceph: specify osd op by index in request
An osd request now holds all of its source op structures, and every place that initializes one of these is in fact initializing one of the entries in the
libceph: specify osd op by index in request
An osd request now holds all of its source op structures, and every place that initializes one of these is in fact initializing one of the entries in the the osd request's array.
So rather than supplying the address of the op to initialize, have caller specify the osd request and an indication of which op it would like to initialize. This better hides the details the op structure (and faciltates moving the data pointers they use).
Since osd_req_op_init() is a common routine, and it's not used outside the osd client code, give it static scope. Also make it return the address of the specified op (so all the other init routines don't have to repeat that code).
Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
#
8c042b0d |
| 03-Apr-2013 |
Alex Elder <elder@inktank.com> |
libceph: add data pointers in osd op structures
An extent type osd operation currently implies that there will be corresponding data supplied in the data portion of the request (for write) or respon
libceph: add data pointers in osd op structures
An extent type osd operation currently implies that there will be corresponding data supplied in the data portion of the request (for write) or response (for read) message. Similarly, an osd class method operation implies a data item will be supplied to receive the response data from the operation.
Add a ceph_osd_data pointer to each of those structures, and assign it to point to eithre the incoming or the outgoing data structure in the osd message. The data is not always available when an op is initially set up, so add two new functions to allow setting them after the op has been initialized.
Begin to make use of the data item pointer available in the osd operation rather than the request data in or out structure in places where it's convenient. Add some assertions to verify pointers are always set the way they're expected to be.
This is a sort of stepping stone toward really moving the data into the osd request ops, to allow for some validation before making that jump.
This is the first in a series of patches that resolve: http://tracker.ceph.com/issues/4657
Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
#
79528734 |
| 03-Apr-2013 |
Alex Elder <elder@inktank.com> |
libceph: keep source rather than message osd op array
An osd request keeps a pointer to the osd operations (ops) array that it builds in its request message.
In order to allow each op in the array
libceph: keep source rather than message osd op array
An osd request keeps a pointer to the osd operations (ops) array that it builds in its request message.
In order to allow each op in the array to have its own distinct data, we will need to keep track of each op's data, and that information does not go over the wire.
As long as we're tracking the data we might as well just track the entire (source) op definition for each of the ops. And if we're doing that, we'll have no more need to keep a pointer to the wire-encoded version.
This patch makes the array of source ops be kept with the osd request structure, and uses that instead of the version encoded in the message in places where that was previously used. The array will be embedded in the request structure, and the maximum number of ops we ever actually use is currently 2. So reduce CEPH_OSD_MAX_OP to 2 to reduce the size of the structure.
The result of doing this sort of ripples back up, and as a result various function parameters and local variables become unnecessary.
Make r_num_ops be unsigned, and move the definition of struct ceph_osd_req_op earlier to ensure it's defined where needed.
It does not yet add per-op data, that's coming soon.
This resolves: http://tracker.ceph.com/issues/4656
Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
#
87060c10 |
| 03-Apr-2013 |
Alex Elder <elder@inktank.com> |
libceph: a few more osd data cleanups
These are very small changes that make use osd_data local pointers as shorthands for structures being operated on.
Signed-off-by: Alex Elder <elder@inktank.com
libceph: a few more osd data cleanups
These are very small changes that make use osd_data local pointers as shorthands for structures being operated on.
Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
#
43bfe5de |
| 03-Apr-2013 |
Alex Elder <elder@inktank.com> |
libceph: define osd data initialization helpers
Define and use functions that encapsulate the initializion of a ceph_osd_data structure.
Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: J
libceph: define osd data initialization helpers
Define and use functions that encapsulate the initializion of a ceph_osd_data structure.
Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
Revision tags: v3.9-rc5, v3.9-rc4, v3.9-rc3 |
|
#
e5975c7c |
| 14-Mar-2013 |
Alex Elder <elder@inktank.com> |
ceph: build osd request message later for writepages
Hold off building the osd request message in ceph_writepages_start() until just before it will be submitted to the osd client for execution.
We'
ceph: build osd request message later for writepages
Hold off building the osd request message in ceph_writepages_start() until just before it will be submitted to the osd client for execution.
We'll still create the request and allocate the page pointer array after we learn we have at least one page to write. A local variable will be used to keep track of the allocated array of pages. Wait until just before submitting the request for assigning that page array pointer to the request message.
Create ands use a new function osd_req_op_extent_update() whose purpose is to serve this one spot where the length value supplied when an osd request's op was initially formatted might need to get changed (reduced, never increased) before submitting the request.
Previously, ceph_writepages_start() assigned the message header's data length because of this update. That's no longer necessary, because ceph_osdc_build_request() will recalculate the right value to use based on the content of the ops in the request.
Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
#
02ee07d3 |
| 14-Mar-2013 |
Alex Elder <elder@inktank.com> |
libceph: hold off building osd request
Defer building the osd request until just before submitting it in all callers except ceph_writepages_start(). (That caller will be handed in the next patch.)
libceph: hold off building osd request
Defer building the osd request until just before submitting it in all callers except ceph_writepages_start(). (That caller will be handed in the next patch.)
Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
#
88486957 |
| 14-Mar-2013 |
Alex Elder <elder@inktank.com> |
ceph: kill ceph alloc_page_vec()
There is a helper function alloc_page_vec() that, despite its generic sounding name depends heavily on an osd request structure being populated with certain informat
ceph: kill ceph alloc_page_vec()
There is a helper function alloc_page_vec() that, despite its generic sounding name depends heavily on an osd request structure being populated with certain information.
There is only one place this function is used, and it ends up being a bit simpler to just open code what it does, so get rid of the helper.
The real motivation for this is deferring building the of the osd request message, and this is a step in that direction.
Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
#
94fe8420 |
| 14-Mar-2013 |
Alex Elder <elder@inktank.com> |
ceph: define ceph_writepages_osd_request()
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
ceph: define ceph_writepages_osd_request()
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> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
#
acead002 |
| 14-Mar-2013 |
Alex Elder <elder@inktank.com> |
libceph: don't build request in ceph_osdc_new_request()
This patch moves the call to ceph_osdc_build_request() out of ceph_osdc_new_request() and into its caller.
This is in order to defer formatti
libceph: don't build request in ceph_osdc_new_request()
This patch moves the call to ceph_osdc_build_request() out of ceph_osdc_new_request() and into its caller.
This is in order to defer formatting osd operation information into the request message until just before request is started.
The only unusual (ab)user of ceph_osdc_build_request() is ceph_writepages_start(), where the final length of write request may change (downward) based on the current inode size or the oldest snapshot context with dirty data for the inode.
The remaining callers don't change anything in the request after has been built.
This means the ops array is now supplied by the caller. It also means there is no need to pass the mtime to ceph_osdc_new_request() (it gets provided to ceph_osdc_build_request()). And rather than passing a do_sync flag, have the number of ops in the ops array supplied imply adding a second STARTSYNC operation after the READ or WRITE requested.
This and some of the patches that follow are related to having the messenger (only) be responsible for filling the content of the message header, as described here: http://tracker.ceph.com/issues/4589
Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
#
25d71cb9 |
| 03-Apr-2013 |
Alex Elder <elder@inktank.com> |
ceph: use page_offset() in ceph_writepages_start()
There's one spot in ceph_writepages_start() that open-codes what page_offset() does safely. Use the macro so we don't have to worry about wrapping
ceph: use page_offset() in ceph_writepages_start()
There's one spot in ceph_writepages_start() that open-codes what page_offset() does safely. Use the macro so we don't have to worry about wrapping.
This resolves: http://tracker.ceph.com/issues/4648
Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
Revision tags: v3.9-rc2 |
|
#
e0c59487 |
| 07-Mar-2013 |
Alex Elder <elder@inktank.com> |
libceph: record byte count not page count
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) bu
libceph: record byte count not page count
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 <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
Revision tags: v3.9-rc1, v3.8 |
|
#
0fff87ec |
| 14-Feb-2013 |
Alex Elder <elder@inktank.com> |
libceph: separate read and write data
An osd request defines information about where data to be read should be placed as well as where data to write comes from. Currently these are represented by co
libceph: separate read and write data
An osd request defines information about where data to be read should be placed as well as where data to write comes from. Currently these are represented by common fields.
Keep information about data for writing separate from data to be read by splitting these into data_in and data_out fields.
This is the key patch in this whole series, in that it actually identifies which osd requests generate outgoing data and which generate incoming data. It's less obvious (currently) that an osd CALL op generates both outgoing and incoming data; that's the focus of some upcoming work.
This resolves: http://tracker.ceph.com/issues/4127
Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
#
2ac2b7a6 |
| 14-Feb-2013 |
Alex Elder <elder@inktank.com> |
libceph: distinguish page and bio requests
An osd request uses either pages or a bio list for its data. Use a union to record information about the two, and add a data type tag to select between th
libceph: distinguish page and bio requests
An osd request uses either pages or a bio list for its data. Use a union to record information about the two, and add a data type tag to select between them.
Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
#
2794a82a |
| 14-Feb-2013 |
Alex Elder <elder@inktank.com> |
libceph: separate osd request data info
Pull the fields in an osd request structure that define the data for the request out into a separate structure.
Signed-off-by: Alex Elder <elder@inktank.com>
libceph: separate osd request data info
Pull the fields in an osd request structure that define the data for the request out into a separate structure.
Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
#
153e5167 |
| 01-Mar-2013 |
Alex Elder <elder@inktank.com> |
libceph: don't assign page info in ceph_osdc_new_request()
Currently ceph_osdc_new_request() assigns an osd request's r_num_pages and r_alignment fields. The only thing it does after that is call c
libceph: don't assign page info in ceph_osdc_new_request()
Currently ceph_osdc_new_request() assigns an osd request's r_num_pages and r_alignment fields. The only thing it does after that is call ceph_osdc_build_request(), and that doesn't need those fields to be assigned.
Move the assignment of those fields out of ceph_osdc_new_request() and into its caller. As a result, the page_align parameter is no longer used, so get rid of it.
Note that in ceph_sync_write(), the value for req->r_num_pages had already been calculated earlier (as num_pages, and fortunately it was computed the same way). So don't bother recomputing it, but because it's not needed earlier, move that calculation after the call to ceph_osdc_new_request(). Hold off making the assignment to r_alignment, doing it instead r_pages and r_num_pages are getting set.
Similarly, in start_read(), nr_pages already holds the number of pages in the array (and is calculated the same way), so there's no need to recompute it. Move the assignment of the page alignment down with the others there as well.
This and the next few patches are preparation work for: http://tracker.ceph.com/issues/4127
Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
#
cf7b7e14 |
| 01-Mar-2013 |
Alex Elder <elder@inktank.com> |
ceph: use calc_pages_for() in start_read()
There's a spot that computes the number of pages to allocate for a page-aligned length by just shifting it. Use calc_pages_for() instead, to be consistent
ceph: use calc_pages_for() in start_read()
There's a spot that computes the number of pages to allocate for a page-aligned length by just shifting it. Use calc_pages_for() instead, to be consistent with usage everywhere else. The result is the same.
The reason for this is to make it clearer in an upcoming patch that this calculation is duplicated.
Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
#
7971bd92 |
| 01-May-2013 |
Sage Weil <sage@inktank.com> |
ceph: revert commit 22cddde104
commit 22cddde104 breaks the atomicity of write operation, it also introduces a deadlock between write and truncate.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
ceph: revert commit 22cddde104
commit 22cddde104 breaks the atomicity of write operation, it also introduces a deadlock between write and truncate.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com> Reviewed-by: Greg Farnum <greg@inktank.com>
Conflicts: fs/ceph/addr.c
show more ...
|
#
1b83bef2 |
| 25-Feb-2013 |
Sage Weil <sage@inktank.com> |
libceph: update osd request/reply encoding
Use the new version of the encoding for osd requests and replies. In the process, update the way we are tracking request ops and reply lengths and results
libceph: update osd request/reply encoding
Use the new version of the encoding for osd requests and replies. In the process, update the way we are tracking request ops and reply lengths and results in the struct ceph_osd_request. Update the rbd and fs/ceph users appropriately.
The main changes are: - we keep pointers into the request memory for fields we need to update each time the request is sent out over the wire - we keep information about the result in an array in the request struct where the users can easily get at it.
Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Alex Elder <elder@inktank.com>
show more ...
|
Revision tags: v3.8-rc7, v3.8-rc6, v3.8-rc5 |
|
#
496ad9aa |
| 23-Jan-2013 |
Al Viro <viro@zeniv.linux.org.uk> |
new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
|
#
a3bea47e |
| 15-Feb-2013 |
Alex Elder <elder@inktank.com> |
ceph: kill ceph_osdc_new_request() "num_reply" parameter
The "num_reply" parameter to ceph_osdc_new_request() is never used inside that function, so get rid of it.
Note that ceph_sync_write() passe
ceph: kill ceph_osdc_new_request() "num_reply" parameter
The "num_reply" parameter to ceph_osdc_new_request() is never used inside that function, so get rid of it.
Note that ceph_sync_write() passes 2 for that argument, while all other callers pass 1. It doesn't matter, but perhaps someone should verify this doesn't indicate a problem.
Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
#
24808826 |
| 15-Feb-2013 |
Alex Elder <elder@inktank.com> |
ceph: kill ceph_osdc_writepages() "flags" parameter
There is only one caller of ceph_osdc_writepages(), and it always passes 0 as its "flags" argument. Get rid of that argument and replace its use
ceph: kill ceph_osdc_writepages() "flags" parameter
There is only one caller of ceph_osdc_writepages(), and it always passes 0 as its "flags" argument. Get rid of that argument and replace its use in ceph_osdc_writepages() with 0.
Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
#
fbf8685f |
| 15-Feb-2013 |
Alex Elder <elder@inktank.com> |
ceph: kill ceph_osdc_writepages() "dosync" parameter
There is only one caller of ceph_osdc_writepages(), and it always passes 0 as its "dosync" argument. Get rid of that argument and replace its us
ceph: kill ceph_osdc_writepages() "dosync" parameter
There is only one caller of ceph_osdc_writepages(), and it always passes 0 as its "dosync" argument. Get rid of that argument and replace its use in ceph_osdc_writepages() with 0.
Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
#
87f979d3 |
| 15-Feb-2013 |
Alex Elder <elder@inktank.com> |
ceph: kill ceph_osdc_writepages() "nofail" parameter
There is only one caller of ceph_osdc_writepages(), and it always passes the value true as its "nofail" argument. Get rid of that argument and r
ceph: kill ceph_osdc_writepages() "nofail" parameter
There is only one caller of ceph_osdc_writepages(), and it always passes the value true as its "nofail" argument. Get rid of that argument and replace its use in ceph_osdc_writepages() with the constant value true.
This and a number of cleanup patches that follow resolve: http://tracker.ceph.com/issues/4126
Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
show more ...
|
Revision tags: v3.8-rc4, v3.8-rc3, v3.8-rc2, v3.8-rc1, v3.7 |
|
#
8884d53d |
| 03-Dec-2012 |
David Zafman <david.zafman@inktank.com> |
libceph: Unlock unprocessed pages in start_read() error path
Function start_read() can get an error before processing all pages. It must not only release the remaining pages, but unlock them too.
T
libceph: Unlock unprocessed pages in start_read() error path
Function start_read() can get an error before processing all pages. It must not only release the remaining pages, but unlock them too.
This fixes http://tracker.newdream.net/issues/3370
Signed-off-by: David Zafman <david.zafman@inktank.com> Reviewed-by: Alex Elder <elder@inktank.com>
show more ...
|