From: Jianpeng Ma Date: Tue, 25 Nov 2014 03:31:05 +0000 (+0800) Subject: ObjectStore: Modify read function can handle fadvise flags. X-Git-Tag: v0.91~55^2~3^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2dedf31ce5142c09cda99348b2b7ed9b87ffeb4b;p=ceph.git ObjectStore: Modify read function can handle fadvise flags. Signed-off-by: Jianpeng Ma --- diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 51127317ffb8..f68e4b942f18 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -2795,6 +2795,7 @@ int FileStore::read( uint64_t offset, size_t len, bufferlist& bl, + uint32_t op_flags, bool allow_eio) { int got; diff --git a/src/os/FileStore.h b/src/os/FileStore.h index ab9f47f60f49..a7fa4d86d1ea 100644 --- a/src/os/FileStore.h +++ b/src/os/FileStore.h @@ -525,6 +525,7 @@ public: uint64_t offset, size_t len, bufferlist& bl, + uint32_t op_flags = 0, bool allow_eio = false); int fiemap(coll_t cid, const ghobject_t& oid, uint64_t offset, size_t len, bufferlist& bl); diff --git a/src/os/KeyValueStore.cc b/src/os/KeyValueStore.cc index 3603c1e75f22..19d3b1b62587 100644 --- a/src/os/KeyValueStore.cc +++ b/src/os/KeyValueStore.cc @@ -1702,7 +1702,8 @@ int KeyValueStore::_generic_read(StripObjectMap::StripObjectHeaderRef header, int KeyValueStore::read(coll_t cid, const ghobject_t& oid, uint64_t offset, - size_t len, bufferlist& bl, bool allow_eio) + size_t len, bufferlist& bl, uint32_t op_flags, + bool allow_eio) { dout(15) << __func__ << " " << cid << "/" << oid << " " << offset << "~" << len << dendl; diff --git a/src/os/KeyValueStore.h b/src/os/KeyValueStore.h index 7d762af9d6d4..b73bf928335b 100644 --- a/src/os/KeyValueStore.h +++ b/src/os/KeyValueStore.h @@ -548,7 +548,7 @@ class KeyValueStore : public ObjectStore, int stat(coll_t cid, const ghobject_t& oid, struct stat *st, bool allow_eio = false); int read(coll_t cid, const ghobject_t& oid, uint64_t offset, size_t len, - bufferlist& bl, bool allow_eio = false); + bufferlist& bl, uint32_t op_flags = 0, bool allow_eio = false); int fiemap(coll_t cid, const ghobject_t& oid, uint64_t offset, size_t len, bufferlist& bl); diff --git a/src/os/MemStore.cc b/src/os/MemStore.cc index 85c04aac457f..19316d90d3b5 100644 --- a/src/os/MemStore.cc +++ b/src/os/MemStore.cc @@ -302,6 +302,7 @@ int MemStore::read( uint64_t offset, size_t len, bufferlist& bl, + uint32_t op_flags, bool allow_eio) { dout(10) << __func__ << " " << cid << " " << oid << " " diff --git a/src/os/MemStore.h b/src/os/MemStore.h index 078959781eed..7eb994d9875d 100644 --- a/src/os/MemStore.h +++ b/src/os/MemStore.h @@ -279,6 +279,7 @@ public: uint64_t offset, size_t len, bufferlist& bl, + uint32_t op_flags = 0, bool allow_eio = false); int fiemap(coll_t cid, const ghobject_t& oid, uint64_t offset, size_t len, bufferlist& bl); int getattr(coll_t cid, const ghobject_t& oid, const char *name, bufferptr& value); diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index 586333b82d74..5e8800f9484c 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -1316,6 +1316,7 @@ public: * @param offset location offset of first byte to be read * @param len number of bytes to be read * @param bl output bufferlist + * @param op_flags is CEPH_OSD_OP_FLAG_* * @param allow_eio if false, assert on -EIO operation failure * @returns number of bytes read on success, or negative error code on failure. */ @@ -1325,6 +1326,7 @@ public: uint64_t offset, size_t len, bufferlist& bl, + uint32_t op_flags = 0, bool allow_eio = false) = 0; /**