mirror of https://github.com/trapexit/mergerfs.git
Browse Source
support setting of inodes (using use_ino option)
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 finepull/349/head
Antonio SJ Musumeci
8 years ago
6 changed files with 101 additions and 25 deletions
-
9README.md
-
17man/mergerfs.1
-
10src/fgetattr.cpp
-
42src/fs_inode.hpp
-
39src/getattr.cpp
-
3src/readdir.cpp
@ -0,0 +1,42 @@ |
|||||
|
/*
|
||||
|
ISC License |
||||
|
|
||||
|
Copyright (c) 2016, Antonio SJ Musumeci <trapexit@spawn.link> |
||||
|
|
||||
|
Permission to use, copy, modify, and/or distribute this software for any |
||||
|
purpose with or without fee is hereby granted, provided that the above |
||||
|
copyright notice and this permission notice appear in all copies. |
||||
|
|
||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
||||
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
||||
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
||||
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
||||
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
||||
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
||||
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
||||
|
*/ |
||||
|
|
||||
|
#ifndef __FS_INODE_HPP__
|
||||
|
#define __FS_INODE_HPP__
|
||||
|
|
||||
|
#include <sys/stat.h>
|
||||
|
|
||||
|
namespace fs |
||||
|
{ |
||||
|
namespace inode |
||||
|
{ |
||||
|
enum |
||||
|
{ |
||||
|
MAGIC = 0x7472617065786974 |
||||
|
}; |
||||
|
|
||||
|
inline |
||||
|
void |
||||
|
recompute(struct stat &st) |
||||
|
{ |
||||
|
st.st_ino |= (st.st_dev << 32); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
#endif
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue