version 1.47, 2007/07/30 09:04:58 |
version 1.47.4.3, 2007/10/02 18:28:52 |
|
|
* SUCH DAMAGE. |
* SUCH DAMAGE. |
*/ |
*/ |
|
|
#ifndef _PUFFS_MSGIF_H_ |
#ifndef _FS_PUFFS_PUFFS_MSGIF_H_ |
#define _PUFFS_MSGIF_H_ |
#define _FS_PUFFS_PUFFS_MSGIF_H_ |
|
|
#include <sys/param.h> |
#include <sys/param.h> |
#include <sys/time.h> |
#include <sys/time.h> |
|
|
|
|
#include <uvm/uvm_prot.h> |
#include <uvm/uvm_prot.h> |
|
|
#define PUFFSOP_VFS 1 |
#define PUFFSOP_VFS 0x01 |
#define PUFFSOP_VN 2 |
#define PUFFSOP_VN 0x02 |
#define PUFFSOP_CACHE 3 |
#define PUFFSOP_CACHE 0x03 |
|
#define PUFFSOP_ERROR 0x04 |
#define PUFFSOPFLAG_FAF 0x10 /* fire-and-forget */ |
#define PUFFSOPFLAG_FAF 0x10 /* fire-and-forget */ |
|
|
#define PUFFSOP_OPCMASK 0x03 |
#define PUFFSOP_OPCMASK 0x07 |
#define PUFFSOP_OPCLASS(a) ((a) & PUFFSOP_OPCMASK) |
#define PUFFSOP_OPCLASS(a) ((a) & PUFFSOP_OPCMASK) |
#define PUFFSOP_WANTREPLY(a) (((a) & PUFFSOPFLAG_FAF) == 0) |
#define PUFFSOP_WANTREPLY(a) (((a) & PUFFSOPFLAG_FAF) == 0) |
|
|
|
|
}; |
}; |
#define PUFFS_VN_MAX PUFFS_VN_SETEXTATTR |
#define PUFFS_VN_MAX PUFFS_VN_SETEXTATTR |
|
|
|
/* |
|
* These signal invalid parameters the file system returned. |
|
*/ |
|
enum { |
|
PUFFS_ERR_MAKENODE, PUFFS_ERR_LOOKUP, PUFFS_ERR_READDIR, |
|
PUFFS_ERR_READLINK, PUFFS_ERR_READ, PUFFS_ERR_WRITE, |
|
PUFFS_ERR_VPTOFH, PUFFS_ERR_ERROR |
|
}; |
|
#define PUFFS_ERR_MAX PUFFS_ERR_VPTOFH |
|
|
#define PUFFSDEVELVERS 0x80000000 |
#define PUFFSDEVELVERS 0x80000000 |
#define PUFFSVERSION 16 |
#define PUFFSVERSION 19 |
#define PUFFSNAMESIZE 32 |
#define PUFFSNAMESIZE 32 |
|
|
#define PUFFS_TYPEPREFIX "puffs|" |
#define PUFFS_TYPEPREFIX "puffs|" |
|
|
struct puffs_kargs { |
struct puffs_kargs { |
unsigned int pa_vers; |
unsigned int pa_vers; |
int pa_fd; |
int pa_fd; |
|
|
uint32_t pa_flags; |
uint32_t pa_flags; |
|
|
size_t pa_maxreqlen; |
size_t pa_maxreqlen; |
Line 110 struct puffs_kargs { |
|
Line 122 struct puffs_kargs { |
|
dev_t pa_root_rdev; |
dev_t pa_root_rdev; |
|
|
struct statvfs pa_svfsb; |
struct statvfs pa_svfsb; |
|
|
char pa_typename[_VFS_NAMELEN]; |
char pa_typename[_VFS_NAMELEN]; |
char pa_mntfromname[_VFS_MNAMELEN]; |
char pa_mntfromname[_VFS_MNAMELEN]; |
|
|
Line 125 struct puffs_kargs { |
|
Line 137 struct puffs_kargs { |
|
#define PUFFS_KFLAG_LOOKUP_FULLPNBUF 0x20 /* full pnbuf in lookup */ |
#define PUFFS_KFLAG_LOOKUP_FULLPNBUF 0x20 /* full pnbuf in lookup */ |
#define PUFFS_KFLAG_MASK 0x3f |
#define PUFFS_KFLAG_MASK 0x3f |
|
|
#define PUFFS_FHFLAG_DYNAMIC 0x01 |
#define PUFFS_FHFLAG_DYNAMIC 0x01 |
#define PUFFS_FHFLAG_NFSV2 0x02 |
#define PUFFS_FHFLAG_NFSV2 0x02 |
#define PUFFS_FHFLAG_NFSV3 0x04 |
#define PUFFS_FHFLAG_NFSV3 0x04 |
#define PUFFS_FHFLAG_PROTOMASK 0x06 |
#define PUFFS_FHFLAG_PROTOMASK 0x06 |
|
#define PUFFS_FHFLAG_PASSTHROUGH 0x08 |
|
#define PUFFS_FHFLAG_MASK 0x0f |
|
|
#define PUFFS_FHSIZE_MAX 1020 /* XXX: FHANDLE_SIZE_MAX - 4 */ |
#define PUFFS_FHSIZE_MAX 1020 /* XXX: FHANDLE_SIZE_MAX - 4 */ |
|
|
Line 216 struct puffs_reqh_put { |
|
Line 230 struct puffs_reqh_put { |
|
struct puffs_req { |
struct puffs_req { |
uint64_t preq_id; /* get: cur, put: next */ |
uint64_t preq_id; /* get: cur, put: next */ |
|
|
union u { |
uint8_t preq_opclass; /* get, cur */ |
struct { |
uint8_t preq_optype; /* get, cur */ |
uint8_t opclass; /* cur */ |
int preq_rv; /* put, cur */ |
uint8_t optype; /* cur */ |
int preq_setbacks; /* put, cur */ |
|
|
/* |
/* |
* preq_cookie is the node cookie associated with |
* preq_cookie is the node cookie associated with |
* the request. It always maps 1:1 to a vnode |
* the request. It always maps 1:1 to a vnode |
* and could map to a userspace struct puffs_node. |
* and could map to a userspace struct puffs_node. |
* The cookie usually describes the first |
* The cookie usually describes the first |
* vnode argument of the VOP_POP() in question. |
* vnode argument of the VOP_POP() in question. |
*/ |
*/ |
|
void *preq_cookie; /* get, cur */ |
void *cookie; /* cur */ |
|
} out; |
void *preq_nextbuf; /* put, next */ |
struct { |
|
int rv; /* cur */ |
|
int setbacks; /* cur */ |
|
void *buf; /* next */ |
|
} in; |
|
} u; |
|
|
|
size_t preq_buflen; /* get: cur, put: next */ |
size_t preq_buflen; /* get: cur, put: next */ |
/* |
/* |
* the following helper pads the struct size to md alignment |
* the following helper pads the struct size to md alignment |
* multiple (should size_t not cut it). it makes sure that |
* multiple (should size_t not cut it). it makes sure that |
Line 246 struct puffs_req { |
|
Line 254 struct puffs_req { |
|
*/ |
*/ |
uint8_t preq_buf[0] __aligned(ALIGNBYTES+1); |
uint8_t preq_buf[0] __aligned(ALIGNBYTES+1); |
}; |
}; |
#define preq_opclass u.out.opclass |
|
#define preq_optype u.out.optype |
|
#define preq_cookie u.out.cookie |
|
#define preq_rv u.in.rv |
|
#define preq_setbacks u.in.setbacks |
|
#define preq_nextbuf u.in.buf |
|
|
|
#define PUFFS_SETBACK_INACT_N1 0x01 /* set VOP_INACTIVE for node 1 */ |
#define PUFFS_SETBACK_INACT_N1 0x01 /* set VOP_INACTIVE for node 1 */ |
#define PUFFS_SETBACK_INACT_N2 0x02 /* set VOP_INACTIVE for node 2 */ |
#define PUFFS_SETBACK_INACT_N2 0x02 /* set VOP_INACTIVE for node 2 */ |
Line 350 struct puffs_kcid { |
|
Line 352 struct puffs_kcid { |
|
/* puffs struct componentname built by kernel */ |
/* puffs struct componentname built by kernel */ |
struct puffs_kcn { |
struct puffs_kcn { |
/* args */ |
/* args */ |
u_long pkcn_nameiop; /* namei operation */ |
uint32_t pkcn_nameiop; /* namei operation */ |
u_long pkcn_flags; /* flags */ |
uint32_t pkcn_flags; /* flags */ |
|
|
char pkcn_name[MAXPATHLEN]; /* nulterminated path component */ |
char pkcn_name[MAXPATHLEN]; /* nulterminated path component */ |
long pkcn_namelen; /* current component length */ |
size_t pkcn_namelen; /* current component length */ |
long pkcn_consume; /* IN: extra chars server ate */ |
size_t pkcn_consume; /* IN: extra chars server ate */ |
}; |
}; |
|
|
/* |
|
* XXX: figure out what to do with these, copied from namei.h for now |
|
*/ |
|
#define PUFFSLOOKUP_LOOKUP 0 /* perform name lookup only */ |
|
#define PUFFSLOOKUP_CREATE 1 /* setup for file creation */ |
|
#define PUFFSLOOKUP_DELETE 2 /* setup for file deletion */ |
|
#define PUFFSLOOKUP_RENAME 3 /* setup for file renaming */ |
|
#define PUFFSLOOKUP_OPMASK 3 /* mask for operation */ |
|
|
|
#define PUFFSLOOKUP_FOLLOW 0x00004 /* follow final symlink */ |
|
#define PUFFSLOOKUP_NOFOLLOW 0x00008 /* don't follow final symlink */ |
|
#define PUFFSLOOKUP_ISLASTCN 0x08000 /* is last component of lookup */ |
|
#define PUFFSLOOKUP_REQUIREDIR 0x80000 /* must be directory */ |
|
|
|
|
|
/* |
/* |
* Next come the individual requests. They are all subclassed from |
* Next come the individual requests. They are all subclassed from |
Line 721 struct puffs_cacheinfo { |
|
Line 709 struct puffs_cacheinfo { |
|
#define PCACHE_TYPE_READ 0 |
#define PCACHE_TYPE_READ 0 |
#define PCACHE_TYPE_WRITE 1 |
#define PCACHE_TYPE_WRITE 1 |
|
|
|
/* |
|
* Error notification. Always outgoing, no response, no remorse. |
|
*/ |
|
struct puffs_error { |
|
struct puffs_req perr_pr; |
|
|
|
int perr_error; |
|
char perr_str[256]; |
|
}; |
|
|
/* notyet */ |
/* notyet */ |
#if 0 |
#if 0 |
struct puffs_vnreq_kqfilter { }; |
struct puffs_vnreq_kqfilter { }; |
Line 740 struct puffs_vnreq_listextattr { }; |
|
Line 738 struct puffs_vnreq_listextattr { }; |
|
memset(&a##_arg, 0, sizeof(struct puffs_vnreq_##a)) |
memset(&a##_arg, 0, sizeof(struct puffs_vnreq_##a)) |
#endif |
#endif |
|
|
#endif /* _PUFFS_MSGIF_H_ */ |
#endif /* _FS_PUFFS_PUFFS_MSGIF_H_ */ |