Skip to content

Commit

Permalink
XrdCeph: Implemented Aio interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Ponce authored and ljanyst committed Feb 23, 2015
1 parent ec67424 commit 8256e1b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/XrdCeph/CephOssFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <XrdOuc/XrdOucEnv.hh>
#include <XrdSys/XrdSysError.hh>
#include <XrdOuc/XrdOucTrace.hh>
#include <XrdSfs/XrdSfsAio.hh>

#include "CephOssFile.hh"
#include "CephOss.hh"
Expand Down Expand Up @@ -59,6 +60,19 @@ ssize_t CephOssFile::Write(const void *buff, off_t offset, size_t blen) {
return rc;
}

int CephOssFile::Write(XrdSfsAio *aiop) {
ssize_t rc = Write((void*)aiop->sfsAio.aio_buf,
aiop->sfsAio.aio_offset,
aiop->sfsAio.aio_nbytes);
if (aiop->sfsAio.aio_nbytes == (size_t)rc) {
aiop->Result = rc;
aiop->doneWrite();
return 0;
} else {
return rc;
}
}

int CephOssFile::Fsync() {
return ceph_posix_fsync(m_fd);
}
Expand Down
1 change: 1 addition & 0 deletions src/XrdCeph/CephOssFile.hh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public:
virtual ssize_t ReadRaw(void *, off_t, size_t);
virtual int Fstat(struct stat *buff);
virtual ssize_t Write(const void *buff, off_t offset, size_t blen);
virtual int Write(XrdSfsAio *aiop);
virtual int Fsync(void);
virtual int Ftruncate(unsigned long long);

Expand Down

0 comments on commit 8256e1b

Please sign in to comment.