From 88988abde3f97bc7d7e4441b009d4ed6eaca433b Mon Sep 17 00:00:00 2001 From: Andrew Hanushevsky Date: Mon, 7 Oct 2019 09:52:17 -0700 Subject: [PATCH] [SFS] Additional methods and flags for the future. --- src/XrdSfs/XrdSfsFlags.hh | 12 +----- src/XrdSfs/XrdSfsInterface.hh | 77 +++++++++++++++++++++++++++++++++-- 2 files changed, 75 insertions(+), 14 deletions(-) diff --git a/src/XrdSfs/XrdSfsFlags.hh b/src/XrdSfs/XrdSfsFlags.hh index 574016beacd..7ecce21a0f6 100644 --- a/src/XrdSfs/XrdSfsFlags.hh +++ b/src/XrdSfs/XrdSfsFlags.hh @@ -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; @@ -79,14 +79,4 @@ static const dev_t XRDSFS_HASBKUP = static_cast(0x40LL<<((sizeof(dev_t)*8)-8)); static const dev_t XRDSFS_RDVMASK = static_cast(~(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 diff --git a/src/XrdSfs/XrdSfsInterface.hh b/src/XrdSfs/XrdSfsInterface.hh index c57c0cdec88..2e0b61c8719 100644 --- a/src/XrdSfs/XrdSfsInterface.hh +++ b/src/XrdSfs/XrdSfsInterface.hh @@ -175,7 +175,6 @@ struct XrdSfsPrep //!< Prepare parameters /******************************************************************************/ class XrdOucEnv; -class XrdOucTList; class XrdSecEntity; struct XrdSfsFACtl; @@ -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). //! @@ -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. //! @@ -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;}