mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-12-01 12:26:34 -05:00
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:
parent
365e153ae7
commit
c8fa51c81a
6 changed files with 101 additions and 25 deletions
42
src/fs_inode.hpp
Normal file
42
src/fs_inode.hpp
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue