17 * information: Portions Copyright [yyyy] [name of copyright owner] |
17 * information: Portions Copyright [yyyy] [name of copyright owner] |
18 * |
18 * |
19 * CDDL HEADER END |
19 * CDDL HEADER END |
20 */ |
20 */ |
21 /* |
21 /* |
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. |
22 * Copyright 2010 Sun Microsystems, Inc. All rights reserved. |
23 * Use is subject to license terms. |
23 * Use is subject to license terms. |
24 */ |
24 */ |
25 |
25 |
26 #ifndef _SYS_FS_ZFS_VFSOPS_H |
26 #ifndef _SYS_FS_ZFS_VFSOPS_H |
27 #define _SYS_FS_ZFS_VFSOPS_H |
27 #define _SYS_FS_ZFS_VFSOPS_H |
29 #include <sys/isa_defs.h> |
29 #include <sys/isa_defs.h> |
30 #include <sys/types32.h> |
30 #include <sys/types32.h> |
31 #include <sys/list.h> |
31 #include <sys/list.h> |
32 #include <sys/vfs.h> |
32 #include <sys/vfs.h> |
33 #include <sys/zil.h> |
33 #include <sys/zil.h> |
|
34 #include <sys/sa.h> |
34 #include <sys/rrwlock.h> |
35 #include <sys/rrwlock.h> |
35 #include <sys/zfs_ioctl.h> |
36 #include <sys/zfs_ioctl.h> |
36 |
37 |
37 #ifdef __cplusplus |
38 #ifdef __cplusplus |
38 extern "C" { |
39 extern "C" { |
39 #endif |
40 #endif |
40 |
41 |
41 typedef struct zfsvfs zfsvfs_t; |
42 typedef struct zfsvfs zfsvfs_t; |
|
43 struct znode; |
42 |
44 |
43 struct zfsvfs { |
45 struct zfsvfs { |
44 vfs_t *z_vfs; /* generic fs struct */ |
46 vfs_t *z_vfs; /* generic fs struct */ |
45 zfsvfs_t *z_parent; /* parent fs */ |
47 zfsvfs_t *z_parent; /* parent fs */ |
46 objset_t *z_os; /* objset reference */ |
48 objset_t *z_os; /* objset reference */ |
71 boolean_t z_show_ctldir; /* expose .zfs in the root dir */ |
73 boolean_t z_show_ctldir; /* expose .zfs in the root dir */ |
72 boolean_t z_issnap; /* true if this is a snapshot */ |
74 boolean_t z_issnap; /* true if this is a snapshot */ |
73 boolean_t z_vscan; /* virus scan on/off */ |
75 boolean_t z_vscan; /* virus scan on/off */ |
74 boolean_t z_use_fuids; /* version allows fuids */ |
76 boolean_t z_use_fuids; /* version allows fuids */ |
75 boolean_t z_replay; /* set during ZIL replay */ |
77 boolean_t z_replay; /* set during ZIL replay */ |
|
78 boolean_t z_use_sa; /* version allow system attributes */ |
76 uint64_t z_version; /* ZPL version */ |
79 uint64_t z_version; /* ZPL version */ |
77 uint64_t z_shares_dir; /* hidden shares dir */ |
80 uint64_t z_shares_dir; /* hidden shares dir */ |
78 kmutex_t z_lock; |
81 kmutex_t z_lock; |
79 uint64_t z_userquota_obj; |
82 uint64_t z_userquota_obj; |
80 uint64_t z_groupquota_obj; |
83 uint64_t z_groupquota_obj; |
|
84 sa_attr_type_t *z_attr_table; /* SA attr mapping->id */ |
81 #define ZFS_OBJ_MTX_SZ 64 |
85 #define ZFS_OBJ_MTX_SZ 64 |
82 kmutex_t z_hold_mtx[ZFS_OBJ_MTX_SZ]; /* znode hold locks */ |
86 kmutex_t z_hold_mtx[ZFS_OBJ_MTX_SZ]; /* znode hold locks */ |
83 }; |
87 }; |
84 |
88 |
85 /* |
89 /* |
138 const char *domain, uint64_t rid, uint64_t *valuep); |
142 const char *domain, uint64_t rid, uint64_t *valuep); |
139 extern int zfs_userspace_many(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type, |
143 extern int zfs_userspace_many(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type, |
140 uint64_t *cookiep, void *vbuf, uint64_t *bufsizep); |
144 uint64_t *cookiep, void *vbuf, uint64_t *bufsizep); |
141 extern int zfs_set_userquota(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type, |
145 extern int zfs_set_userquota(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type, |
142 const char *domain, uint64_t rid, uint64_t quota); |
146 const char *domain, uint64_t rid, uint64_t quota); |
143 extern boolean_t zfs_usergroup_overquota(zfsvfs_t *zfsvfs, |
147 extern boolean_t zfs_owner_overquota(zfsvfs_t *zfsvfs, struct znode *, |
144 boolean_t isgroup, uint64_t fuid); |
148 boolean_t isgroup); |
|
149 extern boolean_t zfs_fuid_overquota(zfsvfs_t *zfsvfs, boolean_t isgroup, |
|
150 uint64_t fuid); |
145 extern int zfs_set_version(zfsvfs_t *zfsvfs, uint64_t newvers); |
151 extern int zfs_set_version(zfsvfs_t *zfsvfs, uint64_t newvers); |
146 extern int zfsvfs_create(const char *name, zfsvfs_t **zfvp); |
152 extern int zfsvfs_create(const char *name, zfsvfs_t **zfvp); |
147 extern void zfsvfs_free(zfsvfs_t *zfsvfs); |
153 extern void zfsvfs_free(zfsvfs_t *zfsvfs); |
148 extern int zfs_check_global_label(const char *dsname, const char *hexsl); |
154 extern int zfs_check_global_label(const char *dsname, const char *hexsl); |
149 |
155 |