Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 331693
b: refs/heads/master
c: 6816282
h: refs/heads/master
i:
  331691: 041967e
v: v3
  • Loading branch information
Sage Weil authored and Alex Elder committed Oct 1, 2012
1 parent 384393f commit fed2b3a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d63b77f4c552cc3a20506871046ab0fcbc332609
refs/heads/master: 6816282dab3a72efe8c0d182c1bc2960d87f4322
8 changes: 4 additions & 4 deletions trunk/fs/ceph/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@ static int start_read(struct inode *inode, struct list_head *page_list, int max)
NULL, 0,
ci->i_truncate_seq, ci->i_truncate_size,
NULL, false, 1, 0);
if (!req)
return -ENOMEM;
if (IS_ERR(req))
return PTR_ERR(req);

/* build page vector */
nr_pages = len >> PAGE_CACHE_SHIFT;
Expand Down Expand Up @@ -832,8 +832,8 @@ static int ceph_writepages_start(struct address_space *mapping,
ci->i_truncate_size,
&inode->i_mtime, true, 1, 0);

if (!req) {
rc = -ENOMEM;
if (IS_ERR(req)) {
rc = PTR_ERR(req);
unlock_page(page);
break;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/ceph/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,8 @@ static ssize_t ceph_sync_write(struct file *file, const char __user *data,
do_sync,
ci->i_truncate_seq, ci->i_truncate_size,
&mtime, false, 2, page_align);
if (!req)
return -ENOMEM;
if (IS_ERR(req))
return PTR_ERR(req);

if (file->f_flags & O_DIRECT) {
pages = ceph_get_direct_page_vector(data, num_pages, false);
Expand Down
15 changes: 9 additions & 6 deletions trunk/net/ceph/osd_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
{
struct ceph_osd_req_op ops[3];
struct ceph_osd_request *req;
int r;

ops[0].op = opcode;
ops[0].extent.truncate_seq = truncate_seq;
Expand All @@ -482,10 +483,12 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
use_mempool,
GFP_NOFS, NULL, NULL);
if (!req)
return NULL;
return ERR_PTR(-ENOMEM);

/* calculate max write size */
calc_layout(osdc, vino, layout, off, plen, req, ops);
r = calc_layout(osdc, vino, layout, off, plen, req, ops);
if (r < 0)
return ERR_PTR(r);
req->r_file_layout = *layout; /* keep a copy */

/* in case it differs from natural (file) alignment that
Expand Down Expand Up @@ -1928,8 +1931,8 @@ int ceph_osdc_readpages(struct ceph_osd_client *osdc,
CEPH_OSD_OP_READ, CEPH_OSD_FLAG_READ,
NULL, 0, truncate_seq, truncate_size, NULL,
false, 1, page_align);
if (!req)
return -ENOMEM;
if (IS_ERR(req))
return PTR_ERR(req);

/* it may be a short read due to an object boundary */
req->r_pages = pages;
Expand Down Expand Up @@ -1971,8 +1974,8 @@ int ceph_osdc_writepages(struct ceph_osd_client *osdc, struct ceph_vino vino,
snapc, do_sync,
truncate_seq, truncate_size, mtime,
nofail, 1, page_align);
if (!req)
return -ENOMEM;
if (IS_ERR(req))
return PTR_ERR(req);

/* it may be a short write due to an object boundary */
req->r_pages = pages;
Expand Down

0 comments on commit fed2b3a

Please sign in to comment.