Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-01-08 10:33:39

0001 #ifndef __SFS_FLAGS_H__
0002 #define __SFS_FLAGS_H__
0003 /******************************************************************************/
0004 /*                                                                            */
0005 /*                        X r d S f s F l a g s . h h                         */
0006 /*                                                                            */
0007 /*(c) 2014 by the Board of Trustees of the Leland Stanford, Jr., University   */
0008 /*Produced by Andrew Hanushevsky for Stanford University under contract       */
0009 /*           DE-AC02-76-SFO0515 with the Deprtment of Energy                  */
0010 /*                                                                            */
0011 /* This file is part of the XRootD software suite.                            */
0012 /*                                                                            */
0013 /* XRootD is free software: you can redistribute it and/or modify it under    */
0014 /* the terms of the GNU Lesser General Public License as published by the     */
0015 /* Free Software Foundation, either version 3 of the License, or (at your     */
0016 /* option) any later version.                                                 */
0017 /*                                                                            */
0018 /* XRootD is distributed in the hope that it will be useful, but WITHOUT      */
0019 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      */
0020 /* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public       */
0021 /* License for more details.                                                  */
0022 /*                                                                            */
0023 /* You should have received a copy of the GNU Lesser General Public License   */
0024 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file  */
0025 /* COPYING (GPL license).  If not, see <http://www.gnu.org/licenses/>.        */
0026 /*                                                                            */
0027 /* The copyright holder's institutional names and contributor's names may not */
0028 /* be used to endorse or promote products derived from this software without  */
0029 /* specific prior written permission of the institution or contributor.       */
0030 /******************************************************************************/
0031 
0032 #include <cstdint>
0033 #include <sys/stat.h>
0034 #include <fcntl.h>
0035 
0036 //-----------------------------------------------------------------------------
0037 //! This include file defines certain flags that can be used by various Sfs
0038 //! plug-ins to passthrough features and special attributes of regular files.
0039 //-----------------------------------------------------------------------------
0040 
0041 namespace XrdSfs
0042 {
0043 //! Feature: Authorization
0044 static const uint64_t hasAUTZ = 0x0000000000000001LL;
0045 
0046 //! Feature: Checkpointing
0047 static const uint64_t hasCHKP = 0x0000000000000002LL;
0048 
0049 //! Feature: gpFile
0050 static const uint64_t hasGPF  = 0x0000000000000004LL;
0051 
0052 //! Feature: gpFile anonymous
0053 static const uint64_t hasGPFA = 0x0000000000000008LL;
0054 
0055 //! Feature: pgRead and pgWrite
0056 static const uint64_t hasPGRW = 0x0000000000000010LL;
0057 
0058 //! Feature: Persist On Successful Close
0059 static const uint64_t hasPOSC = 0x0000000000000020LL;
0060 
0061 //! Feature: Prepare Handler Version 2 (different calling conventions)
0062 static const uint64_t hasPRP2 = 0x0000000000000040LL;
0063 
0064 //! Feature: Proxy Server
0065 static const uint64_t hasPRXY = 0x0000000000000080LL;
0066 
0067 //! Feature: Supports SfsXio
0068 static const uint64_t hasSXIO = 0x0000000000000100LL;
0069 
0070 //! Feature: Supports no sendfile
0071 static const uint64_t hasNOSF = 0x0000000000000200LL;
0072 
0073 //! Feature: Implements a data cache
0074 static const uint64_t hasCACH = 0x0000000000000400LL;
0075 
0076 //! Feature: Supports no async I/O
0077 static const uint64_t hasNAIO = 0x0000000000000800LL;
0078 }
0079 
0080 //-----------------------------------------------------------------------------
0081 //! The following flags define the mode bit that can be used to mark a file
0082 //! as close pending. This varies depending on the platform. This supports the
0083 //! Persist On Successful Close (POSC) feature in an efficient way.
0084 //-----------------------------------------------------------------------------
0085 
0086 #ifdef __solaris__
0087 #define XRDSFS_POSCPEND S_ISUID
0088 #else
0089 #define XRDSFS_POSCPEND S_ISVTX
0090 #endif
0091 
0092 //-----------------------------------------------------------------------------
0093 //! The following bits may be set in the st_rdev member of the stat() structure
0094 //! to indicate special attributes of a regular file. These bits are inspected
0095 //! only when the remaining bits identified by XRD_RDVMASK are set to zero.
0096 //! For backward compatibility, offline status is also assumed when st_dev and
0097 //! st_ino are both set to zero.
0098 //-----------------------------------------------------------------------------
0099 
0100 static const dev_t XRDSFS_OFFLINE =
0101                    static_cast<dev_t>(0x80LL<<((sizeof(dev_t)*8)-8));
0102 static const dev_t XRDSFS_HASBKUP =
0103                    static_cast<dev_t>(0x40LL<<((sizeof(dev_t)*8)-8));
0104 static const dev_t XRDSFS_RDVMASK =
0105                    static_cast<dev_t>(~(0xffLL<<((sizeof(dev_t)*8)-8)));
0106 #endif