MCPcopy Create free account
hub / github.com/F-Stack/f-stack / extattr_delete_vp

Function extattr_delete_vp

freebsd/kern/vfs_extattr.c:493–523  ·  view source on GitHub ↗

* extattr_delete_vp(): Delete a named extended attribute on a file or * directory * * Arguments: unlocked vnode "vp", attribute namespace "attrnamespace", * kernelspace string pointer "attrname", proc "p" * Returns: 0 on success, an error number otherwise * Locks: none * References: vp must be a valid reference for the duration of the call */

Source from the content-addressed store, hash-verified

491 * References: vp must be a valid reference for the duration of the call
492 */
493static int
494extattr_delete_vp(struct vnode *vp, int attrnamespace, const char *attrname,
495 struct thread *td)
496{
497 struct mount *mp;
498 int error;
499
500 error = vn_start_write(vp, &mp, V_WAIT | PCATCH);
501 if (error)
502 return (error);
503 vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
504
505#ifdef MAC
506 error = mac_vnode_check_deleteextattr(td->td_ucred, vp, attrnamespace,
507 attrname);
508 if (error)
509 goto done;
510#endif
511
512 error = VOP_DELETEEXTATTR(vp, attrnamespace, attrname, td->td_ucred,
513 td);
514 if (error == EOPNOTSUPP)
515 error = VOP_SETEXTATTR(vp, attrnamespace, attrname, NULL,
516 td->td_ucred, td);
517#ifdef MAC
518done:
519#endif
520 VOP_UNLOCK(vp);
521 vn_finished_write(mp);
522 return (error);
523}
524
525#ifndef _SYS_SYSPROTO_H_
526struct extattr_delete_fd_args {

Callers 2

sys_extattr_delete_fdFunction · 0.85
kern_extattr_delete_pathFunction · 0.85

Calls 4

vn_start_writeFunction · 0.85
vn_lockFunction · 0.85
vn_finished_writeFunction · 0.85

Tested by

no test coverage detected