improve nodeid generation

* Change fuse_ino_t to uint64_t
* Change id generation to 64bit
* Randomize generation value (should help with NFS)
This commit is contained in:
Antonio SJ Musumeci
2019-09-30 18:45:58 -04:00
parent b5f6cd70de
commit 08e1bef5a9
3 changed files with 152 additions and 102 deletions

View File

@ -25,12 +25,13 @@
#include "fuse_common.h"
#include <utime.h>
#include <fcntl.h>
#include <sys/types.h>
#include <stdint.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <utime.h>
#ifdef __cplusplus
extern "C" {
@ -44,7 +45,7 @@ extern "C" {
#define FUSE_ROOT_ID 1
/** Inode number type */
typedef unsigned long fuse_ino_t;
typedef uint64_t fuse_ino_t;
/** Request pointer type */
typedef struct fuse_req *fuse_req_t;
@ -88,7 +89,8 @@ struct fuse_entry_param {
* it as an error.
*
*/
unsigned long generation;
uint64_t generation;
/** Inode attributes.
*
@ -122,7 +124,7 @@ struct fuse_ctx {
};
struct fuse_forget_data {
uint64_t ino;
fuse_ino_t ino;
uint64_t nlookup;
};
@ -233,7 +235,7 @@ struct fuse_lowlevel_ops {
* @param ino the inode number
* @param nlookup the number of lookups to forget
*/
void (*forget) (fuse_req_t req, fuse_ino_t ino, unsigned long nlookup);
void (*forget) (fuse_req_t req, fuse_ino_t ino, uint64_t nlookup);
/**
* Get file attributes