1 |
|
|
/** |
2 |
|
|
* This file is part of the CernVM File System. |
3 |
|
|
*/ |
4 |
|
|
|
5 |
|
|
#ifndef CVMFS_NFS_MAPS_H_ |
6 |
|
|
#define CVMFS_NFS_MAPS_H_ |
7 |
|
|
|
8 |
|
|
#ifndef __STDC_FORMAT_MACROS |
9 |
|
|
#define __STDC_FORMAT_MACROS |
10 |
|
|
#endif |
11 |
|
|
|
12 |
|
|
#include <inttypes.h> |
13 |
|
|
#include <stdint.h> |
14 |
|
|
|
15 |
|
|
#include <string> |
16 |
|
|
|
17 |
|
|
#include "logging.h" |
18 |
|
|
#include "shortstring.h" |
19 |
|
|
#include "util/single_copy.h" |
20 |
|
|
|
21 |
|
|
class NfsMaps : SingleCopy { |
22 |
|
|
public: |
23 |
|
|
virtual ~NfsMaps() { } |
24 |
|
|
virtual uint64_t GetInode(const PathString &path) = 0; |
25 |
|
|
virtual bool GetPath(const uint64_t inode, PathString *path) = 0; |
26 |
|
|
|
27 |
|
|
/** |
28 |
|
|
* Ensures that NFS maps inodes have the form an+b so that we can have |
29 |
|
|
* non-overlapping inodes for independent repositories. |
30 |
|
|
*/ |
31 |
|
|
virtual void SetInodeResidue(unsigned residue_class, unsigned remainder) { |
32 |
|
|
LogCvmfs(kLogNfsMaps, kLogSyslogWarn, |
33 |
|
|
"Warning: interleaved inode mode unsupported"); |
34 |
|
|
} |
35 |
|
|
|
36 |
|
|
virtual void Spawn() { } |
37 |
|
|
virtual std::string GetStatistics() { return ""; } |
38 |
|
|
}; |
39 |
|
|
|
40 |
|
|
#endif // CVMFS_NFS_MAPS_H_ |