aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/addr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ceph/addr.c')
-rw-r--r--fs/ceph/addr.c41
1 files changed, 26 insertions, 15 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index fd5599d32362..e162bcd105ee 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1146,6 +1146,10 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping,
1146 inode, page, (int)pos, (int)len); 1146 inode, page, (int)pos, (int)len);
1147 1147
1148 r = ceph_update_writeable_page(file, pos, len, page); 1148 r = ceph_update_writeable_page(file, pos, len, page);
1149 if (r < 0)
1150 page_cache_release(page);
1151 else
1152 *pagep = page;
1149 } while (r == -EAGAIN); 1153 } while (r == -EAGAIN);
1150 1154
1151 return r; 1155 return r;
@@ -1198,8 +1202,7 @@ static int ceph_write_end(struct file *file, struct address_space *mapping,
1198 * intercept O_DIRECT reads and writes early, this function should 1202 * intercept O_DIRECT reads and writes early, this function should
1199 * never get called. 1203 * never get called.
1200 */ 1204 */
1201static ssize_t ceph_direct_io(int rw, struct kiocb *iocb, 1205static ssize_t ceph_direct_io(struct kiocb *iocb, struct iov_iter *iter,
1202 struct iov_iter *iter,
1203 loff_t pos) 1206 loff_t pos)
1204{ 1207{
1205 WARN_ON(1); 1208 WARN_ON(1);
@@ -1535,19 +1538,27 @@ int ceph_uninline_data(struct file *filp, struct page *locked_page)
1535 1538
1536 osd_req_op_extent_osd_data_pages(req, 1, &page, len, 0, false, false); 1539 osd_req_op_extent_osd_data_pages(req, 1, &page, len, 0, false, false);
1537 1540
1538 err = osd_req_op_xattr_init(req, 0, CEPH_OSD_OP_CMPXATTR, 1541 {
1539 "inline_version", &inline_version, 1542 __le64 xattr_buf = cpu_to_le64(inline_version);
1540 sizeof(inline_version), 1543 err = osd_req_op_xattr_init(req, 0, CEPH_OSD_OP_CMPXATTR,
1541 CEPH_OSD_CMPXATTR_OP_GT, 1544 "inline_version", &xattr_buf,
1542 CEPH_OSD_CMPXATTR_MODE_U64); 1545 sizeof(xattr_buf),
1543 if (err) 1546 CEPH_OSD_CMPXATTR_OP_GT,
1544 goto out_put; 1547 CEPH_OSD_CMPXATTR_MODE_U64);
1545 1548 if (err)
1546 err = osd_req_op_xattr_init(req, 2, CEPH_OSD_OP_SETXATTR, 1549 goto out_put;
1547 "inline_version", &inline_version, 1550 }
1548 sizeof(inline_version), 0, 0); 1551
1549 if (err) 1552 {
1550 goto out_put; 1553 char xattr_buf[32];
1554 int xattr_len = snprintf(xattr_buf, sizeof(xattr_buf),
1555 "%llu", inline_version);
1556 err = osd_req_op_xattr_init(req, 2, CEPH_OSD_OP_SETXATTR,
1557 "inline_version",
1558 xattr_buf, xattr_len, 0, 0);
1559 if (err)
1560 goto out_put;
1561 }
1551 1562
1552 ceph_osdc_build_request(req, 0, NULL, CEPH_NOSNAP, &inode->i_mtime); 1563 ceph_osdc_build_request(req, 0, NULL, CEPH_NOSNAP, &inode->i_mtime);
1553 err = ceph_osdc_start_request(&fsc->client->osdc, req, false); 1564 err = ceph_osdc_start_request(&fsc->client->osdc, req, false);