summaryrefslogtreecommitdiff
path: root/src/netfs.c
AgeCommit message (Collapse)Author
2013-03-30Switch from __thread to pthread_key_t for fuse_contextlibfuse/pinotree/fuse-improvements/masterPino Toscano
This allows to properly cleanup the per-thread context. * src/fuse_i.h (libfuse_ctx): Remove declaration. * src/main.c (libfuse_ctx): Remove variable. (libfuse_ctx_key): New variable. (fuse_destroy_context): New function. (fuse_create_key): Likewise. (fuse_new): Use fuse_get_context instead of libfuse_ctx. (fuse_get_context): Create fuse_create_key only once. Allocate a new struct fuse_context if needed, and return it. * src/netfs.c (update_context_struct): Use fuse_get_context instead of libfuse_ctx.
2013-03-24Fix context and user data handling at init timePino Toscano
Make sure, using an helper function, to have an existing context before calling the init fuse operation. Also, the USER_DATA arg of fuse_new must be set as new PRIVATE_DATA in the fuse context before calling the init fuse operation. * src/fuse_i.h (struct iouser): New forward declaration. (struct fuse): Remove field 'user_data'. (update_context_struct): New function. * src/main.c (fuse_new): Update LIBFUSE_CTX correctly before and after calling init. * src/netfs.c (refresh_context_struct): Call refresh_context_struct. (update_context_struct): New function, mostly derived from refresh_context_struct. Update CTX->FUSE and CTX->PRIVATE_DATA correctly.
2013-03-23Fix return values of some FUSE_OP_CALLPino Toscano
errno values returned by fuse operations are negative; thus turn them positive. * src/netfs.c (netfs_attempt_write, netfs_attempt_read, get_dirents_readdir): Negate FUSE_OP_CALL return values.
2013-03-23Fix readlinkPino Toscano
Instead of passing to the readlink operation a maximum size of INT_MAX, pass a better size based on the actual stat information. * src/netfs.c (netfs_attempt_readlink): Fix size arg of FUSE_OP_CALL(readlink).
2013-03-23netfs utimes: use the utimens operation if presentPino Toscano
Use the utimens fuse operation if present, otherwise fall back on utime. * src/netfs.c (netfs_attempt_utimes): Use the utimes op.
2013-03-22Create and use a fuse structPino Toscano
Introduce a fuse struct and use it to hold a copy of the fuse_operation and their version, and the private data returned by init. * src/fuse_i.h (struct fuse): New. (fuse_ops25): Remove. (libfuse_fuse): New. (FUSE_OP_HAVE, FUSE_OP_CALL): Use libfuse_fuse. (fsys_privdata): Remove. * src/main.c (fuse_ops25): Remove. (libfuse_fuse): New. (fsys_privdata): Remove. (fuse_new): Create and fill a fuse struct. (fuse_loop): Reject null F instead of anything but FUSE_MAGIC. Set LIBFUSE_FUSE as F. (fuse_loop_mt_proc): Likewise. (fuse_demuxer): Use libfuse_fuse. (fuse_process_cmd): Reject null F instead of anything but FUSE_MAGIC. * src/netfs.c (refresh_context_struct): Use libfuse_fuse.
2013-03-22Remove support for FUSE compatibility < 25Pino Toscano
While the default FUSE_USE_VERSION is 21, compatibility versions below 25 are rarely (if at all) used; keeping support for them is not worth, especially than they require a number of special casings all around (different fuse_operations and fuse_file_info). * src/fuse_i.h (fuse_ops_compat22, fuse_ops_compat2): Remove. (FUSE_OP_HAVE, FUSE_OP_CALL): Use only fuse_ops25. (FUSE_OP_HAVE22, FUSE_OP_CALL22): Remove. (NN_INFO, NN_INFO_APPLY): Use only info25. (struct netnode): Remove field 'compat22' in field union 'info'. * src/main.c (fuse_ops_compat22, fuse_ops_compat2, fuse_main_compat2) (fuse_main_compat2, fuse_main_real_compat22, fuse_new_compat2) (fuse_new_compat22, fuse_mount_compat22): Remove. * src/netfs.c (netfs_attempt_statfs, netfs_attempt_sync, netfs_attempt_write) (netfs_attempt_read, fuse_get_inode, get_dirents_getdir, get_dirents_readdir) (netfs_get_dirents): Use only FUSE_OP_CALL and FUSE_OP_HAVE. (get_dirents_getdir_helper_compat): Remove. * src/netnode.c (fuse_sync_filesystem): Use only FUSE_OP_CALL and NN_INFO.
2013-02-11Fix build against libpthreadSamuel Thibault
* configure.ac: Link against libpthread instead of libthreads. * fuse.pc.in: Likewise. * src/fuse_i.h (libfuse_ctx): Declare TLS variable. (netnode): Turn lock field from struct mutex to pthread_mutex_t. * src/main.c (libfuse_ctx): Define TLS variable. (fuse_get_context): Use libfuse_ctx instead of cthreads TSD. * src/netfs.c: Likewise. Use pthread functions instead of cthreads functions. Use fixed stat structure. * src/netnode.c: Likewise. * src/node.c: Likewise.
2006-08-05netfs_attempt_syncfs is called with cred==NULL on filesystem shutdown, ↵Stefan Siegl
changed it to not call test_allow_root_or_other in that case
2006-08-04added support for libfuse 2.5 apiStefan Siegl
2006-08-04added support for fuse contexts, including fuse_get_context functionStefan Siegl
2006-08-03call open and release callbacks on read/write even in fuse_ops_compat2 modeStefan Siegl
2006-04-13pulled in headers from fuse 2.5.3 and added examples. fuse_ops variable ↵Stefan Siegl
renamed to fuse_ops_compat22 (to make room for 2.5 api functions).
2006-01-30moved headers into new include/ directory, sources moved into new src/ ↵Stefan Siegl
directory.