1a9643ea8Slogwang /*
2a9643ea8Slogwang * Copyright (c) 2011 Kip Macy. All rights reserved.
3*2317ada5Sfengbojiang * Copyright (C) 2017-2021 THL A29 Limited, a Tencent company.
4a9643ea8Slogwang * All rights reserved.
5a9643ea8Slogwang *
6a9643ea8Slogwang * Redistribution and use in source and binary forms, with or without
7a9643ea8Slogwang * modification, are permitted provided that the following conditions are met:
8a9643ea8Slogwang *
9a9643ea8Slogwang * 1. Redistributions of source code must retain the above copyright notice, this
10a9643ea8Slogwang * list of conditions and the following disclaimer.
11a9643ea8Slogwang * 2. Redistributions in binary form must reproduce the above copyright notice,
12a9643ea8Slogwang * this list of conditions and the following disclaimer in the documentation
13a9643ea8Slogwang * and/or other materials provided with the distribution.
14a9643ea8Slogwang *
15a9643ea8Slogwang * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16a9643ea8Slogwang * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17a9643ea8Slogwang * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18a9643ea8Slogwang * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
19a9643ea8Slogwang * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20a9643ea8Slogwang * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21a9643ea8Slogwang * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22a9643ea8Slogwang * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23a9643ea8Slogwang * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24a9643ea8Slogwang * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25a9643ea8Slogwang *
26a9643ea8Slogwang * Derived in part from libplebnet's pn_vfs_ops.c.
27a9643ea8Slogwang */
28a9643ea8Slogwang
29a9643ea8Slogwang #include <sys/cdefs.h>
30a9643ea8Slogwang #include <sys/param.h>
31a9643ea8Slogwang #include <sys/types.h>
32a9643ea8Slogwang #include <sys/limits.h>
33a9643ea8Slogwang #include <sys/malloc.h>
34a9643ea8Slogwang #include <sys/namei.h>
35a9643ea8Slogwang #include <sys/refcount.h>
36a9643ea8Slogwang #include <sys/resourcevar.h>
37a9643ea8Slogwang #include <sys/systm.h>
38a9643ea8Slogwang #include <sys/proc.h>
39a9643ea8Slogwang #include <sys/priv.h>
40a9643ea8Slogwang #include <sys/time.h>
41a9643ea8Slogwang #include <sys/ucred.h>
42a9643ea8Slogwang #include <sys/vnode.h>
43a9643ea8Slogwang #include <sys/uio.h>
44a9643ea8Slogwang #include <sys/file.h>
45a9643ea8Slogwang #include <sys/capsicum.h>
46a9643ea8Slogwang
4722ce4affSfengbojiang __read_frequently smr_t vfs_smr;
4822ce4affSfengbojiang
49a9643ea8Slogwang void
NDFREE(struct nameidata * ndp,const u_int flags)50a9643ea8Slogwang NDFREE(struct nameidata *ndp, const u_int flags)
51a9643ea8Slogwang {
52a9643ea8Slogwang
53a9643ea8Slogwang }
54a9643ea8Slogwang
55a9643ea8Slogwang int
vn_open(struct nameidata * ndp,int * flagp,int cmode,struct file * fp)56a9643ea8Slogwang vn_open(struct nameidata *ndp, int *flagp, int cmode, struct file *fp)
57a9643ea8Slogwang {
58a9643ea8Slogwang panic("vn_open not implemented");
59a9643ea8Slogwang
60a9643ea8Slogwang return (0);
61a9643ea8Slogwang }
62a9643ea8Slogwang
63a9643ea8Slogwang
64a9643ea8Slogwang int
vn_close(struct vnode * vp,int flags,struct ucred * file_cred,struct thread * td)65a9643ea8Slogwang vn_close(struct vnode *vp,
66a9643ea8Slogwang int flags, struct ucred *file_cred, struct thread *td)
67a9643ea8Slogwang {
68a9643ea8Slogwang panic("vn_close not implemented");
69a9643ea8Slogwang
70a9643ea8Slogwang return (0);
71a9643ea8Slogwang }
72a9643ea8Slogwang
73a9643ea8Slogwang
74a9643ea8Slogwang int
vn_rdwr(enum uio_rw rw,struct vnode * vp,void * base,int len,off_t offset,enum uio_seg segflg,int ioflg,struct ucred * active_cred,struct ucred * file_cred,ssize_t * aresid,struct thread * td)75a9643ea8Slogwang vn_rdwr(enum uio_rw rw, struct vnode *vp, void *base,
76a9643ea8Slogwang int len, off_t offset, enum uio_seg segflg, int ioflg,
77a9643ea8Slogwang struct ucred *active_cred, struct ucred *file_cred, ssize_t *aresid,
78a9643ea8Slogwang struct thread *td)
79a9643ea8Slogwang {
80a9643ea8Slogwang panic("vn_rdwr not implemented");
81a9643ea8Slogwang
82a9643ea8Slogwang return (0);
83a9643ea8Slogwang }
84a9643ea8Slogwang
85a9643ea8Slogwang int
vn_fill_kinfo_vnode(struct vnode * vp,struct kinfo_file * kif)86a9643ea8Slogwang vn_fill_kinfo_vnode(struct vnode *vp, struct kinfo_file *kif)
87a9643ea8Slogwang {
88a9643ea8Slogwang panic("vn_fill_kinfo_vnode not implemented");
89a9643ea8Slogwang
90a9643ea8Slogwang return (0);
91a9643ea8Slogwang }
92a9643ea8Slogwang
9322ce4affSfengbojiang #if 0
94a9643ea8Slogwang void
95a9643ea8Slogwang NDINIT_ALL(struct nameidata *ndp, u_long op, u_long flags, enum uio_seg segflg,
96a9643ea8Slogwang const char *namep, int dirfd, struct vnode *startdir, cap_rights_t *rightsp,
97a9643ea8Slogwang struct thread *td)
98a9643ea8Slogwang {
99a9643ea8Slogwang
100a9643ea8Slogwang ndp->ni_cnd.cn_nameiop = op;
101a9643ea8Slogwang ndp->ni_cnd.cn_flags = flags;
102a9643ea8Slogwang ndp->ni_segflg = segflg;
103a9643ea8Slogwang ndp->ni_dirp = namep;
104a9643ea8Slogwang ndp->ni_dirfd = dirfd;
105a9643ea8Slogwang ndp->ni_startdir = startdir;
106a9643ea8Slogwang ndp->ni_strictrelative = 0;
107a9643ea8Slogwang if (rightsp != NULL)
108a9643ea8Slogwang ndp->ni_rightsneeded = *rightsp;
109a9643ea8Slogwang else
110a9643ea8Slogwang cap_rights_init(&ndp->ni_rightsneeded);
111a9643ea8Slogwang filecaps_init(&ndp->ni_filecaps);
112a9643ea8Slogwang ndp->ni_cnd.cn_thread = td;
113a9643ea8Slogwang }
11422ce4affSfengbojiang #endif
115a9643ea8Slogwang
116