Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/client/Client.cc b/src/client/Client.cc
- index 199b39f7f45..1763d0a0473 100644
- --- a/src/client/Client.cc
- +++ b/src/client/Client.cc
- @@ -10223,7 +10223,7 @@ void Client::C_Read_Finisher::finish_io(int r)
- delete this;
- }
- -void Client::C_Read_Sync_Async::retry()
- +void Client::C_Read_Sync_NonBlocking::retry()
- {
- filer->read_trunc(in->ino, &in->layout, in->snapid, pos, left, &tbl, 0,
- in->truncate_size, in->truncate_seq, this);
- @@ -10231,9 +10231,9 @@ void Client::C_Read_Sync_Async::retry()
- /**
- * The following method implements most of what _read_sync does, but in a
- - * way that works with the async (non-blocking) read path.
- + * way that works with the non-blocking read path.
- */
- -void Client::C_Read_Sync_Async::finish(int r)
- +void Client::C_Read_Sync_NonBlocking::finish(int r)
- {
- clnt->client_lock.lock();
- @@ -10408,9 +10408,9 @@ retry:
- rc = _read_async(f, offset, size, bl, iofinish.get());
- if (onfinish) {
- - // handle async caller (onfinish != nullptr), we can now safely release
- - // all the managed pointers, but we might need to do something with
- - // iofinisher.
- + // handle non-blocking caller (onfinish != nullptr), we can now safely
- + // release all the managed pointers, but we might need to do something
- + // with iofinisher.
- Context *iof = iofinish.release();
- crf.release();
- @@ -10424,19 +10424,20 @@ retry:
- if (rc < 0)
- goto done;
- } else if (onfinish) {
- - // handle _sync_read asynchronously...
- + // handle _sync_read without blocking...
- // This sounds odd, but we want to accomplish what is done in the else
- // branch below but in a non-blocking fashion. The code in _read_sync
- - // is duplicated and modified and exists in C_Read_Sync_Async::finish().
- - C_Read_Sync_Async *crsa =
- - new C_Read_Sync_Async(this, iofinish.release(), f, in, f->pos,
- - offset, size, bl, filer.get(), have);
- + // is duplicated and modified and exists in
- + // C_Read_Sync_NonBlocking::finish().
- + C_Read_Sync_NonBlocking *crsa =
- + new C_Read_Sync_NonBlocking(this, iofinish.release(), f, in, f->pos,
- + offset, size, bl, filer.get(), have);
- crf.release();
- // Now make first attempt at performing _read_sync
- crsa->retry();
- - // Now the C_Read_Sync_Async is going to handle EVERYTHING else
- + // Now the C_Read_Sync_NonBlocking is going to handle EVERYTHING else
- // Allow caller to wait on onfinish...
- return 0;
- } else {
- @@ -10585,7 +10586,7 @@ int Client::_read_async(Fh *f, uint64_t off, uint64_t len, bufferlist *bl,
- if (onfinish != nullptr) {
- // Release C_Read_Async_Finisher from managed pointer, either
- - // file_read will result in async complete, or we need to complete
- + // file_read will result in non-blocking complete, or we need to complete
- // immediately. In either case, the C_Read_Async_Finisher is safely
- // handled and won't be abandoned.
- Context *crf = io_finish.release();
- @@ -11078,9 +11079,9 @@ int64_t Client::_write(Fh *f, int64_t offset, uint64_t size, const char *buf,
- : false);
- if (onfinish) {
- - // handle async caller (onfinish != nullptr), we can now safely release
- - // all the managed pointers, but we might need to do something with
- - // iofinisher.
- + // handle non-blocking caller (onfinish != nullptr), we can now safely
- + // release all the managed pointers, but we might need to do something
- + // with iofinisher.
- Context *iof = iofinish.release();
- C_Write_Finisher *cwfp = cwf.release();
- @@ -11138,8 +11139,8 @@ int64_t Client::_write(Fh *f, int64_t offset, uint64_t size, const char *buf,
- iofinish.get());
- if (onfinish) {
- - // handle async caller (onfinish != nullptr), we can now safely release
- - // all the managed pointers
- + // handle non-blocking caller (onfinish != nullptr), we can now safely
- + // release all the managed pointers
- iofinish.release();
- onuninline.release();
- cwf.release();
- @@ -11159,7 +11160,7 @@ int64_t Client::_write(Fh *f, int64_t offset, uint64_t size, const char *buf,
- // if we get here, write was successful, update client metadata
- success:
- - // do not get here if async caller (onfinish != nullptr)
- + // do not get here if non-blocking caller (onfinish != nullptr)
- r = _write_success(f, start, fpos, offset, size, in);
- if (r >= 0 && do_fsync) {
- @@ -11173,7 +11174,7 @@ success:
- done:
- - // can not get here if async caller (onfinish != nullptr)
- + // can not get here if non-blocking caller (onfinish != nullptr)
- if (nullptr != onuninline) {
- client_lock.unlock();
- @@ -11312,7 +11313,7 @@ void Client::C_nonblocking_fsync_state::advance()
- ldout(clnt->cct, 15) << "waiting on unsafe requests, last tid " << req->get_tid() << dendl;
- req->get();
- - clnt->add_async_onfinish_to_context_list(req->waitfor_safe, advancer);
- + clnt->add_nonblocking_onfinish_to_context_list(req->waitfor_safe, advancer);
- // ------------ here is a state machine break point
- return;
- }
- @@ -11337,7 +11338,7 @@ void Client::C_nonblocking_fsync_state::advance()
- ldout(clnt->cct, 10) << "ino " << in->ino << " has " << in->cap_refs[CEPH_CAP_FILE_BUFFER]
- << " uncommitted, waiting" << dendl;
- advancer = new C_nonblocking_fsync_state_advancer(clnt, this);
- - clnt->add_async_onfinish_to_context_list(in->waitfor_commit, advancer);
- + clnt->add_nonblocking_onfinish_to_context_list(in->waitfor_commit, advancer);
- // ------------ here is a state machine break point but we have to
- // return to this case because this might loop.
- progress = 1;
- @@ -11378,7 +11379,7 @@ void Client::C_nonblocking_fsync_state::advance()
- << ccap_string(it->second) << " flush_tid " << flush_tid
- << " last " << it->first << dendl;
- advancer = new C_nonblocking_fsync_state_advancer(clnt, this);
- - clnt->add_async_onfinish_to_context_list(in->waitfor_caps, advancer);
- + clnt->add_nonblocking_onfinish_to_context_list(in->waitfor_caps, advancer);
- // ------------ here is a state machine break point
- // the advancer completion will resume with case 3
- return;
- diff --git a/src/client/Client.h b/src/client/Client.h
- index c44a16dc0b8..22b99942a22 100644
- --- a/src/client/Client.h
- +++ b/src/client/Client.h
- @@ -1013,7 +1013,7 @@ protected:
- // helpers
- void wake_up_session_caps(MetaSession *s, bool reconnect);
- - void add_async_onfinish_to_context_list(std::list<Context*>& ls, Context *onfinish) {
- + void add_nonblocking_onfinish_to_context_list(std::list<Context*>& ls, Context *onfinish) {
- ls.push_back(onfinish);
- }
- void wait_on_context_list(std::list<Context*>& ls);
- @@ -1295,20 +1295,20 @@ private:
- }
- };
- - class C_Read_Sync_Async : public Context {
- - // When operating in async (non-blocking) mode, what used to be done by
- - // _read_sync still needs to be handled, but it needs to be handled
- - // asynchronously (non-blocking) while still following the semantics. Note
- - // that _read_sync IS actually asynchronous it just uses condition variables
- - // to wait. Now instead, we use this Context class to synchronize the steps.
- + class C_Read_Sync_NonBlocking : public Context {
- + // When operating in non-blocking mode, what used to be done by _read_sync
- + // still needs to be handled, but it needs to be handled without blocking
- + // while still following the semantics. Note that _read_sync is actually
- + // asynchronous. it just uses condition variables to wait. Now instead, we use
- + // this Context class to synchronize the steps.
- //
- - // The steps will be accomplished by complete/finish being called to
- - // complete each step, with complete only releasing this object once all is
- - // finally complete.
- + // The steps will be accomplished by complete/finish being called to complete
- + // each step, with complete only releasing this object once all is finally
- + // complete.
- public:
- - C_Read_Sync_Async(Client *clnt, Context *onfinish, Fh *f, Inode *in,
- - uint64_t fpos, uint64_t off, uint64_t len,
- - bufferlist *bl, Filer *filer, int have_caps)
- + C_Read_Sync_NonBlocking(Client *clnt, Context *onfinish, Fh *f, Inode *in,
- + uint64_t fpos, uint64_t off, uint64_t len,
- + bufferlist *bl, Filer *filer, int have_caps)
- : clnt(clnt), onfinish(onfinish), f(f), in(in), off(off), len(len), bl(bl),
- filer(filer), have_caps(have_caps)
- {
- diff --git a/src/include/cephfs/libcephfs.h b/src/include/cephfs/libcephfs.h
- index 9a6c1622459..145fa7deccf 100644
- --- a/src/include/cephfs/libcephfs.h
- +++ b/src/include/cephfs/libcephfs.h
- @@ -1892,8 +1892,8 @@ int64_t ceph_ll_readv(struct ceph_mount_info *cmount, struct Fh *fh,
- const struct iovec *iov, int iovcnt, int64_t off);
- int64_t ceph_ll_writev(struct ceph_mount_info *cmount, struct Fh *fh,
- const struct iovec *iov, int iovcnt, int64_t off);
- -int64_t ceph_ll_async_readv_writev(struct ceph_mount_info *cmount,
- - struct ceph_ll_io_info *io_info);
- +int64_t ceph_ll_nonblocking_readv_writev(struct ceph_mount_info *cmount,
- + struct ceph_ll_io_info *io_info);
- int ceph_ll_close(struct ceph_mount_info *cmount, struct Fh* filehandle);
- int ceph_ll_iclose(struct ceph_mount_info *cmount, struct Inode *in, int mode);
- /**
- diff --git a/src/libcephfs.cc b/src/libcephfs.cc
- index 50b6a890e76..9b74c3f70ce 100644
- --- a/src/libcephfs.cc
- +++ b/src/libcephfs.cc
- @@ -1915,8 +1915,8 @@ private:
- }
- };
- -extern "C" int64_t ceph_ll_async_readv_writev(class ceph_mount_info *cmount,
- - struct ceph_ll_io_info *io_info)
- +extern "C" int64_t ceph_ll_nonblocking_readv_writev(class ceph_mount_info *cmount,
- + struct ceph_ll_io_info *io_info)
- {
- LL_Onfinish *onfinish = new LL_Onfinish(io_info);
- diff --git a/src/libkmip b/src/libkmip
- --- a/src/libkmip
- +++ b/src/libkmip
- @@ -1 +1 @@
- -Subproject commit b25cde94c9b8686988ed1236bd807afe74991333
- +Subproject commit b25cde94c9b8686988ed1236bd807afe74991333-dirty
- diff --git a/src/rapidjson b/src/rapidjson
- --- a/src/rapidjson
- +++ b/src/rapidjson
- @@ -1 +1 @@
- -Subproject commit e4bde977440d4a00f820b6586899e48a972d2493
- +Subproject commit e4bde977440d4a00f820b6586899e48a972d2493-dirty
- diff --git a/src/test/client/async.cc b/src/test/client/nonblocking.cc
- similarity index 94%
- rename from src/test/client/async.cc
- rename to src/test/client/nonblocking.cc
- index 021f1036e4e..dafff45d50a 100644
- --- a/src/test/client/async.cc
- +++ b/src/test/client/nonblocking.cc
- @@ -61,8 +61,8 @@ TEST_F(TestClient, LlreadvLlwritev) {
- std::unique_ptr<C_SaferCond> writefinish = nullptr;
- std::unique_ptr<C_SaferCond> readfinish = nullptr;
- - writefinish.reset(new C_SaferCond("test-async"));
- - readfinish.reset(new C_SaferCond("test-async"));
- + writefinish.reset(new C_SaferCond("test-nonblocking"));
- + readfinish.reset(new C_SaferCond("test-nonblocking"));
- int64_t rc;
- bufferlist bl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement