Skip to content

Commit

Permalink
[SFS] Additional methods and flags for the future.
Browse files Browse the repository at this point in the history
  • Loading branch information
abh3 authored and osschar committed Oct 10, 2019
1 parent 3b513c4 commit 88988ab
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 14 deletions.
12 changes: 1 addition & 11 deletions src/XrdSfs/XrdSfsFlags.hh
Expand Up @@ -38,7 +38,7 @@
//! plug-ins to passthrough features and special attributes of regular files.
//-----------------------------------------------------------------------------

namespace SfsFeature
namespace Sfs
{
//! Feature: Authorization
static const uint64_t hasAUTZ = 0x0000000000000001LL;
Expand Down Expand Up @@ -79,14 +79,4 @@ static const dev_t XRDSFS_HASBKUP =
static_cast<dev_t>(0x40LL<<((sizeof(dev_t)*8)-8));
static const dev_t XRDSFS_RDVMASK =
static_cast<dev_t>(~(0xffLL<<((sizeof(dev_t)*8)-8)));

//------------------------------------------------------------------------------
//! The following defines the feature set bits that use used by the SFS
//! interface in response to a Features() call to indicate the various features
//! the plug-in has implemented.
//------------------------------------------------------------------------------

namespace XrdSfs
{
}
#endif
77 changes: 74 additions & 3 deletions src/XrdSfs/XrdSfsInterface.hh
Expand Up @@ -175,7 +175,6 @@ struct XrdSfsPrep //!< Prepare parameters
/******************************************************************************/

class XrdOucEnv;
class XrdOucTList;
class XrdSecEntity;
struct XrdSfsFACtl;

Expand Down Expand Up @@ -463,6 +462,67 @@ virtual int fctl(const int cmd,

virtual const char *FName() = 0;

//-----------------------------------------------------------------------------
//! Read page bytes into a buffer and return corresponding checksums.
//!
//! @param offset - The offset where the read is to start. It must be
//! page aligned.
//! @param buffer - pointer to buffer where the bytes are to be placed.
//! @param rdlen - The number of bytes to read. The amount must be an
//! integral number of XrdSfsPageSize bytes.
//! @param csvec - A vector of [rdlen/XrdSfsPageSize] entries which will be
//! filled with the corresponding CRC32 checksum for each
//! page. A nil pointer does not return the checksums.
//! @param verify - When true, the checksum is verified for each page; an
//! error is returned if any checksum is incorrect.
//!
//!
//! @return >= 0 The number of bytes that placed in buffer.
//! @return SFS_ERROR File could not be read, error holds the reason.
//-----------------------------------------------------------------------------

virtual XrdSfsXferSize pgRead(XrdSfsFileOffset offset,
char *buffer,
XrdSfsXferSize rdlen,
uint32_t *csvec,
bool verify=true)
{(void)offset; (void)buffer; (void)rdlen;
(void)csvec; (void)verify;
error.setErrInfo(ENOTSUP, "Not supported.");
return SFS_ERROR;
}

//-----------------------------------------------------------------------------
//! Write page bytes into a file with corresponding checksums.
//!
//! @param offset - The offset where the write is to start. It must be
//! page aligned.
//! @param buffer - pointer to buffer containing the bytes to write.
//! @param wrlen - The number of bytes to write. If amount is not an
//! integral number of XrdSfsPageSize bytes, then this must
//! be the last write to the file at or above the offset.
//! @param csvec - A vector of [CEILING(wrlen/XrdSfsPageSize)] entries which
//! contain the corresponding CRC32 checksum for each page.
//! A nil pointer causes the checksums to be computed.
//! @param verify - When true, the checksum in csvec is verified for each
//! page; and error is returned if any checksum is incorrect.
//!
//!
//! @return >= 0 The number of bytes written.
//! @return SFS_ERROR File could not be read, error holds the reason.
//-----------------------------------------------------------------------------

virtual XrdSfsXferSize pgWrite(XrdSfsFileOffset offset,
char *buffer,
XrdSfsXferSize wrlen,
uint32_t *csvec,
bool verify=true)
{(void)offset; (void)buffer; (void)wrlen;
(void)csvec; (void)verify;
error.setErrInfo(ENOTSUP, "Not supported.");
return SFS_ERROR;
}

//-----------------------------------------------------------------------------
//! Get file's memory mapping if one exists (memory mapped files only).
//!
Expand Down Expand Up @@ -868,6 +928,17 @@ virtual int chmod(const char *path,
const XrdSecEntity *client = 0,
const char *opaque = 0) = 0;

//-----------------------------------------------------------------------------
//! Notify filesystem that a client has connected.
//!
//! @param client - Client's identify (see common description).
//-----------------------------------------------------------------------------

virtual void Connect(const XrdSecEntity *client = 0)
{
(void)client;
}

//-----------------------------------------------------------------------------
//! Notify filesystem that a client has disconnected.
//!
Expand Down Expand Up @@ -918,8 +989,8 @@ virtual int FAttr( XrdSfsFACtl *faReq,
//-----------------------------------------------------------------------------
//! Obtain file system feature set.
//!
//! @return The bit-wise featue set (i.e. this supported or configured).
//! See, include file XrdSfsFeatures.hh to actual values.
//! @return The bit-wise feature set (i.e. supported or configured).
//! See include file XrdSfsFlags.hh for actual bit values.
//-----------------------------------------------------------------------------

virtual uint64_t Features() {return 0;}
Expand Down

0 comments on commit 88988ab

Please sign in to comment.