2007-09-28 03:10:42 +04:00
|
|
|
/* $NetBSD: puffs_msgif.h,v 1.52 2007/09/27 23:10:42 pooka Exp $ */
|
2006-10-23 02:43:23 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Development of this software was supported by the
|
|
|
|
* Google Summer of Code program and the Ulla Tuominen Foundation.
|
|
|
|
* The Google SoC project was mentored by Bill Studenmund.
|
|
|
|
*
|
|
|
|
* 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 AUTHOR ``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 AUTHOR 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.
|
|
|
|
*/
|
|
|
|
|
2007-08-15 18:19:19 +04:00
|
|
|
#ifndef _FS_PUFFS_PUFFS_MSGIF_H_
|
|
|
|
#define _FS_PUFFS_PUFFS_MSGIF_H_
|
2006-10-23 02:43:23 +04:00
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <sys/ioccom.h>
|
|
|
|
#include <sys/uio.h>
|
|
|
|
#include <sys/vnode.h>
|
|
|
|
#include <sys/ucred.h>
|
|
|
|
#include <sys/statvfs.h>
|
|
|
|
#include <sys/dirent.h>
|
|
|
|
#include <sys/fcntl.h>
|
|
|
|
|
2007-07-27 13:18:54 +04:00
|
|
|
#include <uvm/uvm_prot.h>
|
|
|
|
|
2007-09-28 01:14:49 +04:00
|
|
|
#define PUFFSOP_VFS 0x01
|
|
|
|
#define PUFFSOP_VN 0x02
|
|
|
|
#define PUFFSOP_CACHE 0x03
|
|
|
|
#define PUFFSOP_ERROR 0x04
|
2006-11-08 01:10:18 +03:00
|
|
|
#define PUFFSOPFLAG_FAF 0x10 /* fire-and-forget */
|
|
|
|
|
2007-09-28 01:14:49 +04:00
|
|
|
#define PUFFSOP_OPCMASK 0x07
|
2006-11-08 01:10:18 +03:00
|
|
|
#define PUFFSOP_OPCLASS(a) ((a) & PUFFSOP_OPCMASK)
|
2006-11-09 16:09:34 +03:00
|
|
|
#define PUFFSOP_WANTREPLY(a) (((a) & PUFFSOPFLAG_FAF) == 0)
|
2006-10-23 02:43:23 +04:00
|
|
|
|
2006-12-01 15:37:41 +03:00
|
|
|
/* XXX: we don't need everything */
|
2006-10-23 02:43:23 +04:00
|
|
|
enum {
|
|
|
|
PUFFS_VFS_MOUNT, PUFFS_VFS_START, PUFFS_VFS_UNMOUNT,
|
|
|
|
PUFFS_VFS_ROOT, PUFFS_VFS_STATVFS, PUFFS_VFS_SYNC,
|
|
|
|
PUFFS_VFS_VGET, PUFFS_VFS_FHTOVP, PUFFS_VFS_VPTOFH,
|
|
|
|
PUFFS_VFS_INIT, PUFFS_VFS_DONE, PUFFS_VFS_SNAPSHOT,
|
2007-01-27 01:59:49 +03:00
|
|
|
PUFFS_VFS_EXTATTCTL, PUFFS_VFS_SUSPEND
|
2006-10-23 02:43:23 +04:00
|
|
|
};
|
|
|
|
#define PUFFS_VFS_MAX PUFFS_VFS_EXTATTCTL
|
|
|
|
|
2006-12-01 15:37:41 +03:00
|
|
|
/* moreXXX: we don't need everything here either */
|
2006-10-23 02:43:23 +04:00
|
|
|
enum {
|
|
|
|
PUFFS_VN_LOOKUP, PUFFS_VN_CREATE, PUFFS_VN_MKNOD,
|
|
|
|
PUFFS_VN_OPEN, PUFFS_VN_CLOSE, PUFFS_VN_ACCESS,
|
|
|
|
PUFFS_VN_GETATTR, PUFFS_VN_SETATTR, PUFFS_VN_READ,
|
|
|
|
PUFFS_VN_WRITE, PUFFS_VN_IOCTL, PUFFS_VN_FCNTL,
|
|
|
|
PUFFS_VN_POLL, PUFFS_VN_KQFILTER, PUFFS_VN_REVOKE,
|
|
|
|
PUFFS_VN_MMAP, PUFFS_VN_FSYNC, PUFFS_VN_SEEK,
|
|
|
|
PUFFS_VN_REMOVE, PUFFS_VN_LINK, PUFFS_VN_RENAME,
|
|
|
|
PUFFS_VN_MKDIR, PUFFS_VN_RMDIR, PUFFS_VN_SYMLINK,
|
|
|
|
PUFFS_VN_READDIR, PUFFS_VN_READLINK, PUFFS_VN_ABORTOP,
|
|
|
|
PUFFS_VN_INACTIVE, PUFFS_VN_RECLAIM, PUFFS_VN_LOCK,
|
|
|
|
PUFFS_VN_UNLOCK, PUFFS_VN_BMAP, PUFFS_VN_STRATEGY,
|
|
|
|
PUFFS_VN_PRINT, PUFFS_VN_ISLOCKED, PUFFS_VN_PATHCONF,
|
|
|
|
PUFFS_VN_ADVLOCK, PUFFS_VN_LEASE, PUFFS_VN_WHITEOUT,
|
|
|
|
PUFFS_VN_GETPAGES, PUFFS_VN_PUTPAGES, PUFFS_VN_GETEXTATTR,
|
|
|
|
PUFFS_VN_LISTEXTATTR, PUFFS_VN_OPENEXTATTR, PUFFS_VN_DELETEEXTATTR,
|
|
|
|
PUFFS_VN_SETEXTATTR
|
|
|
|
};
|
|
|
|
#define PUFFS_VN_MAX PUFFS_VN_SETEXTATTR
|
|
|
|
|
2007-09-28 01:14:49 +04:00
|
|
|
enum {
|
|
|
|
PUFFS_ERR_MAKENODE, PUFFS_ERR_LOOKUP, PUFFS_ERR_READDIR,
|
|
|
|
PUFFS_ERR_READLINK, PUFFS_ERR_READ, PUFFS_ERR_WRITE,
|
2007-09-28 03:10:42 +04:00
|
|
|
PUFFS_ERR_VPTOFH
|
2007-09-28 01:14:49 +04:00
|
|
|
};
|
|
|
|
#define PUFFS_ERR_MAX PUFFS_ERR_VPTOFH
|
|
|
|
|
2007-01-02 18:51:21 +03:00
|
|
|
#define PUFFSDEVELVERS 0x80000000
|
2007-09-28 01:14:49 +04:00
|
|
|
#define PUFFSVERSION 18
|
2006-10-23 02:43:23 +04:00
|
|
|
#define PUFFSNAMESIZE 32
|
2007-07-17 15:29:43 +04:00
|
|
|
|
2007-07-30 13:04:58 +04:00
|
|
|
#define PUFFS_TYPEPREFIX "puffs|"
|
|
|
|
|
2007-07-19 01:08:35 +04:00
|
|
|
#define PUFFS_TYPELEN (_VFS_NAMELEN - (sizeof(PUFFS_TYPEPREFIX)+1))
|
|
|
|
#define PUFFS_NAMELEN (_VFS_MNAMELEN-1)
|
2007-07-17 15:29:43 +04:00
|
|
|
|
2007-04-13 17:31:11 +04:00
|
|
|
struct puffs_kargs {
|
2007-01-02 18:51:21 +03:00
|
|
|
unsigned int pa_vers;
|
2006-10-23 02:43:23 +04:00
|
|
|
int pa_fd;
|
2006-12-01 15:37:41 +03:00
|
|
|
uint32_t pa_flags;
|
2007-04-13 19:25:35 +04:00
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
size_t pa_maxreqlen;
|
2007-04-13 19:25:35 +04:00
|
|
|
int pa_nhashbuckets;
|
|
|
|
|
2007-04-16 17:03:26 +04:00
|
|
|
size_t pa_fhsize;
|
|
|
|
int pa_fhflags;
|
|
|
|
|
2007-05-17 17:59:22 +04:00
|
|
|
void *pa_root_cookie;
|
|
|
|
enum vtype pa_root_vtype;
|
|
|
|
voff_t pa_root_vsize;
|
|
|
|
dev_t pa_root_rdev;
|
|
|
|
|
|
|
|
struct statvfs pa_svfsb;
|
|
|
|
|
2007-07-19 01:08:35 +04:00
|
|
|
char pa_typename[_VFS_NAMELEN];
|
2007-07-17 15:29:43 +04:00
|
|
|
char pa_mntfromname[_VFS_MNAMELEN];
|
|
|
|
|
2006-12-01 15:37:41 +03:00
|
|
|
uint8_t pa_vnopmask[PUFFS_VN_MAX];
|
2006-10-23 02:43:23 +04:00
|
|
|
};
|
2007-06-25 02:16:03 +04:00
|
|
|
#define PUFFS_KFLAG_NOCACHE_NAME 0x01 /* don't use name cache */
|
|
|
|
#define PUFFS_KFLAG_NOCACHE_PAGE 0x02 /* don't use page cache */
|
2007-06-25 02:25:49 +04:00
|
|
|
#define PUFFS_KFLAG_NOCACHE 0x03 /* no cache whatsoever */
|
2007-06-25 02:16:03 +04:00
|
|
|
#define PUFFS_KFLAG_ALLOPS 0x04 /* ignore pa_vnopmask */
|
|
|
|
#define PUFFS_KFLAG_WTCACHE 0x08 /* write-through page cache */
|
|
|
|
#define PUFFS_KFLAG_IAONDEMAND 0x10 /* inactive only on demand */
|
2007-07-02 02:54:16 +04:00
|
|
|
#define PUFFS_KFLAG_LOOKUP_FULLPNBUF 0x20 /* full pnbuf in lookup */
|
2007-07-16 20:11:23 +04:00
|
|
|
#define PUFFS_KFLAG_MASK 0x3f
|
2007-04-16 17:03:26 +04:00
|
|
|
|
2007-08-23 18:36:46 +04:00
|
|
|
#define PUFFS_FHFLAG_DYNAMIC 0x01
|
|
|
|
#define PUFFS_FHFLAG_NFSV2 0x02
|
|
|
|
#define PUFFS_FHFLAG_NFSV3 0x04
|
|
|
|
#define PUFFS_FHFLAG_PROTOMASK 0x06
|
|
|
|
#define PUFFS_FHFLAG_PASSTHROUGH 0x08
|
|
|
|
#define PUFFS_FHFLAG_MASK 0x0f
|
2007-04-16 17:03:26 +04:00
|
|
|
|
|
|
|
#define PUFFS_FHSIZE_MAX 1020 /* XXX: FHANDLE_SIZE_MAX - 4 */
|
2006-10-23 02:43:23 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This is the device minor number for the cloning device. Make it
|
|
|
|
* a high number "just in case", even though we don't want to open
|
|
|
|
* any specific devices currently.
|
|
|
|
*/
|
|
|
|
#define PUFFS_CLONER 0x7ffff
|
|
|
|
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_reqh_get {
|
|
|
|
void *phg_buf; /* user buffer */
|
|
|
|
size_t phg_buflen; /* user buffer length */
|
|
|
|
|
|
|
|
int phg_nops; /* max ops user wants / number delivered */
|
|
|
|
int phg_more; /* advisory: more ops available? */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_reqh_put {
|
|
|
|
int php_nops; /* ops available / ops handled */
|
|
|
|
|
|
|
|
/* these describe the first request */
|
|
|
|
uint64_t php_id; /* request id */
|
|
|
|
void *php_buf; /* user buffer address */
|
|
|
|
size_t php_buflen; /* user buffer length, hdr NOT incl. */
|
|
|
|
};
|
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
/*
|
2006-12-06 02:03:28 +03:00
|
|
|
* The requests work as follows:
|
|
|
|
*
|
|
|
|
* + GETOP: When fetching operations from the kernel, the user server
|
|
|
|
* supplies a flat buffer into which operations are written.
|
|
|
|
* The number of operations written to the buffer is
|
|
|
|
* MIN(prhg_nops, requests waiting, space in buffer).
|
|
|
|
*
|
|
|
|
* Operations follow each other and each one is described
|
|
|
|
* by the puffs_req structure, which is immediately followed
|
|
|
|
* by the aligned request data buffer in preq_buf. The next
|
|
|
|
* puffs_req can be found at preq + preq_buflen.
|
|
|
|
*
|
|
|
|
* Visually, the server should expect:
|
|
|
|
*
|
|
|
|
* |<-- preq_buflen -->|
|
|
|
|
* ---------------------------------------------------------------
|
|
|
|
* |hdr| buffer |align|hdr| buffer |hdr| .... |buffer| |
|
|
|
|
* ---------------------------------------------------------------
|
|
|
|
* ^ start ^ unaligned ^ aligned ^ always aligned
|
|
|
|
*
|
|
|
|
* The server is allowed to modify the contents of the buffers.
|
|
|
|
* Since the headers are the same size for both get and put, it
|
|
|
|
* is possible to handle all operations simply by doing in-place
|
|
|
|
* modification. Where more input is expected that what was put
|
|
|
|
* out, the kernel leaves a hole in the buffer. This hole size
|
|
|
|
* is derived from the operational semantics known by the vnode
|
|
|
|
* layer. The hole size is included in preq_buflen. The
|
|
|
|
* amount of relevant information in the buffer is call-specific
|
|
|
|
* and can be deduced by the server from the call type.
|
|
|
|
*
|
|
|
|
* + PUTOP: When returning the results of an operation to the kernel, the
|
|
|
|
* user server is allowed to input results in a scatter-gather
|
|
|
|
* fashion. Each request is made up of a header and the buffer.
|
|
|
|
* The header describes the *NEXT* request for copyin, *NOT* the
|
|
|
|
* current one. The first request is described in puffs_reqh_put
|
|
|
|
* and the last one is left uninterpreted. This is to halve the
|
|
|
|
* amount of copyin's required.
|
|
|
|
*
|
|
|
|
* Fans of my ascii art, rejoice:
|
|
|
|
* /-------------------->| preq_buflen |
|
|
|
|
* ---^----------------------------------------------------------
|
|
|
|
* |hdr|buffer| empty spaces |hdr| buffer | |
|
|
|
|
* --v-----------------------^-v---------------------------------
|
|
|
|
* \------- preq_buf -----/ \------- preq_buf ....
|
|
|
|
*
|
|
|
|
* This scheme also allows for better in-place modification of the
|
|
|
|
* request buffer when handling requests. The vision is that
|
|
|
|
* operations which can be immediately satisfied will be edited
|
|
|
|
* in-place while ones which can't will be left blank. Also,
|
|
|
|
* requests from async operations which have been satisfied
|
|
|
|
* meanwhile can be included.
|
|
|
|
*
|
|
|
|
* The total number of operations is given by the ioctl control
|
|
|
|
* structure puffs_reqh. The values in the header in the final
|
|
|
|
* are not used.
|
2006-10-23 02:43:23 +04:00
|
|
|
*/
|
|
|
|
struct puffs_req {
|
2006-12-06 02:03:28 +03:00
|
|
|
uint64_t preq_id; /* get: cur, put: next */
|
|
|
|
|
|
|
|
union u {
|
|
|
|
struct {
|
|
|
|
uint8_t opclass; /* cur */
|
|
|
|
uint8_t optype; /* cur */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* preq_cookie is the node cookie associated with
|
|
|
|
* the request. It always maps 1:1 to a vnode
|
|
|
|
* and could map to a userspace struct puffs_node.
|
|
|
|
* The cookie usually describes the first
|
|
|
|
* vnode argument of the VOP_POP() in question.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void *cookie; /* cur */
|
|
|
|
} out;
|
|
|
|
struct {
|
|
|
|
int rv; /* cur */
|
2007-05-07 21:14:54 +04:00
|
|
|
int setbacks; /* cur */
|
2006-12-06 02:03:28 +03:00
|
|
|
void *buf; /* next */
|
|
|
|
} in;
|
|
|
|
} u;
|
|
|
|
|
|
|
|
size_t preq_buflen; /* get: cur, put: next */
|
2006-10-23 02:43:23 +04:00
|
|
|
/*
|
2006-12-06 02:03:28 +03:00
|
|
|
* the following helper pads the struct size to md alignment
|
|
|
|
* multiple (should size_t not cut it). it makes sure that
|
|
|
|
* whatever comes after this struct is aligned
|
2006-10-23 02:43:23 +04:00
|
|
|
*/
|
2006-12-06 02:03:28 +03:00
|
|
|
uint8_t preq_buf[0] __aligned(ALIGNBYTES+1);
|
2006-10-23 02:43:23 +04:00
|
|
|
};
|
2006-12-06 02:03:28 +03:00
|
|
|
#define preq_opclass u.out.opclass
|
|
|
|
#define preq_optype u.out.optype
|
|
|
|
#define preq_cookie u.out.cookie
|
|
|
|
#define preq_rv u.in.rv
|
2007-05-07 21:14:54 +04:00
|
|
|
#define preq_setbacks u.in.setbacks
|
2006-12-06 02:03:28 +03:00
|
|
|
#define preq_nextbuf u.in.buf
|
2006-10-23 02:43:23 +04:00
|
|
|
|
2007-05-07 21:14:54 +04:00
|
|
|
#define PUFFS_SETBACK_INACT_N1 0x01 /* set VOP_INACTIVE for node 1 */
|
|
|
|
#define PUFFS_SETBACK_INACT_N2 0x02 /* set VOP_INACTIVE for node 2 */
|
2007-05-18 19:46:09 +04:00
|
|
|
#define PUFFS_SETBACK_NOREF_N1 0x04 /* set pn PN_NOREFS for node 1 */
|
|
|
|
#define PUFFS_SETBACK_NOREF_N2 0x08 /* set pn PN_NOREFS for node 2 */
|
|
|
|
#define PUFFS_SETBACK_MASK 0x0f
|
2007-05-07 21:14:54 +04:00
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
/*
|
|
|
|
* Some operations have unknown size requirements. So as the first
|
|
|
|
* stab at handling it, do an extra bounce between the kernel and
|
|
|
|
* userspace.
|
|
|
|
*/
|
|
|
|
struct puffs_sizeop {
|
|
|
|
uint64_t pso_reqid;
|
|
|
|
|
|
|
|
uint8_t *pso_userbuf;
|
|
|
|
size_t pso_bufsize;
|
|
|
|
};
|
|
|
|
|
2007-01-09 21:14:31 +03:00
|
|
|
/*
|
|
|
|
* Flush operation. This can be used to invalidate:
|
|
|
|
* 1) name cache for one node
|
|
|
|
* 2) name cache for all children
|
|
|
|
* 3) name cache for the entire mount
|
|
|
|
* 4) page cache for a set of ranges in one node
|
|
|
|
* 5) page cache for one entire node
|
|
|
|
*
|
|
|
|
* It can be used to flush:
|
|
|
|
* 1) page cache for a set of ranges in one node
|
|
|
|
* 2) page cache for one entire node
|
|
|
|
*/
|
|
|
|
|
2007-03-20 13:21:58 +03:00
|
|
|
/* XXX: needs restructuring */
|
2007-01-09 21:14:31 +03:00
|
|
|
struct puffs_flush {
|
|
|
|
void *pf_cookie;
|
|
|
|
|
|
|
|
int pf_op;
|
2007-03-20 13:21:58 +03:00
|
|
|
off_t pf_start;
|
|
|
|
off_t pf_end;
|
2007-01-09 21:14:31 +03:00
|
|
|
};
|
|
|
|
#define PUFFS_INVAL_NAMECACHE_NODE 0
|
|
|
|
#define PUFFS_INVAL_NAMECACHE_DIR 1
|
|
|
|
#define PUFFS_INVAL_NAMECACHE_ALL 2
|
|
|
|
#define PUFFS_INVAL_PAGECACHE_NODE_RANGE 3
|
2007-04-06 21:05:34 +04:00
|
|
|
#define PUFFS_FLUSH_PAGECACHE_NODE_RANGE 4
|
2007-01-09 21:14:31 +03:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Available ioctl operations
|
|
|
|
*/
|
2007-05-17 17:59:22 +04:00
|
|
|
#define PUFFSGETOP _IOWR('p', 1, struct puffs_reqh_get)
|
|
|
|
#define PUFFSPUTOP _IOWR('p', 2, struct puffs_reqh_put)
|
|
|
|
#define PUFFSSIZEOP _IOWR('p', 3, struct puffs_sizeop)
|
|
|
|
#define PUFFSFLUSHOP _IOW ('p', 4, struct puffs_flush)
|
2007-01-10 00:59:05 +03:00
|
|
|
#if 0
|
2007-05-17 17:59:22 +04:00
|
|
|
#define PUFFSFLUSHMULTIOP _IOW ('p', 5, struct puffs_flushmulti)
|
2007-01-10 00:59:05 +03:00
|
|
|
#endif
|
2007-05-17 17:59:22 +04:00
|
|
|
#define PUFFSSUSPENDOP _IO ('p', 6)
|
2007-07-19 11:52:45 +04:00
|
|
|
#define PUFFSREQSIZEOP _IOR ('p', 7, size_t)
|
2007-01-09 21:14:31 +03:00
|
|
|
|
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
/*
|
|
|
|
* Credentials for an operation. Can be either struct uucred for
|
|
|
|
* ops called from a credential context or NOCRED/FSCRED for ops
|
|
|
|
* called from within the kernel. It is up to the implementation
|
|
|
|
* if it makes a difference between these two and the super-user.
|
|
|
|
*/
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred {
|
|
|
|
struct uucred pkcr_uuc;
|
|
|
|
uint8_t pkcr_type;
|
|
|
|
uint8_t pkcr_internal;
|
2006-10-23 02:43:23 +04:00
|
|
|
};
|
|
|
|
#define PUFFCRED_TYPE_UUC 1
|
|
|
|
#define PUFFCRED_TYPE_INTERNAL 2
|
|
|
|
#define PUFFCRED_CRED_NOCRED 1
|
|
|
|
#define PUFFCRED_CRED_FSCRED 2
|
|
|
|
|
|
|
|
/*
|
2007-03-29 20:04:26 +04:00
|
|
|
* 2*MAXPHYS is the max size the system will attempt to copy,
|
2006-10-23 02:43:23 +04:00
|
|
|
* else treated as garbage
|
|
|
|
*/
|
2007-03-29 20:04:26 +04:00
|
|
|
#define PUFFS_REQ_MAXSIZE 2*MAXPHYS
|
2006-10-23 20:07:18 +04:00
|
|
|
#define PUFFS_REQSTRUCT_MAX 4096 /* XXX: approxkludge */
|
2006-10-23 02:43:23 +04:00
|
|
|
|
|
|
|
#define PUFFS_TOMOVE(a,b) (MIN((a), b->pmp_req_maxsize - PUFFS_REQSTRUCT_MAX))
|
|
|
|
|
2007-07-01 21:22:13 +04:00
|
|
|
/* caller id */
|
|
|
|
struct puffs_kcid {
|
|
|
|
int pkcid_type;
|
|
|
|
pid_t pkcid_pid;
|
|
|
|
lwpid_t pkcid_lwpid;
|
|
|
|
};
|
|
|
|
#define PUFFCID_TYPE_REAL 1
|
|
|
|
#define PUFFCID_TYPE_FAKE 2
|
|
|
|
|
2006-12-29 18:38:37 +03:00
|
|
|
/* puffs struct componentname built by kernel */
|
|
|
|
struct puffs_kcn {
|
2006-10-23 02:43:23 +04:00
|
|
|
/* args */
|
2007-08-22 21:54:30 +04:00
|
|
|
uint32_t pkcn_nameiop; /* namei operation */
|
|
|
|
uint32_t pkcn_flags; /* flags */
|
2006-10-23 02:43:23 +04:00
|
|
|
|
2007-07-02 02:54:16 +04:00
|
|
|
char pkcn_name[MAXPATHLEN]; /* nulterminated path component */
|
2007-08-22 21:54:30 +04:00
|
|
|
size_t pkcn_namelen; /* current component length */
|
|
|
|
size_t pkcn_consume; /* IN: extra chars server ate */
|
2006-10-23 02:43:23 +04:00
|
|
|
};
|
|
|
|
|
2007-04-12 01:03:05 +04:00
|
|
|
|
2006-12-06 02:03:28 +03:00
|
|
|
/*
|
|
|
|
* Next come the individual requests. They are all subclassed from
|
|
|
|
* puffs_req and contain request-specific fields in addition. Note
|
|
|
|
* that there are some requests which have to handle arbitrary-length
|
|
|
|
* buffers.
|
|
|
|
*
|
|
|
|
* The division is the following: puffs_req is to be touched only
|
|
|
|
* by generic routines while the other stuff is supposed to be
|
|
|
|
* modified only by specific routines.
|
|
|
|
*/
|
2006-11-09 16:09:34 +03:00
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
/*
|
|
|
|
* aux structures for vfs operations.
|
|
|
|
*/
|
|
|
|
struct puffs_vfsreq_unmount {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvfsr_pr;
|
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
int pvfsr_flags;
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvfsr_cid;
|
2006-10-23 02:43:23 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vfsreq_statvfs {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvfsr_pr;
|
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
struct statvfs pvfsr_sb;
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvfsr_cid;
|
2006-10-23 02:43:23 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vfsreq_sync {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvfsr_pr;
|
|
|
|
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvfsr_cred;
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvfsr_cid;
|
2006-10-23 02:43:23 +04:00
|
|
|
int pvfsr_waitfor;
|
|
|
|
};
|
|
|
|
|
2007-04-12 01:03:05 +04:00
|
|
|
struct puffs_vfsreq_fhtonode {
|
|
|
|
struct puffs_req pvfsr_pr;
|
|
|
|
|
|
|
|
void *pvfsr_fhcookie; /* IN */
|
|
|
|
enum vtype pvfsr_vtype; /* IN */
|
|
|
|
voff_t pvfsr_size; /* IN */
|
|
|
|
dev_t pvfsr_rdev; /* IN */
|
|
|
|
|
|
|
|
size_t pvfsr_dsize; /* OUT */
|
2007-04-16 17:03:26 +04:00
|
|
|
uint8_t pvfsr_data[0] /* OUT, XXX */
|
2007-04-12 01:03:05 +04:00
|
|
|
__aligned(ALIGNBYTES+1);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vfsreq_nodetofh {
|
|
|
|
struct puffs_req pvfsr_pr;
|
|
|
|
|
|
|
|
void *pvfsr_fhcookie; /* OUT */
|
|
|
|
|
|
|
|
size_t pvfsr_dsize; /* OUT/IN */
|
2007-04-16 17:03:26 +04:00
|
|
|
uint8_t pvfsr_data[0] /* IN, XXX */
|
2007-04-12 01:03:05 +04:00
|
|
|
__aligned(ALIGNBYTES+1);
|
|
|
|
};
|
|
|
|
|
2007-01-27 01:59:49 +03:00
|
|
|
struct puffs_vfsreq_suspend {
|
|
|
|
struct puffs_req pvfsr_pr;
|
|
|
|
|
|
|
|
int pvfsr_status;
|
|
|
|
};
|
|
|
|
#define PUFFS_SUSPEND_START 0
|
|
|
|
#define PUFFS_SUSPEND_SUSPENDED 1
|
|
|
|
#define PUFFS_SUSPEND_RESUME 2
|
|
|
|
#define PUFFS_SUSPEND_ERROR 3
|
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
/*
|
|
|
|
* aux structures for vnode operations.
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct puffs_vnreq_lookup {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2006-12-29 18:38:37 +03:00
|
|
|
struct puffs_kcn pvnr_cn; /* OUT */
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvnr_cn_cred; /* OUT */
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvnr_cn_cid; /* OUT */
|
2007-07-01 19:30:15 +04:00
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
void *pvnr_newnode; /* IN */
|
|
|
|
enum vtype pvnr_vtype; /* IN */
|
2006-11-08 01:10:18 +03:00
|
|
|
voff_t pvnr_size; /* IN */
|
2006-10-27 02:52:47 +04:00
|
|
|
dev_t pvnr_rdev; /* IN */
|
2006-10-23 02:43:23 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vnreq_create {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2006-12-29 18:38:37 +03:00
|
|
|
struct puffs_kcn pvnr_cn; /* OUT */
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvnr_cn_cred; /* OUT */
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvnr_cn_cid; /* OUT */
|
2007-07-01 19:30:15 +04:00
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
struct vattr pvnr_va; /* OUT */
|
|
|
|
void *pvnr_newnode; /* IN */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vnreq_mknod {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2006-12-29 18:38:37 +03:00
|
|
|
struct puffs_kcn pvnr_cn; /* OUT */
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvnr_cn_cred; /* OUT */
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvnr_cn_cid; /* OUT */
|
2007-07-01 19:30:15 +04:00
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
struct vattr pvnr_va; /* OUT */
|
|
|
|
void *pvnr_newnode; /* IN */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vnreq_open {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvnr_cred; /* OUT */
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvnr_cid; /* OUT */
|
2006-10-23 02:43:23 +04:00
|
|
|
int pvnr_mode; /* OUT */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vnreq_close {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvnr_cred; /* OUT */
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvnr_cid; /* OUT */
|
2006-10-23 02:43:23 +04:00
|
|
|
int pvnr_fflag; /* OUT */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vnreq_access {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvnr_cred; /* OUT */
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvnr_cid; /* OUT */
|
2006-10-23 02:43:23 +04:00
|
|
|
int pvnr_mode; /* OUT */
|
|
|
|
};
|
|
|
|
|
|
|
|
#define puffs_vnreq_setattr puffs_vnreq_setgetattr
|
|
|
|
#define puffs_vnreq_getattr puffs_vnreq_setgetattr
|
|
|
|
struct puffs_vnreq_setgetattr {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvnr_cred; /* OUT */
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvnr_cid; /* OUT */
|
2006-10-23 02:43:23 +04:00
|
|
|
struct vattr pvnr_va; /* IN/OUT (op depend) */
|
|
|
|
};
|
|
|
|
|
|
|
|
#define puffs_vnreq_read puffs_vnreq_readwrite
|
|
|
|
#define puffs_vnreq_write puffs_vnreq_readwrite
|
|
|
|
struct puffs_vnreq_readwrite {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvnr_cred; /* OUT */
|
2006-10-23 02:43:23 +04:00
|
|
|
off_t pvnr_offset; /* OUT */
|
|
|
|
size_t pvnr_resid; /* IN/OUT */
|
|
|
|
int pvnr_ioflag; /* OUT */
|
|
|
|
|
|
|
|
uint8_t pvnr_data[0]; /* IN/OUT (wr/rd) */
|
|
|
|
};
|
|
|
|
|
|
|
|
#define puffs_vnreq_ioctl puffs_vnreq_fcnioctl
|
|
|
|
#define puffs_vnreq_fcntl puffs_vnreq_fcnioctl
|
|
|
|
struct puffs_vnreq_fcnioctl {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvnr_cred;
|
2006-10-23 02:43:23 +04:00
|
|
|
u_long pvnr_command;
|
|
|
|
pid_t pvnr_pid;
|
|
|
|
int pvnr_fflag;
|
|
|
|
|
|
|
|
void *pvnr_data;
|
|
|
|
size_t pvnr_datalen;
|
|
|
|
int pvnr_copyback;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vnreq_poll {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2007-05-18 17:53:08 +04:00
|
|
|
int pvnr_events; /* IN/OUT */
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvnr_cid; /* OUT */
|
2006-10-23 02:43:23 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vnreq_fsync {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvnr_cred; /* OUT */
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvnr_cid; /* OUT */
|
2006-10-23 02:43:23 +04:00
|
|
|
off_t pvnr_offlo; /* OUT */
|
|
|
|
off_t pvnr_offhi; /* OUT */
|
|
|
|
int pvnr_flags; /* OUT */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vnreq_seek {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvnr_cred; /* OUT */
|
2006-10-23 02:43:23 +04:00
|
|
|
off_t pvnr_oldoff; /* OUT */
|
|
|
|
off_t pvnr_newoff; /* OUT */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vnreq_remove {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2006-12-29 18:38:37 +03:00
|
|
|
struct puffs_kcn pvnr_cn; /* OUT */
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvnr_cn_cred; /* OUT */
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvnr_cn_cid; /* OUT */
|
2007-07-01 19:30:15 +04:00
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
void *pvnr_cookie_targ; /* OUT */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vnreq_mkdir {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2006-12-29 18:38:37 +03:00
|
|
|
struct puffs_kcn pvnr_cn; /* OUT */
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvnr_cn_cred; /* OUT */
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvnr_cn_cid; /* OUT */
|
2007-07-01 19:30:15 +04:00
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
struct vattr pvnr_va; /* OUT */
|
|
|
|
void *pvnr_newnode; /* IN */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vnreq_rmdir {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2006-12-29 18:38:37 +03:00
|
|
|
struct puffs_kcn pvnr_cn; /* OUT */
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvnr_cn_cred; /* OUT */
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvnr_cn_cid; /* OUT */
|
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
void *pvnr_cookie_targ; /* OUT */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vnreq_link {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcn pvnr_cn; /* OUT */
|
|
|
|
struct puffs_kcred pvnr_cn_cred; /* OUT */
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvnr_cn_cid; /* OUT */
|
|
|
|
|
2007-07-01 19:30:15 +04:00
|
|
|
void *pvnr_cookie_targ; /* OUT */
|
2006-10-23 02:43:23 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vnreq_rename {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2006-12-29 18:38:37 +03:00
|
|
|
struct puffs_kcn pvnr_cn_src; /* OUT */
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvnr_cn_src_cred; /* OUT */
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvnr_cn_src_cid; /* OUT */
|
2006-12-29 18:38:37 +03:00
|
|
|
struct puffs_kcn pvnr_cn_targ; /* OUT */
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvnr_cn_targ_cred; /* OUT */
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvnr_cn_targ_cid; /* OUT */
|
2007-07-01 19:30:15 +04:00
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
void *pvnr_cookie_src; /* OUT */
|
|
|
|
void *pvnr_cookie_targ; /* OUT */
|
|
|
|
void *pvnr_cookie_targdir; /* OUT */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vnreq_symlink {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2006-12-29 18:38:37 +03:00
|
|
|
struct puffs_kcn pvnr_cn; /* OUT */
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvnr_cn_cred; /* OUT */
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvnr_cn_cid; /* OUT */
|
2007-07-01 19:30:15 +04:00
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
struct vattr pvnr_va; /* OUT */
|
|
|
|
void *pvnr_newnode; /* IN */
|
|
|
|
char pvnr_link[MAXPATHLEN]; /* OUT */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vnreq_readdir {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvnr_cred; /* OUT */
|
2006-10-23 02:43:23 +04:00
|
|
|
off_t pvnr_offset; /* IN/OUT */
|
|
|
|
size_t pvnr_resid; /* IN/OUT */
|
2007-04-12 01:03:05 +04:00
|
|
|
size_t pvnr_ncookies; /* IN/OUT */
|
|
|
|
int pvnr_eofflag; /* IN */
|
2006-10-23 02:43:23 +04:00
|
|
|
|
2007-04-12 01:03:05 +04:00
|
|
|
size_t pvnr_dentoff; /* OUT */
|
|
|
|
uint8_t pvnr_data[0] /* IN */
|
|
|
|
__aligned(ALIGNBYTES+1);
|
2006-10-23 02:43:23 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vnreq_readlink {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvnr_cred; /* OUT */
|
2006-10-23 02:43:23 +04:00
|
|
|
size_t pvnr_linklen; /* IN */
|
|
|
|
char pvnr_link[MAXPATHLEN]; /* IN, XXX */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vnreq_reclaim {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvnr_cid; /* OUT */
|
2006-10-23 02:43:23 +04:00
|
|
|
};
|
|
|
|
|
2006-10-25 22:15:39 +04:00
|
|
|
struct puffs_vnreq_inactive {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvnr_cid; /* OUT */
|
2006-10-25 22:15:39 +04:00
|
|
|
};
|
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
struct puffs_vnreq_print {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
/* empty */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vnreq_pathconf {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
int pvnr_name; /* OUT */
|
|
|
|
int pvnr_retval; /* IN */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct puffs_vnreq_advlock {
|
2006-12-06 02:03:28 +03:00
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
struct flock pvnr_fl; /* OUT */
|
|
|
|
void *pvnr_id; /* OUT */
|
|
|
|
int pvnr_op; /* OUT */
|
|
|
|
int pvnr_flags; /* OUT */
|
|
|
|
};
|
|
|
|
|
2006-12-07 19:58:39 +03:00
|
|
|
struct puffs_vnreq_mmap {
|
|
|
|
struct puffs_req pvn_pr;
|
|
|
|
|
2007-07-27 12:26:38 +04:00
|
|
|
vm_prot_t pvnr_prot; /* OUT */
|
2007-07-01 19:30:15 +04:00
|
|
|
struct puffs_kcred pvnr_cred; /* OUT */
|
2007-07-01 21:22:13 +04:00
|
|
|
struct puffs_kcid pvnr_cid; /* OUT */
|
2006-12-07 19:58:39 +03:00
|
|
|
};
|
|
|
|
|
2007-03-20 13:21:58 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* For cache reports. Everything is always out-out-out, no replies
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct puffs_cacherun {
|
|
|
|
off_t pcache_runstart;
|
|
|
|
off_t pcache_runend;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* cache info. old used for write now */
|
|
|
|
struct puffs_cacheinfo {
|
|
|
|
struct puffs_req pcache_pr;
|
|
|
|
|
|
|
|
int pcache_type;
|
|
|
|
size_t pcache_nruns;
|
|
|
|
struct puffs_cacherun pcache_runs[0];
|
|
|
|
};
|
|
|
|
#define PCACHE_TYPE_READ 0
|
|
|
|
#define PCACHE_TYPE_WRITE 1
|
|
|
|
|
2007-09-28 01:14:49 +04:00
|
|
|
/*
|
|
|
|
* Error notification. Always outgoing, no response, no remorse.
|
|
|
|
*/
|
|
|
|
struct puffs_error {
|
|
|
|
struct puffs_req perr_pr;
|
|
|
|
|
|
|
|
int perr_error;
|
|
|
|
};
|
|
|
|
|
2006-10-23 02:43:23 +04:00
|
|
|
/* notyet */
|
|
|
|
#if 0
|
|
|
|
struct puffs_vnreq_kqfilter { };
|
|
|
|
struct puffs_vnreq_islocked { };
|
|
|
|
#endif
|
|
|
|
struct puffs_vnreq_getextattr { };
|
|
|
|
struct puffs_vnreq_setextattr { };
|
|
|
|
struct puffs_vnreq_listextattr { };
|
|
|
|
|
|
|
|
#ifdef _KERNEL
|
|
|
|
#define PUFFS_VFSREQ(a) \
|
|
|
|
struct puffs_vfsreq_##a a##_arg; \
|
|
|
|
memset(&a##_arg, 0, sizeof(struct puffs_vfsreq_##a))
|
|
|
|
|
|
|
|
#define PUFFS_VNREQ(a) \
|
|
|
|
struct puffs_vnreq_##a a##_arg; \
|
|
|
|
memset(&a##_arg, 0, sizeof(struct puffs_vnreq_##a))
|
|
|
|
#endif
|
|
|
|
|
2007-08-15 18:19:19 +04:00
|
|
|
#endif /* _FS_PUFFS_PUFFS_MSGIF_H_ */
|