00001 //------------------------------------------------------------------------------ 00002 // Copyright (c) 2014-2015 by European Organization for Nuclear Research (CERN) 00003 // Author: Sebastien Ponce <sebastien.ponce@cern.ch> 00004 //------------------------------------------------------------------------------ 00005 // This file is part of the XRootD software suite. 00006 // 00007 // XRootD is free software: you can redistribute it and/or modify 00008 // it under the terms of the GNU Lesser General Public License as published by 00009 // the Free Software Foundation, either version 3 of the License, or 00010 // (at your option) any later version. 00011 // 00012 // XRootD is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU Lesser General Public License 00018 // along with XRootD. If not, see <http://www.gnu.org/licenses/>. 00019 // 00020 // In applying this licence, CERN does not waive the privileges and immunities 00021 // granted to it by virtue of its status as an Intergovernmental Organization 00022 // or submit itself to any jurisdiction. 00023 //------------------------------------------------------------------------------ 00024 00025 #ifndef __XRD_CEPH_OSS_FILE_HH__ 00026 #define __XRD_CEPH_OSS_FILE_HH__ 00027 00028 #include "XrdOss/XrdOss.hh" 00029 #include "XrdCeph/XrdCephOss.hh" 00030 00031 //------------------------------------------------------------------------------ 00050 //------------------------------------------------------------------------------ 00051 00052 class XrdCephOssFile : public XrdOssDF { 00053 00054 public: 00055 00056 XrdCephOssFile(XrdCephOss *cephoss); 00057 virtual ~XrdCephOssFile() {}; 00058 virtual int Open(const char *path, int flags, mode_t mode, XrdOucEnv &env); 00059 virtual int Close(long long *retsz=0); 00060 virtual ssize_t Read(off_t offset, size_t blen); 00061 virtual ssize_t Read(void *buff, off_t offset, size_t blen); 00062 virtual int Read(XrdSfsAio *aoip); 00063 virtual ssize_t ReadRaw(void *, off_t, size_t); 00064 virtual int Fstat(struct stat *buff); 00065 virtual ssize_t Write(const void *buff, off_t offset, size_t blen); 00066 virtual int Write(XrdSfsAio *aiop); 00067 virtual int Fsync(void); 00068 virtual int Ftruncate(unsigned long long); 00069 00070 private: 00071 00072 int m_fd; 00073 XrdCephOss *m_cephOss; 00074 00075 }; 00076 00077 #endif /* __XRD_CEPH_OSS_FILE_HH__ */