2019-09-23 15:00:57 +03:00
|
|
|
/* $NetBSD: perfuse_priv.h,v 1.38 2019/09/23 12:00:57 christos Exp $ */
|
2010-08-25 11:16:00 +04:00
|
|
|
|
|
|
|
/*-
|
- Implement proper unprivilegied user permission verifications
Verification is now done in the lookup method, as it is the way to
go. Of course there are corner cases, such as the sticky bit which
need special handling in the remove method.
- Set full fsidx in vftstat method
- Do not pass O_APPEND to the filesystem. FUSE always sends the
write offset, so setting O_APPEND is useless. If the filesystem
uses it in an open(2) system call, it will even cause file
corruptions, since offsets given to pwrite(2) will be ignored.
This fix allows glusterfs to host a NetBSD ./build.sh -o build
- Do not use the FUSE access method, use getattr and check for
permission on our own. The problem is that a FUSE filesystem will
typically use the Linux-specific setfsuid() to perform access
control. If that is missing, any chack is likely to occur on
behalf of the user running the filesystem (typically root), causing
access method to return wrong information.
- When possible, avoid performing a getattr method call and use
cached value in puffs_node instead. We still retreive the latest
value by calling getattr when performing append write operation,
to minimize the chances that another writer appended since the
last time we did.
- Update puffs_node cached file size in write method
- Remove unused argument to perfuse_destroy_pn()
2011-04-25 08:54:53 +04:00
|
|
|
* Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
|
2010-08-25 11:16:00 +04:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PERFUSE_PRIV_H_
|
|
|
|
#define _PERFUSE_PRIV_H_
|
|
|
|
|
2012-04-08 19:13:06 +04:00
|
|
|
#include <unistd.h>
|
2010-08-25 11:16:00 +04:00
|
|
|
#include <syslog.h>
|
|
|
|
#include <paths.h>
|
|
|
|
#include <err.h>
|
|
|
|
#include <sysexits.h>
|
2012-04-08 19:13:06 +04:00
|
|
|
#include <signal.h>
|
2010-08-25 11:16:00 +04:00
|
|
|
#include <puffs.h>
|
|
|
|
|
|
|
|
#include "perfuse_if.h"
|
|
|
|
#include "fuse.h"
|
|
|
|
|
2012-07-21 09:49:42 +04:00
|
|
|
/* From src/sys/fs/puffs/puffs_vfsops.c */
|
|
|
|
#ifndef PUFFS_PNODEBUCKETS
|
|
|
|
#define PUFFS_PNODEBUCKETS 256
|
|
|
|
#endif /* PUFFS_PNODEBUCKETS */
|
|
|
|
|
2011-12-28 21:33:52 +04:00
|
|
|
#define PERFUSE_TRACECOUNT_MAX 4096
|
|
|
|
#define PERFUSE_TRACEPATH_MAX 256
|
|
|
|
struct perfuse_trace {
|
|
|
|
int pt_opcode;
|
|
|
|
char pt_path[PERFUSE_TRACEPATH_MAX];
|
|
|
|
char pt_extra[BUFSIZ];
|
|
|
|
int pt_error;
|
|
|
|
enum { inxchg, done } pt_status;
|
|
|
|
struct timespec pt_start;
|
|
|
|
struct timespec pt_end;
|
|
|
|
TAILQ_ENTRY(perfuse_trace) pt_list;
|
|
|
|
};
|
|
|
|
|
2012-07-21 09:49:42 +04:00
|
|
|
LIST_HEAD(perfuse_node_hashlist, perfuse_node_data);
|
2010-08-25 11:16:00 +04:00
|
|
|
struct perfuse_state {
|
|
|
|
void *ps_private; /* Private field for libperfuse user */
|
|
|
|
struct puffs_usermount *ps_pu;
|
|
|
|
struct puffs_node *ps_root;
|
2010-08-27 13:58:17 +04:00
|
|
|
uid_t ps_owner_uid;
|
2010-08-25 11:16:00 +04:00
|
|
|
int ps_flags;
|
|
|
|
#define PS_NO_ACCESS 0x0001 /* access is unimplemented; */
|
|
|
|
#define PS_NO_CREAT 0x0004 /* create is unimplemented */
|
|
|
|
#define PS_INLOOP 0x0008 /* puffs mainloop started */
|
2014-10-31 18:12:15 +03:00
|
|
|
#define PS_NO_FALLOCATE 0x0010 /* fallocate is unimplemented */
|
- Implement proper unprivilegied user permission verifications
Verification is now done in the lookup method, as it is the way to
go. Of course there are corner cases, such as the sticky bit which
need special handling in the remove method.
- Set full fsidx in vftstat method
- Do not pass O_APPEND to the filesystem. FUSE always sends the
write offset, so setting O_APPEND is useless. If the filesystem
uses it in an open(2) system call, it will even cause file
corruptions, since offsets given to pwrite(2) will be ignored.
This fix allows glusterfs to host a NetBSD ./build.sh -o build
- Do not use the FUSE access method, use getattr and check for
permission on our own. The problem is that a FUSE filesystem will
typically use the Linux-specific setfsuid() to perform access
control. If that is missing, any chack is likely to occur on
behalf of the user running the filesystem (typically root), causing
access method to return wrong information.
- When possible, avoid performing a getattr method call and use
cached value in puffs_node instead. We still retreive the latest
value by calling getattr when performing append write operation,
to minimize the chances that another writer appended since the
last time we did.
- Update puffs_node cached file size in write method
- Remove unused argument to perfuse_destroy_pn()
2011-04-25 08:54:53 +04:00
|
|
|
uint64_t ps_fsid;
|
2010-08-25 11:16:00 +04:00
|
|
|
uint32_t ps_max_readahead;
|
|
|
|
uint32_t ps_max_write;
|
|
|
|
uint64_t ps_syncreads;
|
|
|
|
uint64_t ps_syncwrites;
|
|
|
|
uint64_t ps_asyncreads;
|
|
|
|
uint64_t ps_asyncwrites;
|
|
|
|
char *ps_source;
|
|
|
|
char *ps_target;
|
|
|
|
char *ps_filesystemtype;
|
|
|
|
int ps_mountflags;
|
|
|
|
uint64_t ps_unique;
|
|
|
|
perfuse_new_msg_fn ps_new_msg;
|
|
|
|
perfuse_xchg_msg_fn ps_xchg_msg;
|
|
|
|
perfuse_destroy_msg_fn ps_destroy_msg;
|
|
|
|
perfuse_get_inhdr_fn ps_get_inhdr;
|
|
|
|
perfuse_get_inpayload_fn ps_get_inpayload;
|
|
|
|
perfuse_get_outhdr_fn ps_get_outhdr;
|
|
|
|
perfuse_get_outpayload_fn ps_get_outpayload;
|
2011-05-30 18:50:08 +04:00
|
|
|
perfuse_umount_fn ps_umount;
|
2011-12-28 21:33:52 +04:00
|
|
|
TAILQ_HEAD(,perfuse_trace) ps_trace;
|
|
|
|
uint64_t ps_tracecount;
|
2012-07-21 09:49:42 +04:00
|
|
|
struct perfuse_node_hashlist *ps_nidhash;
|
|
|
|
int ps_nnidhash;
|
|
|
|
int ps_nodecount;
|
|
|
|
int ps_xchgcount;
|
2010-08-25 11:16:00 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
== file close operations ==
- use PUFFS_KFLAG_WTCACHE to puffs_init so that all writes are
immediatly send to the filesystem, and we do not have anymore write
after inactive. As a consequence, we can close files at inactive
stage, and there is not any concern left with files opened at
create time. We also do not have anymore to open ourselves in readdir and
fsync.
- Fsync on close (inactive stage). That makes sure we will not need to
do these operations once the file is closed (FUSE want an open file).
short sircuit the request that come after the close, bu not fsinc'ing
closed files,
- Use PUFFS_KFLAG_IAONDEMAND to get less inactive calls
== Removed nodes ==
- more ENOENT retunred for operations on removed node (but there
are probably some still missing): getattr, ooen, setattr, fsync
- set PND_REMOVE before sending the UNLINK/RMDIR operations so that we avoid
races during UNLINK completion. Also set PND_REMOVED on node we overwirte
in rename
== Filehandle fixes ==
- queue open operation to avoid getting two fh for one file
- set FH in getattr, if the file is open
- Just requires a read FH for fsyncdir, as we always opendir in read
mode. Ok, this is misleading :-)
== Misc ==
- do not set FUSE_FATTR_ATIME_NOW in setattr, as we provide the time
- short circuit nilpotent operations in setattr
- add a filename diagnostic flag to dump file names
2010-09-23 20:02:34 +04:00
|
|
|
enum perfuse_qtype {
|
|
|
|
PCQ_READDIR,
|
|
|
|
PCQ_READ,
|
|
|
|
PCQ_WRITE,
|
|
|
|
PCQ_AFTERWRITE,
|
2010-09-29 12:01:10 +04:00
|
|
|
PCQ_OPEN,
|
2011-09-09 19:45:28 +04:00
|
|
|
PCQ_AFTERXCHG,
|
2012-07-21 09:49:42 +04:00
|
|
|
PCQ_RESIZE,
|
|
|
|
PCQ_REF
|
== file close operations ==
- use PUFFS_KFLAG_WTCACHE to puffs_init so that all writes are
immediatly send to the filesystem, and we do not have anymore write
after inactive. As a consequence, we can close files at inactive
stage, and there is not any concern left with files opened at
create time. We also do not have anymore to open ourselves in readdir and
fsync.
- Fsync on close (inactive stage). That makes sure we will not need to
do these operations once the file is closed (FUSE want an open file).
short sircuit the request that come after the close, bu not fsinc'ing
closed files,
- Use PUFFS_KFLAG_IAONDEMAND to get less inactive calls
== Removed nodes ==
- more ENOENT retunred for operations on removed node (but there
are probably some still missing): getattr, ooen, setattr, fsync
- set PND_REMOVE before sending the UNLINK/RMDIR operations so that we avoid
races during UNLINK completion. Also set PND_REMOVED on node we overwirte
in rename
== Filehandle fixes ==
- queue open operation to avoid getting two fh for one file
- set FH in getattr, if the file is open
- Just requires a read FH for fsyncdir, as we always opendir in read
mode. Ok, this is misleading :-)
== Misc ==
- do not set FUSE_FATTR_ATIME_NOW in setattr, as we provide the time
- short circuit nilpotent operations in setattr
- add a filename diagnostic flag to dump file names
2010-09-23 20:02:34 +04:00
|
|
|
};
|
2010-09-20 11:00:21 +04:00
|
|
|
|
2010-09-15 05:51:43 +04:00
|
|
|
#ifdef PERFUSE_DEBUG
|
2012-03-21 14:10:36 +04:00
|
|
|
extern const char * const perfuse_qtypestr[];
|
2010-09-15 05:51:43 +04:00
|
|
|
#endif
|
2010-08-25 11:16:00 +04:00
|
|
|
|
|
|
|
struct perfuse_cc_queue {
|
|
|
|
enum perfuse_qtype pcq_type;
|
|
|
|
struct puffs_cc *pcq_cc;
|
|
|
|
TAILQ_ENTRY(perfuse_cc_queue) pcq_next;
|
2012-07-21 09:49:42 +04:00
|
|
|
const char *pcq_func;
|
|
|
|
int pcq_line;
|
2010-08-25 11:16:00 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct perfuse_node_data {
|
- Postpone file close at reclaim time, since NetBSD sends fsync and
setattr(mtime, ctime) after close, while FUSE expects the file
to be open for these operations
- remove unused argument to node_mk_common()
- remove requeued requests when they are executed, not when they
are tagged for schedule
- try to make filehandle management simplier, by keeping track of only
one read and one write filehandle (the latter being really read/write).
- when CREATE is not available, we use the MKNOD/OPEN path. Fix a
bug here where we opened the parent directory instead of the node:
add the missing lookup of the mknod'ed node.
- lookup file we just created: glusterfs does not really see them
otherwise.
- open file when doing setattr(mtime, ctime) on non open files, as
some filesystems seems to require it.
- Do not flush pagecache for removed nodes
- Keep track of read/write operations in progress, and at reclaim
time, make sure they are over before closing and forgeting the file.
2010-09-03 11:15:18 +04:00
|
|
|
uint64_t pnd_rfh;
|
|
|
|
uint64_t pnd_wfh;
|
2011-10-30 09:11:37 +04:00
|
|
|
uint64_t pnd_nodeid; /* nodeid, this is not inode */
|
2012-07-21 09:49:42 +04:00
|
|
|
uint64_t pnd_parent_nodeid; /* parent's nodeid */
|
|
|
|
uint32_t pnd_hashidx; /* node hash index */
|
2012-03-08 18:58:57 +04:00
|
|
|
uint64_t pnd_fuse_nlookup; /* vnode refcount */
|
|
|
|
int pnd_puffs_nlookup; /* vnode refcount */
|
2010-08-25 11:16:00 +04:00
|
|
|
uint64_t pnd_lock_owner;
|
|
|
|
struct dirent *pnd_dirent; /* native buffer for readdir */
|
2010-09-06 05:17:05 +04:00
|
|
|
off_t pnd_dirent_len;
|
2010-08-25 11:16:00 +04:00
|
|
|
struct fuse_dirent *pnd_all_fd; /* FUSE buffer for readdir */
|
|
|
|
size_t pnd_all_fd_len;
|
2011-07-14 19:37:32 +04:00
|
|
|
uint64_t pnd_fd_cookie; /* opaque readdir ref from fs */
|
2010-08-25 11:16:00 +04:00
|
|
|
TAILQ_HEAD(,perfuse_cc_queue) pnd_pcq; /* queued requests */
|
|
|
|
int pnd_flags;
|
2010-09-20 11:00:21 +04:00
|
|
|
#define PND_RECLAIMED 0x001 /* reclaim pending */
|
|
|
|
#define PND_INREADDIR 0x002 /* readdir in progress */
|
|
|
|
#define PND_DIRTY 0x004 /* There is some data to sync */
|
|
|
|
#define PND_RFH 0x008 /* Read FH allocated */
|
|
|
|
#define PND_WFH 0x010 /* Write FH allocated */
|
|
|
|
#define PND_REMOVED 0x020 /* Node was removed */
|
|
|
|
#define PND_INWRITE 0x040 /* write in progress */
|
== file close operations ==
- use PUFFS_KFLAG_WTCACHE to puffs_init so that all writes are
immediatly send to the filesystem, and we do not have anymore write
after inactive. As a consequence, we can close files at inactive
stage, and there is not any concern left with files opened at
create time. We also do not have anymore to open ourselves in readdir and
fsync.
- Fsync on close (inactive stage). That makes sure we will not need to
do these operations once the file is closed (FUSE want an open file).
short sircuit the request that come after the close, bu not fsinc'ing
closed files,
- Use PUFFS_KFLAG_IAONDEMAND to get less inactive calls
== Removed nodes ==
- more ENOENT retunred for operations on removed node (but there
are probably some still missing): getattr, ooen, setattr, fsync
- set PND_REMOVE before sending the UNLINK/RMDIR operations so that we avoid
races during UNLINK completion. Also set PND_REMOVED on node we overwirte
in rename
== Filehandle fixes ==
- queue open operation to avoid getting two fh for one file
- set FH in getattr, if the file is open
- Just requires a read FH for fsyncdir, as we always opendir in read
mode. Ok, this is misleading :-)
== Misc ==
- do not set FUSE_FATTR_ATIME_NOW in setattr, as we provide the time
- short circuit nilpotent operations in setattr
- add a filename diagnostic flag to dump file names
2010-09-23 20:02:34 +04:00
|
|
|
#define PND_INOPEN 0x100 /* open in progress */
|
2012-07-21 09:49:42 +04:00
|
|
|
#define PND_INVALID 0x400 /* node freed, usage is a bug */
|
2011-09-09 19:45:28 +04:00
|
|
|
#define PND_INRESIZE 0x800 /* resize in progress */
|
- Postpone file close at reclaim time, since NetBSD sends fsync and
setattr(mtime, ctime) after close, while FUSE expects the file
to be open for these operations
- remove unused argument to node_mk_common()
- remove requeued requests when they are executed, not when they
are tagged for schedule
- try to make filehandle management simplier, by keeping track of only
one read and one write filehandle (the latter being really read/write).
- when CREATE is not available, we use the MKNOD/OPEN path. Fix a
bug here where we opened the parent directory instead of the node:
add the missing lookup of the mknod'ed node.
- lookup file we just created: glusterfs does not really see them
otherwise.
- open file when doing setattr(mtime, ctime) on non open files, as
some filesystems seems to require it.
- Do not flush pagecache for removed nodes
- Keep track of read/write operations in progress, and at reclaim
time, make sure they are over before closing and forgeting the file.
2010-09-03 11:15:18 +04:00
|
|
|
|
|
|
|
#define PND_OPEN (PND_RFH|PND_WFH) /* File is open */
|
== file close operations ==
- use PUFFS_KFLAG_WTCACHE to puffs_init so that all writes are
immediatly send to the filesystem, and we do not have anymore write
after inactive. As a consequence, we can close files at inactive
stage, and there is not any concern left with files opened at
create time. We also do not have anymore to open ourselves in readdir and
fsync.
- Fsync on close (inactive stage). That makes sure we will not need to
do these operations once the file is closed (FUSE want an open file).
short sircuit the request that come after the close, bu not fsinc'ing
closed files,
- Use PUFFS_KFLAG_IAONDEMAND to get less inactive calls
== Removed nodes ==
- more ENOENT retunred for operations on removed node (but there
are probably some still missing): getattr, ooen, setattr, fsync
- set PND_REMOVE before sending the UNLINK/RMDIR operations so that we avoid
races during UNLINK completion. Also set PND_REMOVED on node we overwirte
in rename
== Filehandle fixes ==
- queue open operation to avoid getting two fh for one file
- set FH in getattr, if the file is open
- Just requires a read FH for fsyncdir, as we always opendir in read
mode. Ok, this is misleading :-)
== Misc ==
- do not set FUSE_FATTR_ATIME_NOW in setattr, as we provide the time
- short circuit nilpotent operations in setattr
- add a filename diagnostic flag to dump file names
2010-09-23 20:02:34 +04:00
|
|
|
#define PND_BUSY (PND_INREADDIR|PND_INWRITE|PND_INOPEN)
|
2012-07-21 09:49:42 +04:00
|
|
|
|
|
|
|
LIST_ENTRY(perfuse_node_data) pnd_nident;
|
2010-09-20 11:00:21 +04:00
|
|
|
puffs_cookie_t pnd_pn;
|
2010-10-03 09:46:47 +04:00
|
|
|
char pnd_name[MAXPATHLEN]; /* node name */
|
2012-07-21 09:49:42 +04:00
|
|
|
struct timespec pnd_cn_expire;
|
|
|
|
int pnd_inxchg;
|
|
|
|
int pnd_ref;
|
2010-08-25 11:16:00 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#define PERFUSE_NODE_DATA(opc) \
|
|
|
|
((struct perfuse_node_data *)puffs_pn_getpriv((struct puffs_node *)opc))
|
|
|
|
|
|
|
|
|
|
|
|
#define UNSPEC_REPLY_LEN PERFUSE_UNSPEC_REPLY_LEN /* shorter! */
|
|
|
|
#define NO_PAYLOAD_REPLY_LEN 0
|
|
|
|
|
|
|
|
#define GET_INHDR(ps, pm) ps->ps_get_inhdr(pm)
|
|
|
|
#define GET_INPAYLOAD(ps, pm, type) \
|
|
|
|
(struct type *)(void *)ps->ps_get_inpayload(pm)
|
|
|
|
#define _GET_INPAYLOAD(ps, pm, type) (type)ps->ps_get_inpayload(pm)
|
|
|
|
#define GET_OUTHDR(ps, pm) ps->ps_get_outhdr(pm)
|
|
|
|
#define GET_OUTPAYLOAD(ps, pm, type) \
|
|
|
|
(struct type *)(void *)ps->ps_get_outpayload(pm)
|
|
|
|
#define _GET_OUTPAYLOAD(ps, pm, type) (type)ps->ps_get_outpayload(pm)
|
|
|
|
|
|
|
|
__BEGIN_DECLS
|
|
|
|
|
2010-10-03 09:46:47 +04:00
|
|
|
struct puffs_node *perfuse_new_pn(struct puffs_usermount *, const char *,
|
2010-08-25 11:16:00 +04:00
|
|
|
struct puffs_node *);
|
2012-07-21 09:49:42 +04:00
|
|
|
void perfuse_destroy_pn(struct puffs_usermount *, struct puffs_node *);
|
== file close operations ==
- use PUFFS_KFLAG_WTCACHE to puffs_init so that all writes are
immediatly send to the filesystem, and we do not have anymore write
after inactive. As a consequence, we can close files at inactive
stage, and there is not any concern left with files opened at
create time. We also do not have anymore to open ourselves in readdir and
fsync.
- Fsync on close (inactive stage). That makes sure we will not need to
do these operations once the file is closed (FUSE want an open file).
short sircuit the request that come after the close, bu not fsinc'ing
closed files,
- Use PUFFS_KFLAG_IAONDEMAND to get less inactive calls
== Removed nodes ==
- more ENOENT retunred for operations on removed node (but there
are probably some still missing): getattr, ooen, setattr, fsync
- set PND_REMOVE before sending the UNLINK/RMDIR operations so that we avoid
races during UNLINK completion. Also set PND_REMOVED on node we overwirte
in rename
== Filehandle fixes ==
- queue open operation to avoid getting two fh for one file
- set FH in getattr, if the file is open
- Just requires a read FH for fsyncdir, as we always opendir in read
mode. Ok, this is misleading :-)
== Misc ==
- do not set FUSE_FATTR_ATIME_NOW in setattr, as we provide the time
- short circuit nilpotent operations in setattr
- add a filename diagnostic flag to dump file names
2010-09-23 20:02:34 +04:00
|
|
|
void perfuse_new_fh(puffs_cookie_t, uint64_t, int);
|
2010-08-25 11:16:00 +04:00
|
|
|
void perfuse_destroy_fh(puffs_cookie_t, uint64_t);
|
- Postpone file close at reclaim time, since NetBSD sends fsync and
setattr(mtime, ctime) after close, while FUSE expects the file
to be open for these operations
- remove unused argument to node_mk_common()
- remove requeued requests when they are executed, not when they
are tagged for schedule
- try to make filehandle management simplier, by keeping track of only
one read and one write filehandle (the latter being really read/write).
- when CREATE is not available, we use the MKNOD/OPEN path. Fix a
bug here where we opened the parent directory instead of the node:
add the missing lookup of the mknod'ed node.
- lookup file we just created: glusterfs does not really see them
otherwise.
- open file when doing setattr(mtime, ctime) on non open files, as
some filesystems seems to require it.
- Do not flush pagecache for removed nodes
- Keep track of read/write operations in progress, and at reclaim
time, make sure they are over before closing and forgeting the file.
2010-09-03 11:15:18 +04:00
|
|
|
uint64_t perfuse_get_fh(puffs_cookie_t, int);
|
2010-08-25 11:16:00 +04:00
|
|
|
uint64_t perfuse_next_unique(struct puffs_usermount *);
|
2012-07-21 09:49:42 +04:00
|
|
|
char *perfuse_node_path(struct perfuse_state *, puffs_cookie_t);
|
2010-09-20 11:00:21 +04:00
|
|
|
int perfuse_node_close_common(struct puffs_usermount *, puffs_cookie_t, int);
|
2014-08-10 07:22:33 +04:00
|
|
|
int perfuse_ns_match(const int, const char *);
|
2011-06-28 20:19:16 +04:00
|
|
|
const char *perfuse_native_ns(const int, const char *, char *);
|
2010-08-25 11:16:00 +04:00
|
|
|
|
|
|
|
char *perfuse_fs_mount(int, ssize_t);
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
2011-06-28 20:19:16 +04:00
|
|
|
* ops.c - filesystem operations
|
2010-08-25 11:16:00 +04:00
|
|
|
*/
|
|
|
|
int perfuse_fs_unmount(struct puffs_usermount *, int);
|
2019-09-23 15:00:57 +03:00
|
|
|
int perfuse_fs_statvfs(struct puffs_usermount *, struct puffs_statvfs *);
|
2010-08-25 11:16:00 +04:00
|
|
|
int perfuse_fs_sync(struct puffs_usermount *, int,
|
|
|
|
const struct puffs_cred *);
|
|
|
|
int perfuse_fs_fhtonode(struct puffs_usermount *, void *, size_t,
|
|
|
|
struct puffs_newinfo *);
|
|
|
|
int perfuse_fs_nodetofh(struct puffs_usermount *, puffs_cookie_t,
|
|
|
|
void *, size_t *);
|
|
|
|
void perfuse_fs_suspend(struct puffs_usermount *, int);
|
|
|
|
int perfuse_node_lookup(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, struct puffs_newinfo *, const struct puffs_cn *);
|
|
|
|
int perfuse_node_create(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, struct puffs_newinfo *, const struct puffs_cn *,
|
|
|
|
const struct vattr *);
|
|
|
|
int perfuse_node_mknod(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, struct puffs_newinfo *, const struct puffs_cn *,
|
|
|
|
const struct vattr *);
|
|
|
|
int perfuse_node_open(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, int, const struct puffs_cred *);
|
|
|
|
int perfuse_node_close(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, int, const struct puffs_cred *);
|
|
|
|
int perfuse_node_access(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, int, const struct puffs_cred *);
|
|
|
|
int perfuse_node_getattr(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, struct vattr *, const struct puffs_cred *);
|
|
|
|
int perfuse_node_setattr(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, const struct vattr *, const struct puffs_cred *);
|
|
|
|
int perfuse_node_poll(struct puffs_usermount *, puffs_cookie_t, int *);
|
|
|
|
int perfuse_node_fsync(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, const struct puffs_cred *, int, off_t, off_t);
|
|
|
|
int perfuse_node_remove(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, puffs_cookie_t, const struct puffs_cn *);
|
|
|
|
int perfuse_node_link(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, puffs_cookie_t, const struct puffs_cn *);
|
|
|
|
int perfuse_node_rename(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, puffs_cookie_t, const struct puffs_cn *,
|
|
|
|
puffs_cookie_t, puffs_cookie_t, const struct puffs_cn *);
|
|
|
|
int perfuse_node_mkdir(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, struct puffs_newinfo *, const struct puffs_cn *,
|
|
|
|
const struct vattr *);
|
|
|
|
int perfuse_node_rmdir(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, puffs_cookie_t, const struct puffs_cn *);
|
|
|
|
int perfuse_node_symlink(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, struct puffs_newinfo *, const struct puffs_cn *,
|
|
|
|
const struct vattr *, const char *);
|
|
|
|
int perfuse_node_readdir(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, struct dirent *, off_t *, size_t *,
|
|
|
|
const struct puffs_cred *, int *, off_t *, size_t *);
|
|
|
|
int perfuse_node_readlink(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, const struct puffs_cred *, char *, size_t *);
|
|
|
|
int perfuse_node_reclaim(struct puffs_usermount *, puffs_cookie_t);
|
2018-11-16 05:39:02 +03:00
|
|
|
int perfuse_node_reclaim2(struct puffs_usermount *, puffs_cookie_t, int);
|
2010-08-25 11:16:00 +04:00
|
|
|
int perfuse_node_inactive(struct puffs_usermount *, puffs_cookie_t);
|
|
|
|
int perfuse_node_print(struct puffs_usermount *, puffs_cookie_t);
|
|
|
|
int perfuse_node_pathconf(struct puffs_usermount *,
|
2014-09-04 03:59:58 +04:00
|
|
|
puffs_cookie_t, int, register_t *);
|
2010-08-25 11:16:00 +04:00
|
|
|
int perfuse_node_advlock(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, void *, int, struct flock *, int);
|
|
|
|
int perfuse_node_read(struct puffs_usermount *, puffs_cookie_t,
|
|
|
|
uint8_t *, off_t, size_t *, const struct puffs_cred *, int);
|
|
|
|
int perfuse_node_write(struct puffs_usermount *, puffs_cookie_t,
|
|
|
|
uint8_t *, off_t, size_t *, const struct puffs_cred *, int);
|
2012-07-21 09:49:42 +04:00
|
|
|
int perfuse_node_write2(struct puffs_usermount *, puffs_cookie_t,
|
|
|
|
uint8_t *, off_t, size_t *, const struct puffs_cred *, int, int);
|
2014-08-16 20:28:43 +04:00
|
|
|
int perfuse_node_open2(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, int, const struct puffs_cred *, int *);
|
2010-08-25 11:16:00 +04:00
|
|
|
void perfuse_cache_write(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, size_t, struct puffs_cacherun *);
|
2011-06-28 20:19:16 +04:00
|
|
|
int perfuse_node_getextattr(struct puffs_usermount *, puffs_cookie_t,
|
|
|
|
int, const char *, size_t *, uint8_t *, size_t *,
|
|
|
|
const struct puffs_cred *);
|
|
|
|
int perfuse_node_setextattr(struct puffs_usermount *, puffs_cookie_t,
|
|
|
|
int, const char *, uint8_t *, size_t *, const struct puffs_cred *);
|
|
|
|
int perfuse_node_listextattr(struct puffs_usermount *, puffs_cookie_t,
|
2011-07-04 12:07:29 +04:00
|
|
|
int, size_t *, uint8_t *, size_t *, int, const struct puffs_cred *);
|
2011-06-28 20:19:16 +04:00
|
|
|
int perfuse_node_deleteextattr(struct puffs_usermount *, puffs_cookie_t,
|
|
|
|
int, const char *, const struct puffs_cred *);
|
2012-04-18 04:57:21 +04:00
|
|
|
int perfuse_node_getattr_ttl(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, struct vattr *, const struct puffs_cred *,
|
|
|
|
struct timespec *);
|
|
|
|
int perfuse_node_setattr_ttl(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, struct vattr *, const struct puffs_cred *,
|
2012-07-21 09:49:42 +04:00
|
|
|
struct timespec *, int);
|
2014-10-31 18:12:15 +03:00
|
|
|
int perfuse_node_fallocate(struct puffs_usermount *,
|
|
|
|
puffs_cookie_t, off_t, off_t);
|
2010-08-25 11:16:00 +04:00
|
|
|
|
2012-01-29 10:22:01 +04:00
|
|
|
struct perfuse_trace *perfuse_trace_begin(struct perfuse_state *,
|
|
|
|
puffs_cookie_t, perfuse_msg_t *);
|
|
|
|
void perfuse_trace_end(struct perfuse_state *, struct perfuse_trace *, int);
|
2011-12-28 21:33:52 +04:00
|
|
|
char *perfuse_opdump_in(struct perfuse_state *, perfuse_msg_t *);
|
2012-07-21 09:49:42 +04:00
|
|
|
struct perfuse_node_data *perfuse_node_bynodeid(struct perfuse_state *,
|
|
|
|
uint64_t);
|
|
|
|
void perfuse_node_cache(struct perfuse_state *, puffs_cookie_t);
|
|
|
|
void perfuse_cache_flush(puffs_cookie_t);
|
2011-12-28 21:33:52 +04:00
|
|
|
|
2010-08-25 11:16:00 +04:00
|
|
|
__END_DECLS
|
|
|
|
|
|
|
|
#endif /* _PERFUSE_PRIV_H_ */
|