"Fossies" - the Fresh Open Source Software Archive

Member "fuse-3.4.1/doc/html/fuse__common_8h_source.html" (22 Dec 2018, 66186 Bytes) of package /linux/misc/fuse-3.4.1.tar.xz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the FUSE project site itself.

libfuse
fuse_common.h
Go to the documentation of this file.
1 /* FUSE: Filesystem in Userspace
2  Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
3 
4  This program can be distributed under the terms of the GNU LGPLv2.
5  See the file COPYING.LIB.
6 */
7 
10 #if !defined(FUSE_H_) && !defined(FUSE_LOWLEVEL_H_)
11 #error "Never include <fuse_common.h> directly; use <fuse.h> or <fuse_lowlevel.h> instead."
12 #endif
13 
14 #ifndef FUSE_COMMON_H_
15 #define FUSE_COMMON_H_
16 
17 #include "fuse_opt.h"
18 #include <stdint.h>
19 #include <sys/types.h>
20 
22 #define FUSE_MAJOR_VERSION 3
23 
25 #define FUSE_MINOR_VERSION 2
26 
27 #define FUSE_MAKE_VERSION(maj, min) ((maj) * 10 + (min))
28 #define FUSE_VERSION FUSE_MAKE_VERSION(FUSE_MAJOR_VERSION, FUSE_MINOR_VERSION)
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
39  int flags;
40 
43  unsigned int writepage : 1;
44 
46  unsigned int direct_io : 1;
47 
51  unsigned int keep_cache : 1;
52 
56  unsigned int flush : 1;
57 
60  unsigned int nonseekable : 1;
61 
62  /* Indicates that flock locks for this file should be
63  released. If set, lock_owner shall contain a valid value.
64  May only be set in ->release(). */
65  unsigned int flock_release : 1;
66 
68  unsigned int padding : 27;
69 
72  uint64_t fh;
73 
75  uint64_t lock_owner;
76 
79  uint32_t poll_events;
80 };
81 
91  int clone_fd;
92 
103  unsigned int max_idle_threads;
104 };
105 
106 /**************************************************************************
107  * Capability bits for 'fuse_conn_info.capable' and 'fuse_conn_info.want' *
108  **************************************************************************/
109 
120 #define FUSE_CAP_ASYNC_READ (1 << 0)
121 
128 #define FUSE_CAP_POSIX_LOCKS (1 << 1)
129 
137 #define FUSE_CAP_ATOMIC_O_TRUNC (1 << 3)
138 
144 #define FUSE_CAP_EXPORT_SUPPORT (1 << 4)
145 
152 #define FUSE_CAP_DONT_MASK (1 << 6)
153 
160 #define FUSE_CAP_SPLICE_WRITE (1 << 7)
161 
168 #define FUSE_CAP_SPLICE_MOVE (1 << 8)
169 
177 #define FUSE_CAP_SPLICE_READ (1 << 9)
178 
190 #define FUSE_CAP_FLOCK_LOCKS (1 << 10)
191 
197 #define FUSE_CAP_IOCTL_DIR (1 << 11)
198 
219 #define FUSE_CAP_AUTO_INVAL_DATA (1 << 12)
220 
227 #define FUSE_CAP_READDIRPLUS (1 << 13)
228 
246 #define FUSE_CAP_READDIRPLUS_AUTO (1 << 14)
247 
257 #define FUSE_CAP_ASYNC_DIO (1 << 15)
258 
266 #define FUSE_CAP_WRITEBACK_CACHE (1 << 16)
267 
279 #define FUSE_CAP_NO_OPEN_SUPPORT (1 << 17)
280 
289 #define FUSE_CAP_PARALLEL_DIROPS (1 << 18)
290 
308 #define FUSE_CAP_POSIX_ACL (1 << 19)
309 
317 #define FUSE_CAP_HANDLE_KILLPRIV (1 << 20)
318 
329 #define FUSE_IOCTL_COMPAT (1 << 0)
330 #define FUSE_IOCTL_UNRESTRICTED (1 << 1)
331 #define FUSE_IOCTL_RETRY (1 << 2)
332 #define FUSE_IOCTL_DIR (1 << 4)
333 
334 #define FUSE_IOCTL_MAX_IOV 256
335 
347  unsigned proto_major;
348 
352  unsigned proto_minor;
353 
357  unsigned max_write;
358 
371  unsigned max_read;
372 
376  unsigned max_readahead;
377 
381  unsigned capable;
382 
389  unsigned want;
390 
419  unsigned max_background;
420 
430 
446  unsigned time_gran;
447 
451  unsigned reserved[22];
452 };
453 
454 struct fuse_session;
455 struct fuse_pollhandle;
456 struct fuse_conn_info_opts;
457 
500 struct fuse_conn_info_opts* fuse_parse_conn_info_opts(struct fuse_args *args);
501 
509 void fuse_apply_conn_info_opts(struct fuse_conn_info_opts *opts,
510  struct fuse_conn_info *conn);
511 
518 int fuse_daemonize(int foreground);
519 
525 int fuse_version(void);
526 
532 const char *fuse_pkgversion(void);
533 
539 void fuse_pollhandle_destroy(struct fuse_pollhandle *ph);
540 
541 /* ----------------------------------------------------------- *
542  * Data buffer *
543  * ----------------------------------------------------------- */
544 
555  FUSE_BUF_IS_FD = (1 << 1),
556 
564  FUSE_BUF_FD_SEEK = (1 << 2),
565 
573  FUSE_BUF_FD_RETRY = (1 << 3),
574 };
575 
589  FUSE_BUF_NO_SPLICE = (1 << 1),
590 
598 
607 
616 };
617 
624 struct fuse_buf {
628  size_t size;
629 
634 
640  void *mem;
641 
647  int fd;
648 
654  off_t pos;
655 };
656 
665 struct fuse_bufvec {
669  size_t count;
670 
674  size_t idx;
675 
679  size_t off;
680 
684  struct fuse_buf buf[1];
685 };
686 
687 /* Initialize bufvec with a single buffer of given size */
688 #define FUSE_BUFVEC_INIT(size__) \
689  ((struct fuse_bufvec) { \
690  /* .count= */ 1, \
691  /* .idx = */ 0, \
692  /* .off = */ 0, \
693  /* .buf = */ { /* [0] = */ { \
694  /* .size = */ (size__), \
695  /* .flags = */ (enum fuse_buf_flags) 0, \
696  /* .mem = */ NULL, \
697  /* .fd = */ -1, \
698  /* .pos = */ 0, \
699  } } \
700  } )
701 
708 size_t fuse_buf_size(const struct fuse_bufvec *bufv);
709 
718 ssize_t fuse_buf_copy(struct fuse_bufvec *dst, struct fuse_bufvec *src,
720 
721 /* ----------------------------------------------------------- *
722  * Signal handling *
723  * ----------------------------------------------------------- */
724 
740 int fuse_set_signal_handlers(struct fuse_session *se);
741 
753 void fuse_remove_signal_handlers(struct fuse_session *se);
754 
755 /* ----------------------------------------------------------- *
756  * Compatibility stuff *
757  * ----------------------------------------------------------- */
758 
759 #if !defined(FUSE_USE_VERSION) || FUSE_USE_VERSION < 30
760 # error only API version 30 or greater is supported
761 #endif
762 
763 #ifdef __cplusplus
764 }
765 #endif
766 
767 
768 /*
769  * This interface uses 64 bit off_t.
770  *
771  * On 32bit systems please add -D_FILE_OFFSET_BITS=64 to your compile flags!
772  */
773 
774 #if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 6) && !defined __cplusplus
775 _Static_assert(sizeof(off_t) == 8, "fuse: off_t must be 64bit");
776 #else
777 struct _fuse_off_t_must_be_64bit_dummy_struct \
778  { unsigned _fuse_off_t_must_be_64bit:((sizeof(off_t) == 8) ? 1 : -1); };
779 #endif
780 
781 #endif /* FUSE_COMMON_H_ */
size_t off
Definition: fuse_common.h:679
fuse_buf_flags
Definition: fuse_common.h:548
unsigned capable
Definition: fuse_common.h:381
uint64_t fh
Definition: fuse_common.h:72
unsigned int writepage
Definition: fuse_common.h:43
unsigned int direct_io
Definition: fuse_common.h:46
uint32_t poll_events
Definition: fuse_common.h:79
int fuse_daemonize(int foreground)
Definition: helper.c:225
unsigned max_write
Definition: fuse_common.h:357
unsigned proto_minor
Definition: fuse_common.h:352
unsigned int max_idle_threads
Definition: fuse_common.h:103
unsigned max_background
Definition: fuse_common.h:419
unsigned int keep_cache
Definition: fuse_common.h:51
uint64_t lock_owner
Definition: fuse_common.h:75
int fuse_set_signal_handlers(struct fuse_session *se)
Definition: fuse_signals.c:62
off_t pos
Definition: fuse_common.h:654
void fuse_remove_signal_handlers(struct fuse_session *se)
Definition: fuse_signals.c:79
int fuse_version(void)
Definition: fuse.c:5066
struct fuse_conn_info_opts * fuse_parse_conn_info_opts(struct fuse_args *args)
Definition: helper.c:408
void fuse_apply_conn_info_opts(struct fuse_conn_info_opts *opts, struct fuse_conn_info *conn)
Definition: helper.c:361
size_t idx
Definition: fuse_common.h:674
size_t count
Definition: fuse_common.h:669
unsigned int nonseekable
Definition: fuse_common.h:60
unsigned congestion_threshold
Definition: fuse_common.h:429
void fuse_pollhandle_destroy(struct fuse_pollhandle *ph)
unsigned int flush
Definition: fuse_common.h:56
unsigned max_read
Definition: fuse_common.h:371
unsigned max_readahead
Definition: fuse_common.h:376
unsigned proto_major
Definition: fuse_common.h:347
void * mem
Definition: fuse_common.h:640
unsigned want
Definition: fuse_common.h:389
const char * fuse_pkgversion(void)
Definition: fuse.c:5071
size_t fuse_buf_size(const struct fuse_bufvec *bufv)
Definition: buffer.c:22
ssize_t fuse_buf_copy(struct fuse_bufvec *dst, struct fuse_bufvec *src, enum fuse_buf_copy_flags flags)
Definition: buffer.c:281
size_t size
Definition: fuse_common.h:628
fuse_buf_copy_flags
Definition: fuse_common.h:579
unsigned int padding
Definition: fuse_common.h:68
unsigned time_gran
Definition: fuse_common.h:446