diff --git a/cloudfuse.c b/cloudfuse.c index 60c2af6..eccb833 100644 --- a/cloudfuse.c +++ b/cloudfuse.c @@ -32,12 +32,6 @@ extern bool option_enable_chown; extern bool option_enable_chmod; extern size_t file_buffer_size; -typedef struct -{ - int fd; - int flags; -} openfile; - static int cfs_getattr(const char* path, struct stat* stbuf) { debugf(DBG_LEVEL_NORM, KBLU "cfs_getattr(%s)", path); diff --git a/commonfs.c b/commonfs.c index c1b2c90..343e4c8 100644 --- a/commonfs.c +++ b/commonfs.c @@ -237,9 +237,10 @@ void debug_print_flags(int flags) void debug_print_descriptor(struct fuse_file_info* info) { char file_path[MAX_PATH_SIZE]; - get_file_path_from_fd(info->fh, file_path, sizeof(file_path)); - debugf(DBG_LEVEL_EXT, KCYN "descriptor localfile=[%s] fd=%d", file_path, - info->fh); + openfile* of = (openfile *)info->fh; + get_file_path_from_fd(of->fd, file_path, sizeof(file_path)); + debugf(DBG_LEVEL_EXT, KCYN "descriptor localfile=[%s] fd=%lld", file_path, + of->fd); debug_print_flags(info->flags); } diff --git a/commonfs.h b/commonfs.h index bdaa718..0270022 100644 --- a/commonfs.h +++ b/commonfs.h @@ -80,6 +80,12 @@ typedef struct dir_cache struct dir_cache* next, *prev; } dir_cache; +typedef struct +{ + int fd; + int flags; +} openfile; + time_t my_timegm(struct tm* tm); time_t get_time_from_str_as_gmt(char* time_str); time_t get_time_as_local(time_t time_t_val, char time_str[],