236 vsecattr_t *vsecp);
237 static int port_fop_rmdir(femarg_t *vf, char *nm, vnode_t *cdir, cred_t *cr,
238 caller_context_t *ct, int flags);
239 static int port_fop_readdir(femarg_t *vf, uio_t *uiop, cred_t *cr, int *eofp,
240 caller_context_t *ct, int flags);
241 static int port_fop_symlink(femarg_t *vf, char *linkname, vattr_t *vap,
242 char *target, cred_t *cr, caller_context_t *ct, int flags);
243 static int port_fop_setsecattr(femarg_t *vf, vsecattr_t *vsap, int flag,
244 cred_t *cr, caller_context_t *ct);
245
246 static int port_fop_vnevent(femarg_t *vf, vnevent_t vnevent, vnode_t *dvp,
247 char *cname, caller_context_t *ct);
248
249 static int port_fop_unmount(fsemarg_t *vf, int flag, cred_t *cr);
250
251
252 /*
253 * Fem hooks.
254 */
255 const fs_operation_def_t port_vnodesrc_template[] = {
256 VOPNAME_OPEN, { .femop_open = port_fop_open },
257 VOPNAME_READ, { .femop_read = port_fop_read },
258 VOPNAME_WRITE, { .femop_write = port_fop_write },
259 VOPNAME_MAP, { .femop_map = port_fop_map },
260 VOPNAME_SETATTR, { .femop_setattr = port_fop_setattr },
261 VOPNAME_CREATE, { .femop_create = port_fop_create },
262 VOPNAME_REMOVE, { .femop_remove = port_fop_remove },
263 VOPNAME_LINK, { .femop_link = port_fop_link },
264 VOPNAME_RENAME, { .femop_rename = port_fop_rename },
265 VOPNAME_MKDIR, { .femop_mkdir = port_fop_mkdir },
266 VOPNAME_RMDIR, { .femop_rmdir = port_fop_rmdir },
267 VOPNAME_READDIR, { .femop_readdir = port_fop_readdir },
268 VOPNAME_SYMLINK, { .femop_symlink = port_fop_symlink },
269 VOPNAME_SETSECATTR, { .femop_setsecattr = port_fop_setsecattr },
270 VOPNAME_VNEVENT, { .femop_vnevent = port_fop_vnevent },
271 NULL, NULL
272 };
273
274 /*
275 * Fsem - vfs ops hooks
276 */
277 const fs_operation_def_t port_vfssrc_template[] = {
278 VFSNAME_UNMOUNT, { .fsemop_unmount = port_fop_unmount },
279 NULL, NULL
280 };
281
282 fem_t *fop_femop;
283 fsem_t *fop_fsemop;
284
285 static fem_t *
286 port_fop_femop()
287 {
288 fem_t *femp;
289 if (fop_femop != NULL)
290 return (fop_femop);
291 if (fem_create("portfop_fem",
292 (const struct fs_operation_def *)port_vnodesrc_template,
293 (fem_t **)&femp)) {
294 return (NULL);
295 }
296 if (atomic_cas_ptr(&fop_femop, NULL, femp) != NULL) {
297 /*
298 * some other thread beat us to it.
299 */
|
236 vsecattr_t *vsecp);
237 static int port_fop_rmdir(femarg_t *vf, char *nm, vnode_t *cdir, cred_t *cr,
238 caller_context_t *ct, int flags);
239 static int port_fop_readdir(femarg_t *vf, uio_t *uiop, cred_t *cr, int *eofp,
240 caller_context_t *ct, int flags);
241 static int port_fop_symlink(femarg_t *vf, char *linkname, vattr_t *vap,
242 char *target, cred_t *cr, caller_context_t *ct, int flags);
243 static int port_fop_setsecattr(femarg_t *vf, vsecattr_t *vsap, int flag,
244 cred_t *cr, caller_context_t *ct);
245
246 static int port_fop_vnevent(femarg_t *vf, vnevent_t vnevent, vnode_t *dvp,
247 char *cname, caller_context_t *ct);
248
249 static int port_fop_unmount(fsemarg_t *vf, int flag, cred_t *cr);
250
251
252 /*
253 * Fem hooks.
254 */
255 const fs_operation_def_t port_vnodesrc_template[] = {
256 { VOPNAME_OPEN, { .femop_open = port_fop_open } },
257 { VOPNAME_READ, { .femop_read = port_fop_read } },
258 { VOPNAME_WRITE, { .femop_write = port_fop_write } },
259 { VOPNAME_MAP, { .femop_map = port_fop_map } },
260 { VOPNAME_SETATTR, { .femop_setattr = port_fop_setattr } },
261 { VOPNAME_CREATE, { .femop_create = port_fop_create } },
262 { VOPNAME_REMOVE, { .femop_remove = port_fop_remove } },
263 { VOPNAME_LINK, { .femop_link = port_fop_link } },
264 { VOPNAME_RENAME, { .femop_rename = port_fop_rename } },
265 { VOPNAME_MKDIR, { .femop_mkdir = port_fop_mkdir } },
266 { VOPNAME_RMDIR, { .femop_rmdir = port_fop_rmdir } },
267 { VOPNAME_READDIR, { .femop_readdir = port_fop_readdir } },
268 { VOPNAME_SYMLINK, { .femop_symlink = port_fop_symlink } },
269 { VOPNAME_SETSECATTR, { .femop_setsecattr = port_fop_setsecattr } },
270 { VOPNAME_VNEVENT, { .femop_vnevent = port_fop_vnevent } },
271 { NULL, { NULL } }
272 };
273
274 /*
275 * Fsem - vfs ops hooks
276 */
277 const fs_operation_def_t port_vfssrc_template[] = {
278 { VFSNAME_UNMOUNT, { .fsemop_unmount = port_fop_unmount } },
279 { NULL, { NULL } }
280 };
281
282 fem_t *fop_femop;
283 fsem_t *fop_fsemop;
284
285 static fem_t *
286 port_fop_femop()
287 {
288 fem_t *femp;
289 if (fop_femop != NULL)
290 return (fop_femop);
291 if (fem_create("portfop_fem",
292 (const struct fs_operation_def *)port_vnodesrc_template,
293 (fem_t **)&femp)) {
294 return (NULL);
295 }
296 if (atomic_cas_ptr(&fop_femop, NULL, femp) != NULL) {
297 /*
298 * some other thread beat us to it.
299 */
|