Commit 54ea0046 authored by Ilya Dryomov's avatar Ilya Dryomov

libceph, rbd, ceph: WRITE | ONDISK -> WRITE

CEPH_OSD_FLAG_ONDISK is set in account_request().
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
Reviewed-by: default avatarJeff Layton <jlayton@redhat.com>
Reviewed-by: default avatarSage Weil <sage@redhat.com>
parent b18b9550
...@@ -1981,8 +1981,7 @@ static struct ceph_osd_request *rbd_osd_req_create( ...@@ -1981,8 +1981,7 @@ static struct ceph_osd_request *rbd_osd_req_create(
return __rbd_osd_req_create(rbd_dev, snapc, num_ops, return __rbd_osd_req_create(rbd_dev, snapc, num_ops,
(op_type == OBJ_OP_WRITE || op_type == OBJ_OP_DISCARD) ? (op_type == OBJ_OP_WRITE || op_type == OBJ_OP_DISCARD) ?
CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK : CEPH_OSD_FLAG_READ, CEPH_OSD_FLAG_WRITE : CEPH_OSD_FLAG_READ, obj_request);
obj_request);
} }
/* /*
...@@ -2008,8 +2007,7 @@ rbd_osd_req_create_copyup(struct rbd_obj_request *obj_request) ...@@ -2008,8 +2007,7 @@ rbd_osd_req_create_copyup(struct rbd_obj_request *obj_request)
return __rbd_osd_req_create(img_request->rbd_dev, return __rbd_osd_req_create(img_request->rbd_dev,
img_request->snapc, num_osd_ops, img_request->snapc, num_osd_ops,
CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK, CEPH_OSD_FLAG_WRITE, obj_request);
obj_request);
} }
static void rbd_osd_req_destroy(struct ceph_osd_request *osd_req) static void rbd_osd_req_destroy(struct ceph_osd_request *osd_req)
......
...@@ -1018,8 +1018,7 @@ static int ceph_writepages_start(struct address_space *mapping, ...@@ -1018,8 +1018,7 @@ static int ceph_writepages_start(struct address_space *mapping,
&ci->i_layout, vino, &ci->i_layout, vino,
offset, &len, 0, num_ops, offset, &len, 0, num_ops,
CEPH_OSD_OP_WRITE, CEPH_OSD_OP_WRITE,
CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_WRITE,
CEPH_OSD_FLAG_ONDISK,
snapc, truncate_seq, snapc, truncate_seq,
truncate_size, false); truncate_size, false);
if (IS_ERR(req)) { if (IS_ERR(req)) {
...@@ -1029,8 +1028,7 @@ static int ceph_writepages_start(struct address_space *mapping, ...@@ -1029,8 +1028,7 @@ static int ceph_writepages_start(struct address_space *mapping,
min(num_ops, min(num_ops,
CEPH_OSD_SLAB_OPS), CEPH_OSD_SLAB_OPS),
CEPH_OSD_OP_WRITE, CEPH_OSD_OP_WRITE,
CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_WRITE,
CEPH_OSD_FLAG_ONDISK,
snapc, truncate_seq, snapc, truncate_seq,
truncate_size, true); truncate_size, true);
BUG_ON(IS_ERR(req)); BUG_ON(IS_ERR(req));
...@@ -1680,8 +1678,7 @@ int ceph_uninline_data(struct file *filp, struct page *locked_page) ...@@ -1680,8 +1678,7 @@ int ceph_uninline_data(struct file *filp, struct page *locked_page)
req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout, req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout,
ceph_vino(inode), 0, &len, 0, 1, ceph_vino(inode), 0, &len, 0, 1,
CEPH_OSD_OP_CREATE, CEPH_OSD_OP_CREATE, CEPH_OSD_FLAG_WRITE,
CEPH_OSD_FLAG_ONDISK | CEPH_OSD_FLAG_WRITE,
NULL, 0, 0, false); NULL, 0, 0, false);
if (IS_ERR(req)) { if (IS_ERR(req)) {
err = PTR_ERR(req); err = PTR_ERR(req);
...@@ -1698,8 +1695,7 @@ int ceph_uninline_data(struct file *filp, struct page *locked_page) ...@@ -1698,8 +1695,7 @@ int ceph_uninline_data(struct file *filp, struct page *locked_page)
req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout, req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout,
ceph_vino(inode), 0, &len, 1, 3, ceph_vino(inode), 0, &len, 1, 3,
CEPH_OSD_OP_WRITE, CEPH_OSD_OP_WRITE, CEPH_OSD_FLAG_WRITE,
CEPH_OSD_FLAG_ONDISK | CEPH_OSD_FLAG_WRITE,
NULL, ci->i_truncate_seq, NULL, ci->i_truncate_seq,
ci->i_truncate_size, false); ci->i_truncate_size, false);
if (IS_ERR(req)) { if (IS_ERR(req)) {
...@@ -1872,7 +1868,7 @@ static int __ceph_pool_perm_get(struct ceph_inode_info *ci, ...@@ -1872,7 +1868,7 @@ static int __ceph_pool_perm_get(struct ceph_inode_info *ci,
goto out_unlock; goto out_unlock;
} }
wr_req->r_flags = CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK; wr_req->r_flags = CEPH_OSD_FLAG_WRITE;
osd_req_op_init(wr_req, 0, CEPH_OSD_OP_CREATE, CEPH_OSD_OP_FLAG_EXCL); osd_req_op_init(wr_req, 0, CEPH_OSD_OP_CREATE, CEPH_OSD_OP_FLAG_EXCL);
ceph_oloc_copy(&wr_req->r_base_oloc, &rd_req->r_base_oloc); ceph_oloc_copy(&wr_req->r_base_oloc, &rd_req->r_base_oloc);
ceph_oid_copy(&wr_req->r_base_oid, &rd_req->r_base_oid); ceph_oid_copy(&wr_req->r_base_oid, &rd_req->r_base_oid);
......
...@@ -759,9 +759,7 @@ static void ceph_aio_retry_work(struct work_struct *work) ...@@ -759,9 +759,7 @@ static void ceph_aio_retry_work(struct work_struct *work)
goto out; goto out;
} }
req->r_flags = CEPH_OSD_FLAG_ORDERSNAP | req->r_flags = CEPH_OSD_FLAG_ORDERSNAP | CEPH_OSD_FLAG_WRITE;
CEPH_OSD_FLAG_ONDISK |
CEPH_OSD_FLAG_WRITE;
ceph_oloc_copy(&req->r_base_oloc, &orig_req->r_base_oloc); ceph_oloc_copy(&req->r_base_oloc, &orig_req->r_base_oloc);
ceph_oid_copy(&req->r_base_oid, &orig_req->r_base_oid); ceph_oid_copy(&req->r_base_oid, &orig_req->r_base_oid);
...@@ -833,9 +831,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter, ...@@ -833,9 +831,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter,
if (ret2 < 0) if (ret2 < 0)
dout("invalidate_inode_pages2_range returned %d\n", ret2); dout("invalidate_inode_pages2_range returned %d\n", ret2);
flags = CEPH_OSD_FLAG_ORDERSNAP | flags = CEPH_OSD_FLAG_ORDERSNAP | CEPH_OSD_FLAG_WRITE;
CEPH_OSD_FLAG_ONDISK |
CEPH_OSD_FLAG_WRITE;
} else { } else {
flags = CEPH_OSD_FLAG_READ; flags = CEPH_OSD_FLAG_READ;
} }
...@@ -1034,9 +1030,7 @@ ceph_sync_write(struct kiocb *iocb, struct iov_iter *from, loff_t pos, ...@@ -1034,9 +1030,7 @@ ceph_sync_write(struct kiocb *iocb, struct iov_iter *from, loff_t pos,
if (ret < 0) if (ret < 0)
dout("invalidate_inode_pages2_range returned %d\n", ret); dout("invalidate_inode_pages2_range returned %d\n", ret);
flags = CEPH_OSD_FLAG_ORDERSNAP | flags = CEPH_OSD_FLAG_ORDERSNAP | CEPH_OSD_FLAG_WRITE;
CEPH_OSD_FLAG_ONDISK |
CEPH_OSD_FLAG_WRITE;
while ((len = iov_iter_count(from)) > 0) { while ((len = iov_iter_count(from)) > 0) {
size_t left; size_t left;
...@@ -1531,8 +1525,7 @@ static int ceph_zero_partial_object(struct inode *inode, ...@@ -1531,8 +1525,7 @@ static int ceph_zero_partial_object(struct inode *inode,
ceph_vino(inode), ceph_vino(inode),
offset, length, offset, length,
0, 1, op, 0, 1, op,
CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_WRITE,
CEPH_OSD_FLAG_ONDISK,
NULL, 0, 0, false); NULL, 0, 0, false);
if (IS_ERR(req)) { if (IS_ERR(req)) {
ret = PTR_ERR(req); ret = PTR_ERR(req);
......
...@@ -69,8 +69,8 @@ int ceph_cls_lock(struct ceph_osd_client *osdc, ...@@ -69,8 +69,8 @@ int ceph_cls_lock(struct ceph_osd_client *osdc,
dout("%s lock_name %s type %d cookie %s tag %s desc %s flags 0x%x\n", dout("%s lock_name %s type %d cookie %s tag %s desc %s flags 0x%x\n",
__func__, lock_name, type, cookie, tag, desc, flags); __func__, lock_name, type, cookie, tag, desc, flags);
ret = ceph_osdc_call(osdc, oid, oloc, "lock", "lock", ret = ceph_osdc_call(osdc, oid, oloc, "lock", "lock",
CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK, CEPH_OSD_FLAG_WRITE, lock_op_page,
lock_op_page, lock_op_buf_size, NULL, NULL); lock_op_buf_size, NULL, NULL);
dout("%s: status %d\n", __func__, ret); dout("%s: status %d\n", __func__, ret);
__free_page(lock_op_page); __free_page(lock_op_page);
...@@ -117,8 +117,8 @@ int ceph_cls_unlock(struct ceph_osd_client *osdc, ...@@ -117,8 +117,8 @@ int ceph_cls_unlock(struct ceph_osd_client *osdc,
dout("%s lock_name %s cookie %s\n", __func__, lock_name, cookie); dout("%s lock_name %s cookie %s\n", __func__, lock_name, cookie);
ret = ceph_osdc_call(osdc, oid, oloc, "lock", "unlock", ret = ceph_osdc_call(osdc, oid, oloc, "lock", "unlock",
CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK, CEPH_OSD_FLAG_WRITE, unlock_op_page,
unlock_op_page, unlock_op_buf_size, NULL, NULL); unlock_op_buf_size, NULL, NULL);
dout("%s: status %d\n", __func__, ret); dout("%s: status %d\n", __func__, ret);
__free_page(unlock_op_page); __free_page(unlock_op_page);
...@@ -170,8 +170,8 @@ int ceph_cls_break_lock(struct ceph_osd_client *osdc, ...@@ -170,8 +170,8 @@ int ceph_cls_break_lock(struct ceph_osd_client *osdc,
dout("%s lock_name %s cookie %s locker %s%llu\n", __func__, lock_name, dout("%s lock_name %s cookie %s locker %s%llu\n", __func__, lock_name,
cookie, ENTITY_NAME(*locker)); cookie, ENTITY_NAME(*locker));
ret = ceph_osdc_call(osdc, oid, oloc, "lock", "break_lock", ret = ceph_osdc_call(osdc, oid, oloc, "lock", "break_lock",
CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK, CEPH_OSD_FLAG_WRITE, break_op_page,
break_op_page, break_op_buf_size, NULL, NULL); break_op_buf_size, NULL, NULL);
dout("%s: status %d\n", __func__, ret); dout("%s: status %d\n", __func__, ret);
__free_page(break_op_page); __free_page(break_op_page);
......
...@@ -1704,7 +1704,7 @@ static void __submit_request(struct ceph_osd_request *req, bool wrlocked) ...@@ -1704,7 +1704,7 @@ static void __submit_request(struct ceph_osd_request *req, bool wrlocked)
static void account_request(struct ceph_osd_request *req) static void account_request(struct ceph_osd_request *req)
{ {
WARN_ON(req->r_flags & CEPH_OSD_FLAG_ACK); WARN_ON(req->r_flags & (CEPH_OSD_FLAG_ACK | CEPH_OSD_FLAG_ONDISK));
WARN_ON(!(req->r_flags & (CEPH_OSD_FLAG_READ | CEPH_OSD_FLAG_WRITE))); WARN_ON(!(req->r_flags & (CEPH_OSD_FLAG_READ | CEPH_OSD_FLAG_WRITE)));
req->r_flags |= CEPH_OSD_FLAG_ONDISK; req->r_flags |= CEPH_OSD_FLAG_ONDISK;
...@@ -3539,7 +3539,7 @@ ceph_osdc_watch(struct ceph_osd_client *osdc, ...@@ -3539,7 +3539,7 @@ ceph_osdc_watch(struct ceph_osd_client *osdc,
ceph_oid_copy(&lreq->t.base_oid, oid); ceph_oid_copy(&lreq->t.base_oid, oid);
ceph_oloc_copy(&lreq->t.base_oloc, oloc); ceph_oloc_copy(&lreq->t.base_oloc, oloc);
lreq->t.flags = CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK; lreq->t.flags = CEPH_OSD_FLAG_WRITE;
lreq->mtime = CURRENT_TIME; lreq->mtime = CURRENT_TIME;
lreq->reg_req = alloc_linger_request(lreq); lreq->reg_req = alloc_linger_request(lreq);
...@@ -3597,7 +3597,7 @@ int ceph_osdc_unwatch(struct ceph_osd_client *osdc, ...@@ -3597,7 +3597,7 @@ int ceph_osdc_unwatch(struct ceph_osd_client *osdc,
ceph_oid_copy(&req->r_base_oid, &lreq->t.base_oid); ceph_oid_copy(&req->r_base_oid, &lreq->t.base_oid);
ceph_oloc_copy(&req->r_base_oloc, &lreq->t.base_oloc); ceph_oloc_copy(&req->r_base_oloc, &lreq->t.base_oloc);
req->r_flags = CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK; req->r_flags = CEPH_OSD_FLAG_WRITE;
req->r_mtime = CURRENT_TIME; req->r_mtime = CURRENT_TIME;
osd_req_op_watch_init(req, 0, lreq->linger_id, osd_req_op_watch_init(req, 0, lreq->linger_id,
CEPH_OSD_WATCH_OP_UNWATCH); CEPH_OSD_WATCH_OP_UNWATCH);
...@@ -4163,8 +4163,7 @@ int ceph_osdc_writepages(struct ceph_osd_client *osdc, struct ceph_vino vino, ...@@ -4163,8 +4163,7 @@ int ceph_osdc_writepages(struct ceph_osd_client *osdc, struct ceph_vino vino,
int page_align = off & ~PAGE_MASK; int page_align = off & ~PAGE_MASK;
req = ceph_osdc_new_request(osdc, layout, vino, off, &len, 0, 1, req = ceph_osdc_new_request(osdc, layout, vino, off, &len, 0, 1,
CEPH_OSD_OP_WRITE, CEPH_OSD_OP_WRITE, CEPH_OSD_FLAG_WRITE,
CEPH_OSD_FLAG_ONDISK | CEPH_OSD_FLAG_WRITE,
snapc, truncate_seq, truncate_size, snapc, truncate_seq, truncate_size,
true); true);
if (IS_ERR(req)) if (IS_ERR(req))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment