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

Function kern_extattr_set_path

freebsd/kern/vfs_extattr.c:291–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291static int
292kern_extattr_set_path(struct thread *td, const char *path, int attrnamespace,
293 const char *uattrname, void *data, size_t nbytes, int follow)
294{
295 struct nameidata nd;
296 char attrname[EXTATTR_MAXNAMELEN + 1];
297 int error;
298
299 AUDIT_ARG_VALUE(attrnamespace);
300 error = copyinstr(uattrname, attrname, sizeof(attrname), NULL);
301 if (error)
302 return (error);
303 AUDIT_ARG_TEXT(attrname);
304
305 NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path, td);
306 error = namei(&nd);
307 if (error)
308 return (error);
309 NDFREE(&nd, NDF_ONLY_PNBUF);
310
311 error = extattr_set_vp(nd.ni_vp, attrnamespace, attrname, data,
312 nbytes, td);
313
314 vrele(nd.ni_vp);
315 return (error);
316}
317
318/*-
319 * Get a named extended attribute on a file or directory

Callers 2

sys_extattr_set_fileFunction · 0.85
sys_extattr_set_linkFunction · 0.85

Calls 5

nameiFunction · 0.85
NDFREEFunction · 0.85
extattr_set_vpFunction · 0.85
vreleFunction · 0.70
copyinstrFunction · 0.50

Tested by

no test coverage detected