diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2016-04-27 08:15:51 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2016-05-25 18:36:21 -0400 |
commit | 13d1ad16d05eebb4db977eb955716b9da2c19fbd (patch) | |
tree | d48af8a4ae4ce0cc9407b7c72376dc518fbceea3 /fs/ceph/addr.c | |
parent | 841272825b2263174120ab02b4abac9005ee1420 (diff) |
libceph: move message allocation out of ceph_osdc_alloc_request()
The size of ->r_request and ->r_reply messages depends on the size of
the object name (ceph_object_id), while the size of ceph_osd_request is
fixed. Move message allocation into a separate function that would
have to be called after ceph_object_id and ceph_object_locator (which
is also going to become variable in size with RADOS namespaces) have
been filled in:
req = ceph_osdc_alloc_request(...);
<fill in req->r_base_oid>
<fill in req->r_base_oloc>
ceph_osdc_alloc_messages(req);
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/addr.c')
-rw-r--r-- | fs/ceph/addr.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 3e61fc8bb371..6fee7e0b8931 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c | |||
@@ -1762,6 +1762,10 @@ static int __ceph_pool_perm_get(struct ceph_inode_info *ci, u32 pool) | |||
1762 | "%llx.00000000", ci->i_vino.ino); | 1762 | "%llx.00000000", ci->i_vino.ino); |
1763 | rd_req->r_base_oid.name_len = strlen(rd_req->r_base_oid.name); | 1763 | rd_req->r_base_oid.name_len = strlen(rd_req->r_base_oid.name); |
1764 | 1764 | ||
1765 | err = ceph_osdc_alloc_messages(rd_req, GFP_NOFS); | ||
1766 | if (err) | ||
1767 | goto out_unlock; | ||
1768 | |||
1765 | wr_req = ceph_osdc_alloc_request(&fsc->client->osdc, NULL, | 1769 | wr_req = ceph_osdc_alloc_request(&fsc->client->osdc, NULL, |
1766 | 1, false, GFP_NOFS); | 1770 | 1, false, GFP_NOFS); |
1767 | if (!wr_req) { | 1771 | if (!wr_req) { |
@@ -1775,6 +1779,10 @@ static int __ceph_pool_perm_get(struct ceph_inode_info *ci, u32 pool) | |||
1775 | wr_req->r_base_oloc.pool = pool; | 1779 | wr_req->r_base_oloc.pool = pool; |
1776 | wr_req->r_base_oid = rd_req->r_base_oid; | 1780 | wr_req->r_base_oid = rd_req->r_base_oid; |
1777 | 1781 | ||
1782 | err = ceph_osdc_alloc_messages(wr_req, GFP_NOFS); | ||
1783 | if (err) | ||
1784 | goto out_unlock; | ||
1785 | |||
1778 | /* one page should be large enough for STAT data */ | 1786 | /* one page should be large enough for STAT data */ |
1779 | pages = ceph_alloc_page_vector(1, GFP_KERNEL); | 1787 | pages = ceph_alloc_page_vector(1, GFP_KERNEL); |
1780 | if (IS_ERR(pages)) { | 1788 | if (IS_ERR(pages)) { |