xref: /netbsd/share/examples/puffs/pgfs/pgfs.h (revision 3ce09cef)
1 /*	$NetBSD: pgfs.h,v 1.1 2011/10/12 01:05:00 yamt Exp $	*/
2 
3 /*-
4  * Copyright (c)2010,2011 YAMAMOTO Takashi,
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26  * SUCH DAMAGE.
27  */
28 
29 #include <puffs.h>
30 #include <stdbool.h>
31 
32 puffs_cookie_t pgfs_root_cookie(void);
33 
34 int pgfs_fs_statvfs(struct puffs_usermount *, struct statvfs *);
35 
36 int pgfs_node_getattr(struct puffs_usermount *, puffs_cookie_t,
37     struct vattr *, const struct puffs_cred *);
38 int pgfs_node_readdir(struct puffs_usermount *, puffs_cookie_t,
39     struct dirent *, off_t *, size_t *, const struct puffs_cred *,
40     int *, off_t *, size_t *);
41 int pgfs_node_lookup(struct puffs_usermount *, puffs_cookie_t,
42     struct puffs_newinfo *, const struct puffs_cn *);
43 int pgfs_node_mkdir(struct puffs_usermount *, puffs_cookie_t,
44     struct puffs_newinfo *, const struct puffs_cn *,
45     const struct vattr *);
46 int pgfs_node_create(struct puffs_usermount *, puffs_cookie_t,
47     struct puffs_newinfo *, const struct puffs_cn *,
48     const struct vattr *);
49 int pgfs_node_write(struct puffs_usermount *, puffs_cookie_t,
50     uint8_t *, off_t, size_t *, const struct puffs_cred *, int);
51 int pgfs_node_read(struct puffs_usermount *, puffs_cookie_t,
52     uint8_t *, off_t, size_t *, const struct puffs_cred *, int);
53 int pgfs_node_link(struct puffs_usermount *, puffs_cookie_t,
54     puffs_cookie_t, const struct puffs_cn *);
55 int pgfs_node_remove(struct puffs_usermount *, puffs_cookie_t,
56     puffs_cookie_t, const struct puffs_cn *);
57 int pgfs_node_rmdir(struct puffs_usermount *, puffs_cookie_t,
58     puffs_cookie_t, const struct puffs_cn *);
59 int pgfs_node_inactive(struct puffs_usermount *, puffs_cookie_t);
60 int pgfs_node_setattr(struct puffs_usermount *, puffs_cookie_t,
61     const struct vattr *, const struct puffs_cred *);
62 int pgfs_node_rename(struct puffs_usermount *, puffs_cookie_t,
63     puffs_cookie_t, const struct puffs_cn *, puffs_cookie_t, puffs_cookie_t,
64     const struct puffs_cn *);
65 int pgfs_node_symlink(struct puffs_usermount *, puffs_cookie_t,
66     struct puffs_newinfo *, const struct puffs_cn *, const struct vattr *,
67     const char *);
68 int pgfs_node_readlink(struct puffs_usermount *, puffs_cookie_t,
69     const struct puffs_cred *, char *, size_t *);
70 int pgfs_node_access(struct puffs_usermount *, puffs_cookie_t, int,
71     const struct puffs_cred *);
72 int pgfs_node_fsync(struct puffs_usermount *, puffs_cookie_t,
73     const struct puffs_cred *, int, off_t, off_t);
74 
75 typedef uint64_t fileid_t;
76 
77 #define	PGFS_ROOT_FILEID	1
78