diff options
author | Sage Weil <sage@inktank.com> | 2013-09-30 10:32:01 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-09-30 10:49:55 -0700 |
commit | f3f9c1dd3dc86b815b4c656ee03e2dac4ded05f1 (patch) | |
tree | 88b170a08c9b6ee7845d432a616d49b8b32b9b2d /src/os/GenericFileStoreBackend.h | |
parent | 65eabb38526f6f0cd8a58462bed540c19480e957 (diff) | |
download | ceph-wip-fs-crc.tar.gz |
os/FileStore: add sloppy crc trackingwip-fs-crc
Opportunistically track CRCs for data we write and verify it for data
we read.
Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'src/os/GenericFileStoreBackend.h')
-rw-r--r-- | src/os/GenericFileStoreBackend.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/os/GenericFileStoreBackend.h b/src/os/GenericFileStoreBackend.h index 95aca971708..5a09c2497a8 100644 --- a/src/os/GenericFileStoreBackend.h +++ b/src/os/GenericFileStoreBackend.h @@ -17,6 +17,8 @@ #include "FileStore.h" +class SloppyCRCMap; + class GenericFileStoreBackend : public FileStoreBackend { private: bool ioctl_fiemap; @@ -25,6 +27,7 @@ private: public: GenericFileStoreBackend(FileStore *fs); virtual ~GenericFileStoreBackend() {}; + virtual int detect_features(); virtual int create_current(); virtual bool can_checkpoint() { return false; }; @@ -39,5 +42,17 @@ public: virtual int clone_range(int from, int to, uint64_t srcoff, uint64_t len, uint64_t dstoff) { return _copy_range(from, to, srcoff, len, dstoff); } + +private: + int _crc_load_or_init(int fd, SloppyCRCMap *cm); + int _crc_save(int fd, SloppyCRCMap *cm); +public: + virtual int _crc_update_write(int fd, loff_t off, size_t len, const bufferlist& bl); + virtual int _crc_update_truncate(int fd, loff_t off); + virtual int _crc_update_zero(int fd, loff_t off, size_t len); + virtual int _crc_update_clone_range(int srcfd, int destfd, + loff_t srcoff, size_t len, loff_t dstoff); + virtual int _crc_verify_read(int fd, loff_t off, size_t len, const bufferlist& bl, + ostream *out); }; #endif |