support setting of inodes (using use_ino option)

creates a 64bit inode value from the underlying device value + original inode

final_ino = orig_ino | (dev << 32)

not perfect but given few filesystems use 64bit inodes nor is st_dev more than 16bit usually it should be fine
This commit is contained in:
Antonio SJ Musumeci 2016-12-11 18:27:52 -05:00
parent 365e153ae7
commit c8fa51c81a
6 changed files with 101 additions and 25 deletions

View file

@ -27,6 +27,8 @@
#include "fs_base_closedir.hpp"
#include "fs_base_opendir.hpp"
#include "fs_base_readdir.hpp"
#include "fs_base_stat.hpp"
#include "fs_inode.hpp"
#include "fs_path.hpp"
#include "readdir.hpp"
#include "rwlock.hpp"
@ -50,6 +52,7 @@ _readdir(const vector<string> &srcmounts,
struct stat st = {0};
StrSet names;
st.st_ino = fs::inode::MAGIC;
for(size_t i = 0, ei = srcmounts.size(); i != ei; i++)
{
DIR *dh;