netatalk: vfs.h Source File

netatalk 4.5.1
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
vfs.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2004 Didier Gautheron
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17*/
18
23
24#ifndef ATALK_VFS_H
25#define ATALK_VFS_H
26
27#ifdef HAVE_CONFIG_H
28#include "config.h"
29#endif /* HAVE_CONFIG_H */
30
31#include <atalk/acl.h>
32#include <atalk/adouble.h>
33#include <atalk/volume.h>
34
36#define VFS_MODULES_MAX 3
37
38/* Function argument types for VFS operations */
39 typedef int (*vfs_validupath_fn)(const struct vol *vol, const char *name);
40 typedef int (*vfs_chown_fn)(const struct vol *vol, const char *path, uid_t uid,
41 gid_t gid);
42 typedef int (*vfs_renamedir_fn)(const struct vol *vol, int dirfd,
43 const char *oldpath, const char *newpath);
44 typedef int (*vfs_deletecurdir_fn)(const struct vol *vol);
45 typedef int (*vfs_setfilmode_fn)(const struct vol *vol, const char *name,
46 mode_t mode, struct stat *st);
47 typedef int (*vfs_setdirmode_fn)(const struct vol *vol, const char *name,
48 mode_t mode, struct stat *st);
49 typedef int (*vfs_setdirunixmode_fn)(const struct vol *vol, const char *name,
50 mode_t mode, struct stat *st);
51 typedef int (*vfs_setdirowner_fn)(const struct vol *vol, const char *name,
52 uid_t uid, gid_t gid);
53 typedef int (*vfs_deletefile_fn)(const struct vol *vol, int dirfd,
54 const char *file);
55 typedef int (*vfs_renamefile_fn)(const struct vol *vol, int dirfd,
56 const char *src, const char *dst);
57 typedef int (*vfs_copyfile_fn)(const struct vol *vol, int sfd, const char *src,
58 const char *dst);
59
60#ifdef HAVE_NFSV4_ACLS
61 typedef int (*vfs_solaris_acl_fn)(const struct vol *vol, const char *path,
62 int cmd, int count, void *aces);
63#endif
64
65#ifdef HAVE_POSIX_ACLS
66 typedef int (*vfs_posix_acl_fn)(const struct vol *vol, const char *path,
67 acl_type_t type, int count, acl_t acl);
68#endif
69
70 typedef int (*vfs_remove_acl_fn)(const struct vol *vol, const char *path,
71 int dir);
72
73 typedef int (*vfs_ea_getsize_fn)(const struct vol *vol, char *rbuf,
74 size_t *rbuflen, const char *uname,
75 int oflag, const char *attruname, int fd);
76
77 typedef int (*vfs_ea_getcontent_fn)(const struct vol *vol, char *rbuf,
78 size_t *rbuflen, const char *uname,
79 int oflag, const char *attruname,
80 int maxreply, int fd);
81
82 typedef int (*vfs_ea_list_fn)(const struct vol *vol, char *attrnamebuf,
83 size_t *buflen, const char *uname, int oflag, int fd);
84
85 typedef int (*vfs_ea_set_fn)(const struct vol *vol, const char *uname,
86 const char *attruname, const char *ibuf,
87 size_t attrsize, int oflag, int fd);
88
89 typedef int (*vfs_ea_remove_fn)(const struct vol *vol, const char *uname,
90 const char *attruname, int oflag, int fd);
91
96struct vol;
97
98 struct vfs_ops {
99 vfs_validupath_fn vfs_validupath;
100 vfs_chown_fn vfs_chown;
101 vfs_renamedir_fn vfs_renamedir;
102 vfs_deletecurdir_fn vfs_deletecurdir;
103 vfs_setfilmode_fn vfs_setfilmode;
104 vfs_setdirmode_fn vfs_setdirmode;
105 vfs_setdirunixmode_fn vfs_setdirunixmode;
106 vfs_setdirowner_fn vfs_setdirowner;
107 vfs_deletefile_fn vfs_deletefile;
108 vfs_renamefile_fn vfs_renamefile;
109 vfs_copyfile_fn vfs_copyfile;
110
111#ifdef HAVE_ACLS
112#ifdef HAVE_NFSV4_ACLS
113 vfs_solaris_acl_fn vfs_solaris_acl;
114#endif
115#ifdef HAVE_POSIX_ACLS
116 vfs_posix_acl_fn vfs_posix_acl;
117#endif
118 vfs_remove_acl_fn vfs_remove_acl;
119#endif
120
121 /* Extended Attributes */
122 vfs_ea_getsize_fn vfs_ea_getsize;
123 vfs_ea_getcontent_fn vfs_ea_getcontent;
124 vfs_ea_list_fn vfs_ea_list;
125 vfs_ea_set_fn vfs_ea_set;
126 vfs_ea_remove_fn vfs_ea_remove;
127};
128
129extern void initvol_vfs(struct vol *vol);
130
131#endif /* ATALK_VFS_H */
acl.h
adouble.h
Part of Netatalk's AppleDouble implementatation.
rbuflen
static size_t rbuflen
Definition afpfunc_helpers.c:45
rbuf
static char rbuf[rbufsize]
Definition afpfunc_helpers.c:44
config.h
volume.h
type
static enum op type
Definition nad_cp.c:96
count
int count
Definition server_ipc.c:89
dir
Definition include/atalk/directory.h:56
path
Definition include/atalk/directory.h:123
vfs_ops
Definition vfs.h:98
vfs_ops::vfs_posix_acl
vfs_posix_acl_fn vfs_posix_acl
Definition vfs.h:116
vfs_ops::vfs_ea_getcontent
vfs_ea_getcontent_fn vfs_ea_getcontent
Definition vfs.h:123
vfs_ops::vfs_ea_remove
vfs_ea_remove_fn vfs_ea_remove
Definition vfs.h:126
vfs_ops::vfs_renamedir
vfs_renamedir_fn vfs_renamedir
Definition vfs.h:101
vfs_ops::vfs_chown
vfs_chown_fn vfs_chown
Definition vfs.h:100
vfs_ops::vfs_ea_getsize
vfs_ea_getsize_fn vfs_ea_getsize
Definition vfs.h:122
vfs_ops::vfs_setdirmode
vfs_setdirmode_fn vfs_setdirmode
Definition vfs.h:104
vfs_ops::vfs_setfilmode
vfs_setfilmode_fn vfs_setfilmode
Definition vfs.h:103
vfs_ops::vfs_ea_set
vfs_ea_set_fn vfs_ea_set
Definition vfs.h:125
vfs_ops::vfs_deletefile
vfs_deletefile_fn vfs_deletefile
Definition vfs.h:107
vfs_ops::vfs_remove_acl
vfs_remove_acl_fn vfs_remove_acl
Definition vfs.h:118
vfs_ops::vfs_renamefile
vfs_renamefile_fn vfs_renamefile
Definition vfs.h:108
vfs_ops::vfs_solaris_acl
vfs_solaris_acl_fn vfs_solaris_acl
Definition vfs.h:113
vfs_ops::vfs_ea_list
vfs_ea_list_fn vfs_ea_list
Definition vfs.h:124
vfs_ops::vfs_setdirowner
vfs_setdirowner_fn vfs_setdirowner
Definition vfs.h:106
vfs_ops::vfs_validupath
vfs_validupath_fn vfs_validupath
Definition vfs.h:99
vfs_ops::vfs_copyfile
vfs_copyfile_fn vfs_copyfile
Definition vfs.h:109
vfs_ops::vfs_setdirunixmode
vfs_setdirunixmode_fn vfs_setdirunixmode
Definition vfs.h:105
vfs_ops::vfs_deletecurdir
vfs_deletecurdir_fn vfs_deletecurdir
Definition vfs.h:102
vol
Definition include/atalk/volume.h:33
initvol_vfs
void initvol_vfs(struct vol *vol)
Definition vfs.c:1330
vfs_copyfile_fn
int(* vfs_copyfile_fn)(const struct vol *vol, int sfd, const char *src, const char *dst)
Definition vfs.h:57
vfs_deletecurdir_fn
int(* vfs_deletecurdir_fn)(const struct vol *vol)
Definition vfs.h:44
vfs_remove_acl_fn
int(* vfs_remove_acl_fn)(const struct vol *vol, const char *path, int dir)
Definition vfs.h:70
vfs_setfilmode_fn
int(* vfs_setfilmode_fn)(const struct vol *vol, const char *name, mode_t mode, struct stat *st)
Definition vfs.h:45
vfs_setdirmode_fn
int(* vfs_setdirmode_fn)(const struct vol *vol, const char *name, mode_t mode, struct stat *st)
Definition vfs.h:47
vfs_ea_getcontent_fn
int(* vfs_ea_getcontent_fn)(const struct vol *vol, char *rbuf, size_t *rbuflen, const char *uname, int oflag, const char *attruname, int maxreply, int fd)
Definition vfs.h:77
vfs_chown_fn
int(* vfs_chown_fn)(const struct vol *vol, const char *path, uid_t uid, gid_t gid)
Definition vfs.h:40
vfs_ea_set_fn
int(* vfs_ea_set_fn)(const struct vol *vol, const char *uname, const char *attruname, const char *ibuf, size_t attrsize, int oflag, int fd)
Definition vfs.h:85
vfs_ea_list_fn
int(* vfs_ea_list_fn)(const struct vol *vol, char *attrnamebuf, size_t *buflen, const char *uname, int oflag, int fd)
Definition vfs.h:82
vfs_ea_getsize_fn
int(* vfs_ea_getsize_fn)(const struct vol *vol, char *rbuf, size_t *rbuflen, const char *uname, int oflag, const char *attruname, int fd)
Definition vfs.h:73
vfs_renamedir_fn
int(* vfs_renamedir_fn)(const struct vol *vol, int dirfd, const char *oldpath, const char *newpath)
Definition vfs.h:42
vfs_solaris_acl_fn
int(* vfs_solaris_acl_fn)(const struct vol *vol, const char *path, int cmd, int count, void *aces)
Definition vfs.h:61
vfs_validupath_fn
int(* vfs_validupath_fn)(const struct vol *vol, const char *name)
Definition vfs.h:39
vfs_posix_acl_fn
int(* vfs_posix_acl_fn)(const struct vol *vol, const char *path, acl_type_t type, int count, acl_t acl)
Definition vfs.h:66
vfs_ea_remove_fn
int(* vfs_ea_remove_fn)(const struct vol *vol, const char *uname, const char *attruname, int oflag, int fd)
Definition vfs.h:89
vfs_setdirowner_fn
int(* vfs_setdirowner_fn)(const struct vol *vol, const char *name, uid_t uid, gid_t gid)
Definition vfs.h:51
vfs_setdirunixmode_fn
int(* vfs_setdirunixmode_fn)(const struct vol *vol, const char *name, mode_t mode, struct stat *st)
Definition vfs.h:49
vfs_deletefile_fn
int(* vfs_deletefile_fn)(const struct vol *vol, int dirfd, const char *file)
Definition vfs.h:53
vfs_renamefile_fn
int(* vfs_renamefile_fn)(const struct vol *vol, int dirfd, const char *src, const char *dst)
Definition vfs.h:55