Add statx support

This commit is contained in:
Antonio SJ Musumeci 2025-03-30 18:06:30 -05:00
parent b85cc8c370
commit 80085c9844
11 changed files with 446 additions and 3 deletions

View file

@ -16,9 +16,10 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "fs_inode.hpp"
#include "ef.hpp"
#include "errno.hpp"
#include "fs_inode.hpp"
#include "rapidhash.h"
#include <cstdint>
@ -39,7 +40,9 @@ static
uint32_t
h64_to_h32(uint64_t h_)
{
return (h_ - (h_ >> 32));
h_ ^= (h_ >> 32);
h_ *= 0x9E3779B9;
return h_;
}
static
@ -227,6 +230,18 @@ namespace fs
st_->st_ino);
}
void
calc(const char *fusepath_,
const uint64_t fusepath_len_,
struct fuse_statx *st_)
{
st_->ino = calc(fusepath_,
fusepath_len_,
st_->mode,
st_->dev_major ^ st_->dev_minor,
st_->ino);
}
void
calc(const char *fusepath_,
struct stat *st_)
@ -234,6 +249,13 @@ namespace fs
calc(fusepath_,strlen(fusepath_),st_);
}
void
calc(const char *fusepath_,
struct fuse_statx *st_)
{
calc(fusepath_,strlen(fusepath_),st_);
}
void
calc(const std::string &fusepath_,
struct stat *st_)