o Rename "namespace" argument to "attrnamespace" as namespace is a C++
reserved word. Submitted by: jkh Obtained from: TrustedBSD Project
This commit is contained in:
parent
d51048c93b
commit
3063207147
@ -508,16 +508,16 @@
|
||||
354 STD BSD { int __acl_aclcheck_fd(int filedes, acl_type_t type, \
|
||||
struct acl *aclp); }
|
||||
355 STD BSD { int extattrctl(const char *path, int cmd, \
|
||||
const char *filename, int namespace, \
|
||||
const char *filename, int attrnamespace, \
|
||||
const char *attrname); }
|
||||
356 STD BSD { int extattr_set_file(const char *path, \
|
||||
int namespace, const char *attrname, \
|
||||
int attrnamespace, const char *attrname, \
|
||||
struct iovec *iovp, unsigned iovcnt); }
|
||||
357 STD BSD { int extattr_get_file(const char *path, \
|
||||
int namespace, const char *attrname, \
|
||||
int attrnamespace, const char *attrname, \
|
||||
struct iovec *iovp, unsigned iovcnt); }
|
||||
358 STD BSD { int extattr_delete_file(const char *path, \
|
||||
int namespace, const char *attrname); }
|
||||
int attrnamespace, const char *attrname); }
|
||||
359 STD BSD { int aio_waitcomplete(struct aiocb **aiocbp, struct timespec *timeout); }
|
||||
360 STD BSD { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); }
|
||||
361 STD BSD { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); }
|
||||
|
@ -739,11 +739,11 @@ vfs_stduninit (vfsp)
|
||||
}
|
||||
|
||||
int
|
||||
vfs_stdextattrctl(mp, cmd, filename_vp, namespace, attrname, p)
|
||||
vfs_stdextattrctl(mp, cmd, filename_vp, attrnamespace, attrname, p)
|
||||
struct mount *mp;
|
||||
int cmd;
|
||||
struct vnode *filename_vp;
|
||||
int namespace;
|
||||
int attrnamespace;
|
||||
const char *attrname;
|
||||
struct proc *p;
|
||||
{
|
||||
|
@ -3726,10 +3726,10 @@ extattrctl(p, uap)
|
||||
|
||||
if (SCARG(uap, attrname) != NULL) {
|
||||
error = VFS_EXTATTRCTL(mp, SCARG(uap, cmd), filename_vp,
|
||||
SCARG(uap, namespace), attrname, p);
|
||||
SCARG(uap, attrnamespace), attrname, p);
|
||||
} else {
|
||||
error = VFS_EXTATTRCTL(mp, SCARG(uap, cmd), filename_vp,
|
||||
SCARG(uap, namespace), NULL, p);
|
||||
SCARG(uap, attrnamespace), NULL, p);
|
||||
}
|
||||
|
||||
vn_finished_write(mp);
|
||||
@ -3801,7 +3801,7 @@ extattr_set_file(p, uap)
|
||||
iov++;
|
||||
}
|
||||
cnt = auio.uio_resid;
|
||||
error = VOP_SETEXTATTR(nd.ni_vp, SCARG(uap, namespace), attrname,
|
||||
error = VOP_SETEXTATTR(nd.ni_vp, SCARG(uap, attrnamespace), attrname,
|
||||
&auio, p->p_cred->pc_ucred, p);
|
||||
cnt -= auio.uio_resid;
|
||||
p->p_retval[0] = cnt;
|
||||
@ -3868,7 +3868,7 @@ extattr_get_file(p, uap)
|
||||
iov++;
|
||||
}
|
||||
cnt = auio.uio_resid;
|
||||
error = VOP_GETEXTATTR(nd.ni_vp, SCARG(uap, namespace), attrname,
|
||||
error = VOP_GETEXTATTR(nd.ni_vp, SCARG(uap, attrnamespace), attrname,
|
||||
&auio, p->p_cred->pc_ucred, p);
|
||||
cnt -= auio.uio_resid;
|
||||
p->p_retval[0] = cnt;
|
||||
@ -3904,7 +3904,7 @@ extattr_delete_file(p, uap)
|
||||
NDFREE(&nd, 0);
|
||||
return (error);
|
||||
}
|
||||
error = VOP_SETEXTATTR(nd.ni_vp, SCARG(uap, namespace), attrname,
|
||||
error = VOP_SETEXTATTR(nd.ni_vp, SCARG(uap, attrnamespace), attrname,
|
||||
NULL, p->p_cred->pc_ucred, p);
|
||||
NDFREE(&nd, 0);
|
||||
vn_finished_write(mp);
|
||||
|
@ -3726,10 +3726,10 @@ extattrctl(p, uap)
|
||||
|
||||
if (SCARG(uap, attrname) != NULL) {
|
||||
error = VFS_EXTATTRCTL(mp, SCARG(uap, cmd), filename_vp,
|
||||
SCARG(uap, namespace), attrname, p);
|
||||
SCARG(uap, attrnamespace), attrname, p);
|
||||
} else {
|
||||
error = VFS_EXTATTRCTL(mp, SCARG(uap, cmd), filename_vp,
|
||||
SCARG(uap, namespace), NULL, p);
|
||||
SCARG(uap, attrnamespace), NULL, p);
|
||||
}
|
||||
|
||||
vn_finished_write(mp);
|
||||
@ -3801,7 +3801,7 @@ extattr_set_file(p, uap)
|
||||
iov++;
|
||||
}
|
||||
cnt = auio.uio_resid;
|
||||
error = VOP_SETEXTATTR(nd.ni_vp, SCARG(uap, namespace), attrname,
|
||||
error = VOP_SETEXTATTR(nd.ni_vp, SCARG(uap, attrnamespace), attrname,
|
||||
&auio, p->p_cred->pc_ucred, p);
|
||||
cnt -= auio.uio_resid;
|
||||
p->p_retval[0] = cnt;
|
||||
@ -3868,7 +3868,7 @@ extattr_get_file(p, uap)
|
||||
iov++;
|
||||
}
|
||||
cnt = auio.uio_resid;
|
||||
error = VOP_GETEXTATTR(nd.ni_vp, SCARG(uap, namespace), attrname,
|
||||
error = VOP_GETEXTATTR(nd.ni_vp, SCARG(uap, attrnamespace), attrname,
|
||||
&auio, p->p_cred->pc_ucred, p);
|
||||
cnt -= auio.uio_resid;
|
||||
p->p_retval[0] = cnt;
|
||||
@ -3904,7 +3904,7 @@ extattr_delete_file(p, uap)
|
||||
NDFREE(&nd, 0);
|
||||
return (error);
|
||||
}
|
||||
error = VOP_SETEXTATTR(nd.ni_vp, SCARG(uap, namespace), attrname,
|
||||
error = VOP_SETEXTATTR(nd.ni_vp, SCARG(uap, attrnamespace), attrname,
|
||||
NULL, p->p_cred->pc_ucred, p);
|
||||
NDFREE(&nd, 0);
|
||||
vn_finished_write(mp);
|
||||
|
@ -808,7 +808,7 @@ vn_kqfilter(struct file *fp, struct knote *kn)
|
||||
* Set IO_NODELOCKED in ioflg if the vnode is already locked.
|
||||
*/
|
||||
int
|
||||
vn_extattr_get(struct vnode *vp, int ioflg, int namespace,
|
||||
vn_extattr_get(struct vnode *vp, int ioflg, int attrnamespace,
|
||||
const char *attrname, int *buflen, char *buf, struct proc *p)
|
||||
{
|
||||
struct uio auio;
|
||||
@ -830,7 +830,7 @@ vn_extattr_get(struct vnode *vp, int ioflg, int namespace,
|
||||
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
|
||||
|
||||
/* authorize attribute retrieval as kernel */
|
||||
error = VOP_GETEXTATTR(vp, namespace, attrname, &auio, NULL, p);
|
||||
error = VOP_GETEXTATTR(vp, attrnamespace, attrname, &auio, NULL, p);
|
||||
|
||||
if ((ioflg & IO_NODELOCKED) == 0)
|
||||
VOP_UNLOCK(vp, 0, p);
|
||||
@ -846,7 +846,7 @@ vn_extattr_get(struct vnode *vp, int ioflg, int namespace,
|
||||
* XXX failure mode if partially written?
|
||||
*/
|
||||
int
|
||||
vn_extattr_set(struct vnode *vp, int ioflg, int namespace,
|
||||
vn_extattr_set(struct vnode *vp, int ioflg, int attrnamespace,
|
||||
const char *attrname, int buflen, char *buf, struct proc *p)
|
||||
{
|
||||
struct uio auio;
|
||||
@ -872,7 +872,7 @@ vn_extattr_set(struct vnode *vp, int ioflg, int namespace,
|
||||
}
|
||||
|
||||
/* authorize attribute setting as kernel */
|
||||
error = VOP_SETEXTATTR(vp, namespace, attrname, &auio, NULL, p);
|
||||
error = VOP_SETEXTATTR(vp, attrnamespace, attrname, &auio, NULL, p);
|
||||
|
||||
if ((ioflg & IO_NODELOCKED) == 0) {
|
||||
vn_finished_write(mp);
|
||||
@ -883,8 +883,8 @@ vn_extattr_set(struct vnode *vp, int ioflg, int namespace,
|
||||
}
|
||||
|
||||
int
|
||||
vn_extattr_rm(struct vnode *vp, int ioflg, int namespace, const char *attrname,
|
||||
struct proc *p)
|
||||
vn_extattr_rm(struct vnode *vp, int ioflg, int attrnamespace,
|
||||
const char *attrname, struct proc *p)
|
||||
{
|
||||
struct mount *mp;
|
||||
int error;
|
||||
@ -896,7 +896,7 @@ vn_extattr_rm(struct vnode *vp, int ioflg, int namespace, const char *attrname,
|
||||
}
|
||||
|
||||
/* authorize attribute removal as kernel */
|
||||
error = VOP_SETEXTATTR(vp, namespace, attrname, NULL, NULL, p);
|
||||
error = VOP_SETEXTATTR(vp, attrnamespace, attrname, NULL, NULL, p);
|
||||
|
||||
if ((ioflg & IO_NODELOCKED) == 0) {
|
||||
vn_finished_write(mp);
|
||||
|
@ -529,7 +529,7 @@ vop_aclcheck {
|
||||
#
|
||||
vop_getextattr {
|
||||
IN struct vnode *vp;
|
||||
IN int namespace;
|
||||
IN int attrnamespace;
|
||||
IN const char *name;
|
||||
INOUT struct uio *uio;
|
||||
IN struct ucred *cred;
|
||||
@ -541,7 +541,7 @@ vop_getextattr {
|
||||
#
|
||||
vop_setextattr {
|
||||
IN struct vnode *vp;
|
||||
IN int namespace;
|
||||
IN int attrnamespace;
|
||||
IN const char *name;
|
||||
INOUT struct uio *uio;
|
||||
IN struct ucred *cred;
|
||||
|
@ -58,12 +58,12 @@ struct iovec;
|
||||
|
||||
__BEGIN_DECLS
|
||||
int extattrctl(const char *path, int cmd, const char *filename,
|
||||
int namespace, const char *attrname);
|
||||
int extattr_delete_file(const char *path, int namespace,
|
||||
int attrnamespace, const char *attrname);
|
||||
int extattr_delete_file(const char *path, int attrnamespace,
|
||||
const char *attrname);
|
||||
int extattr_get_file(const char *path, int namespace,
|
||||
int extattr_get_file(const char *path, int attrnamespace,
|
||||
const char *attrname, struct iovec *iovp, unsigned iovcnt);
|
||||
int extattr_set_file(const char *path, int namespace,
|
||||
int extattr_set_file(const char *path, int attrnamespace,
|
||||
const char *attrname, struct iovec *iovp, unsigned iovcnt);
|
||||
__END_DECLS
|
||||
|
||||
|
@ -340,7 +340,7 @@ struct vfsops {
|
||||
int (*vfs_uninit) __P((struct vfsconf *));
|
||||
int (*vfs_extattrctl) __P((struct mount *mp, int cmd,
|
||||
struct vnode *filename_vp,
|
||||
int namespace, const char *attrname,
|
||||
int attrnamespace, const char *attrname,
|
||||
struct proc *p));
|
||||
};
|
||||
|
||||
@ -455,7 +455,7 @@ int vfs_stdvptofh __P((struct vnode *vp, struct fid *fhp));
|
||||
int vfs_stdinit __P((struct vfsconf *));
|
||||
int vfs_stduninit __P((struct vfsconf *));
|
||||
int vfs_stdextattrctl __P((struct mount *mp, int cmd,
|
||||
struct vnode *filename_vp, int namespace, const char *attrname,
|
||||
struct vnode *filename_vp, int attrnamespace, const char *attrname,
|
||||
struct proc *p));
|
||||
|
||||
/* XXX - these should be indirect functions!!! */
|
||||
|
@ -607,11 +607,11 @@ dev_t vn_todev __P((struct vnode *vp));
|
||||
int vn_write_suspend_wait __P((struct vnode *vp, struct mount *mp,
|
||||
int flags));
|
||||
int vn_writechk __P((struct vnode *vp));
|
||||
int vn_extattr_get __P((struct vnode *vp, int ioflg, int namespace,
|
||||
int vn_extattr_get __P((struct vnode *vp, int ioflg, int attrnamespace,
|
||||
const char *attrname, int *buflen, char *buf, struct proc *p));
|
||||
int vn_extattr_set __P((struct vnode *vp, int ioflg, int namespace,
|
||||
int vn_extattr_set __P((struct vnode *vp, int ioflg, int attrnamespace,
|
||||
const char *attrname, int buflen, char *buf, struct proc *p));
|
||||
int vn_extattr_rm(struct vnode *vp, int ioflg, int namespace,
|
||||
int vn_extattr_rm(struct vnode *vp, int ioflg, int attrnamespace,
|
||||
const char *attrname, struct proc *p);
|
||||
int vfs_cache_lookup __P((struct vop_lookup_args *ap));
|
||||
int vfs_object_create __P((struct vnode *vp, struct proc *p,
|
||||
|
@ -77,7 +77,7 @@ LIST_HEAD(ufs_extattr_list_head, ufs_extattr_list_entry);
|
||||
struct ufs_extattr_list_entry {
|
||||
LIST_ENTRY(ufs_extattr_list_entry) uele_entries;
|
||||
struct ufs_extattr_fileheader uele_fileheader;
|
||||
int uele_namespace;
|
||||
int uele_attrnamespace;
|
||||
char uele_attrname[UFS_EXTATTR_MAXEXTATTRNAME];
|
||||
struct vnode *uele_backing_vnode;
|
||||
};
|
||||
@ -97,7 +97,7 @@ int ufs_extattr_start(struct mount *mp, struct proc *p);
|
||||
int ufs_extattr_autostart(struct mount *mp, struct proc *p);
|
||||
int ufs_extattr_stop(struct mount *mp, struct proc *p);
|
||||
int ufs_extattrctl(struct mount *mp, int cmd, struct vnode *filename,
|
||||
int namespace, const char *attrname, struct proc *p);
|
||||
int attrnamespace, const char *attrname, struct proc *p);
|
||||
int ufs_vop_getextattr(struct vop_getextattr_args *ap);
|
||||
int ufs_vop_setextattr(struct vop_setextattr_args *ap);
|
||||
void ufs_extattr_vnode_inactive(struct vnode *vp, struct proc *p);
|
||||
|
@ -64,16 +64,16 @@ static int ufs_extattr_credcheck(struct vnode *vp,
|
||||
struct ufs_extattr_list_entry *uele, struct ucred *cred, struct proc *p,
|
||||
int access);
|
||||
static int ufs_extattr_enable_with_open(struct ufsmount *ump,
|
||||
struct vnode *vp, int namespace, const char *attrname, struct proc *p);
|
||||
static int ufs_extattr_enable(struct ufsmount *ump, int namespace,
|
||||
struct vnode *vp, int attrnamespace, const char *attrname, struct proc *p);
|
||||
static int ufs_extattr_enable(struct ufsmount *ump, int attrnamespace,
|
||||
const char *attrname, struct vnode *backing_vnode, struct proc *p);
|
||||
static int ufs_extattr_disable(struct ufsmount *ump, int namespace,
|
||||
static int ufs_extattr_disable(struct ufsmount *ump, int attrnamespace,
|
||||
const char *attrname, struct proc *p);
|
||||
static int ufs_extattr_get(struct vnode *vp, int namespace,
|
||||
static int ufs_extattr_get(struct vnode *vp, int attrnamespace,
|
||||
const char *name, struct uio *uio, struct ucred *cred, struct proc *p);
|
||||
static int ufs_extattr_set(struct vnode *vp, int namespace,
|
||||
static int ufs_extattr_set(struct vnode *vp, int attrnamespace,
|
||||
const char *name, struct uio *uio, struct ucred *cred, struct proc *p);
|
||||
static int ufs_extattr_rm(struct vnode *vp, int namespace,
|
||||
static int ufs_extattr_rm(struct vnode *vp, int attrnamespace,
|
||||
const char *name, struct ucred *cred, struct proc *p);
|
||||
|
||||
/*
|
||||
@ -124,7 +124,7 @@ ufs_extattr_valid_attrname(const char *attrname)
|
||||
* Must be holding uepm lock for the mount point.
|
||||
*/
|
||||
static struct ufs_extattr_list_entry *
|
||||
ufs_extattr_find_attr(struct ufsmount *ump, int namespace,
|
||||
ufs_extattr_find_attr(struct ufsmount *ump, int attrnamespace,
|
||||
const char *attrname)
|
||||
{
|
||||
struct ufs_extattr_list_entry *search_attribute;
|
||||
@ -134,7 +134,7 @@ ufs_extattr_find_attr(struct ufsmount *ump, int namespace,
|
||||
search_attribute = LIST_NEXT(search_attribute, uele_entries)) {
|
||||
if (!(strncmp(attrname, search_attribute->uele_attrname,
|
||||
UFS_EXTATTR_MAXEXTATTRNAME)) &&
|
||||
(namespace == search_attribute->uele_namespace)) {
|
||||
(attrnamespace == search_attribute->uele_attrnamespace)) {
|
||||
return (search_attribute);
|
||||
}
|
||||
}
|
||||
@ -309,7 +309,7 @@ ufs_extattr_lookup(struct vnode *start_dvp, int lockparent, char *dirname,
|
||||
*/
|
||||
static int
|
||||
ufs_extattr_enable_with_open(struct ufsmount *ump, struct vnode *vp,
|
||||
int namespace, const char *attrname, struct proc *p)
|
||||
int attrnamespace, const char *attrname, struct proc *p)
|
||||
{
|
||||
int error;
|
||||
|
||||
@ -341,7 +341,7 @@ ufs_extattr_enable_with_open(struct ufsmount *ump, struct vnode *vp,
|
||||
|
||||
VOP_UNLOCK(vp, 0, p);
|
||||
|
||||
return (ufs_extattr_enable(ump, namespace, attrname, vp, p));
|
||||
return (ufs_extattr_enable(ump, attrnamespace, attrname, vp, p));
|
||||
}
|
||||
|
||||
#ifdef UFS_EXTATTR_AUTOSTART
|
||||
@ -354,7 +354,7 @@ ufs_extattr_enable_with_open(struct ufsmount *ump, struct vnode *vp,
|
||||
*/
|
||||
static int
|
||||
ufs_extattr_iterate_directory(struct ufsmount *ump, struct vnode *dvp,
|
||||
int namespace, struct proc *p)
|
||||
int attrnamespace, struct proc *p)
|
||||
{
|
||||
struct vop_readdir_args vargs;
|
||||
struct dirent *dp, *edp;
|
||||
@ -422,7 +422,7 @@ ufs_extattr_iterate_directory(struct ufsmount *ump, struct vnode *dvp,
|
||||
vput(attr_vp);
|
||||
} else {
|
||||
error = ufs_extattr_enable_with_open(ump,
|
||||
attr_vp, namespace, dp->d_name, p);
|
||||
attr_vp, attrnamespace, dp->d_name, p);
|
||||
vrele(attr_vp);
|
||||
if (error) {
|
||||
printf("ufs_extattr_iterate_directory: "
|
||||
@ -552,7 +552,7 @@ ufs_extattr_stop(struct mount *mp, struct proc *p)
|
||||
|
||||
while (LIST_FIRST(&ump->um_extattr.uepm_list) != NULL) {
|
||||
uele = LIST_FIRST(&ump->um_extattr.uepm_list);
|
||||
ufs_extattr_disable(ump, uele->uele_namespace,
|
||||
ufs_extattr_disable(ump, uele->uele_attrnamespace,
|
||||
uele->uele_attrname, p);
|
||||
}
|
||||
|
||||
@ -572,8 +572,8 @@ unlock:
|
||||
* unlocked backing vnode to hold the attribute data.
|
||||
*/
|
||||
static int
|
||||
ufs_extattr_enable(struct ufsmount *ump, int namespace, const char *attrname,
|
||||
struct vnode *backing_vnode, struct proc *p)
|
||||
ufs_extattr_enable(struct ufsmount *ump, int attrnamespace,
|
||||
const char *attrname, struct vnode *backing_vnode, struct proc *p)
|
||||
{
|
||||
struct ufs_extattr_list_entry *attribute;
|
||||
struct iovec aiov;
|
||||
@ -595,13 +595,13 @@ ufs_extattr_enable(struct ufsmount *ump, int namespace, const char *attrname,
|
||||
goto free_exit;
|
||||
}
|
||||
|
||||
if (ufs_extattr_find_attr(ump, namespace, attrname)) {
|
||||
if (ufs_extattr_find_attr(ump, attrnamespace, attrname)) {
|
||||
error = EEXIST;
|
||||
goto free_exit;
|
||||
}
|
||||
|
||||
strncpy(attribute->uele_attrname, attrname, UFS_EXTATTR_MAXEXTATTRNAME);
|
||||
attribute->uele_namespace = namespace;
|
||||
attribute->uele_attrnamespace = attrnamespace;
|
||||
bzero(&attribute->uele_fileheader,
|
||||
sizeof(struct ufs_extattr_fileheader));
|
||||
|
||||
@ -659,8 +659,8 @@ free_exit:
|
||||
* Disable extended attribute support on an FS.
|
||||
*/
|
||||
static int
|
||||
ufs_extattr_disable(struct ufsmount *ump, int namespace, const char *attrname,
|
||||
struct proc *p)
|
||||
ufs_extattr_disable(struct ufsmount *ump, int attrnamespace,
|
||||
const char *attrname, struct proc *p)
|
||||
{
|
||||
struct ufs_extattr_list_entry *uele;
|
||||
int error = 0;
|
||||
@ -668,7 +668,7 @@ ufs_extattr_disable(struct ufsmount *ump, int namespace, const char *attrname,
|
||||
if (!ufs_extattr_valid_attrname(attrname))
|
||||
return (EINVAL);
|
||||
|
||||
uele = ufs_extattr_find_attr(ump, namespace, attrname);
|
||||
uele = ufs_extattr_find_attr(ump, attrnamespace, attrname);
|
||||
if (!uele)
|
||||
return (ENOENT);
|
||||
|
||||
@ -689,7 +689,7 @@ ufs_extattr_disable(struct ufsmount *ump, int namespace, const char *attrname,
|
||||
*/
|
||||
int
|
||||
ufs_extattrctl(struct mount *mp, int cmd, struct vnode *filename_vp,
|
||||
int namespace, const char *attrname, struct proc *p)
|
||||
int attrnamespace, const char *attrname, struct proc *p)
|
||||
{
|
||||
struct ufsmount *ump = VFSTOUFS(mp);
|
||||
int error;
|
||||
@ -744,7 +744,7 @@ ufs_extattrctl(struct mount *mp, int cmd, struct vnode *filename_vp,
|
||||
*/
|
||||
ufs_extattr_uepm_lock(ump, p);
|
||||
error = ufs_extattr_enable_with_open(ump, filename_vp,
|
||||
namespace, attrname, p);
|
||||
attrnamespace, attrname, p);
|
||||
ufs_extattr_uepm_unlock(ump, p);
|
||||
|
||||
return (error);
|
||||
@ -759,7 +759,7 @@ ufs_extattrctl(struct mount *mp, int cmd, struct vnode *filename_vp,
|
||||
return (EINVAL);
|
||||
|
||||
ufs_extattr_uepm_lock(ump, p);
|
||||
error = ufs_extattr_disable(ump, namespace, attrname, p);
|
||||
error = ufs_extattr_disable(ump, attrnamespace, attrname, p);
|
||||
ufs_extattr_uepm_unlock(ump, p);
|
||||
|
||||
return (error);
|
||||
@ -791,7 +791,7 @@ ufs_extattr_credcheck(struct vnode *vp, struct ufs_extattr_list_entry *uele,
|
||||
* XXX What capability should apply here?
|
||||
* Probably CAP_SYS_SETFFLAG.
|
||||
*/
|
||||
switch (uele->uele_namespace) {
|
||||
switch (uele->uele_attrnamespace) {
|
||||
case EXTATTR_NAMESPACE_SYSTEM:
|
||||
return (suser_xxx(cred, p, 0));
|
||||
case EXTATTR_NAMESPACE_USER:
|
||||
@ -809,7 +809,7 @@ ufs_vop_getextattr(struct vop_getextattr_args *ap)
|
||||
/*
|
||||
vop_getextattr {
|
||||
IN struct vnode *a_vp;
|
||||
IN int a_namespace;
|
||||
IN int a_attrnamespace;
|
||||
IN const char *a_name;
|
||||
INOUT struct uio *a_uio;
|
||||
IN struct ucred *a_cred;
|
||||
@ -823,7 +823,7 @@ vop_getextattr {
|
||||
|
||||
ufs_extattr_uepm_lock(ump, ap->a_p);
|
||||
|
||||
error = ufs_extattr_get(ap->a_vp, ap->a_namespace, ap->a_name,
|
||||
error = ufs_extattr_get(ap->a_vp, ap->a_attrnamespace, ap->a_name,
|
||||
ap->a_uio, ap->a_cred, ap->a_p);
|
||||
|
||||
ufs_extattr_uepm_unlock(ump, ap->a_p);
|
||||
@ -836,7 +836,7 @@ vop_getextattr {
|
||||
* the attribute lock has already been grabbed.
|
||||
*/
|
||||
static int
|
||||
ufs_extattr_get(struct vnode *vp, int namespace, const char *name,
|
||||
ufs_extattr_get(struct vnode *vp, int attrnamespace, const char *name,
|
||||
struct uio *uio, struct ucred *cred, struct proc *p)
|
||||
{
|
||||
struct ufs_extattr_list_entry *attribute;
|
||||
@ -859,7 +859,7 @@ ufs_extattr_get(struct vnode *vp, int namespace, const char *name,
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
attribute = ufs_extattr_find_attr(ump, namespace, name);
|
||||
attribute = ufs_extattr_find_attr(ump, attrnamespace, name);
|
||||
if (!attribute)
|
||||
return (ENOENT);
|
||||
|
||||
@ -976,7 +976,7 @@ ufs_vop_setextattr(struct vop_setextattr_args *ap)
|
||||
/*
|
||||
vop_setextattr {
|
||||
IN struct vnode *a_vp;
|
||||
IN int a_namespace;
|
||||
IN int a_attrnamespace;
|
||||
IN const char *a_name;
|
||||
INOUT struct uio *a_uio;
|
||||
IN struct ucred *a_cred;
|
||||
@ -992,11 +992,11 @@ vop_setextattr {
|
||||
ufs_extattr_uepm_lock(ump, ap->a_p);
|
||||
|
||||
if (ap->a_uio != NULL)
|
||||
error = ufs_extattr_set(ap->a_vp, ap->a_namespace, ap->a_name,
|
||||
ap->a_uio, ap->a_cred, ap->a_p);
|
||||
error = ufs_extattr_set(ap->a_vp, ap->a_attrnamespace,
|
||||
ap->a_name, ap->a_uio, ap->a_cred, ap->a_p);
|
||||
else
|
||||
error = ufs_extattr_rm(ap->a_vp, ap->a_namespace, ap->a_name,
|
||||
ap->a_cred, ap->a_p);
|
||||
error = ufs_extattr_rm(ap->a_vp, ap->a_attrnamespace,
|
||||
ap->a_name, ap->a_cred, ap->a_p);
|
||||
|
||||
ufs_extattr_uepm_unlock(ump, ap->a_p);
|
||||
|
||||
@ -1008,7 +1008,7 @@ vop_setextattr {
|
||||
* assumes that the attribute lock has already been grabbed.
|
||||
*/
|
||||
static int
|
||||
ufs_extattr_set(struct vnode *vp, int namespace, const char *name,
|
||||
ufs_extattr_set(struct vnode *vp, int attrnamespace, const char *name,
|
||||
struct uio *uio, struct ucred *cred, struct proc *p)
|
||||
{
|
||||
struct ufs_extattr_list_entry *attribute;
|
||||
@ -1028,7 +1028,7 @@ ufs_extattr_set(struct vnode *vp, int namespace, const char *name,
|
||||
if (!ufs_extattr_valid_attrname(name))
|
||||
return (EINVAL);
|
||||
|
||||
attribute = ufs_extattr_find_attr(ump, namespace, name);
|
||||
attribute = ufs_extattr_find_attr(ump, attrnamespace, name);
|
||||
if (!attribute)
|
||||
return (ENOENT);
|
||||
|
||||
@ -1113,7 +1113,7 @@ vopunlock_exit:
|
||||
* Assumes the attribute lock has already been grabbed.
|
||||
*/
|
||||
static int
|
||||
ufs_extattr_rm(struct vnode *vp, int namespace, const char *name,
|
||||
ufs_extattr_rm(struct vnode *vp, int attrnamespace, const char *name,
|
||||
struct ucred *cred, struct proc *p)
|
||||
{
|
||||
struct ufs_extattr_list_entry *attribute;
|
||||
@ -1133,7 +1133,7 @@ ufs_extattr_rm(struct vnode *vp, int namespace, const char *name,
|
||||
if (!ufs_extattr_valid_attrname(name))
|
||||
return (EINVAL);
|
||||
|
||||
attribute = ufs_extattr_find_attr(ump, namespace, name);
|
||||
attribute = ufs_extattr_find_attr(ump, attrnamespace, name);
|
||||
if (!attribute)
|
||||
return (ENOENT);
|
||||
|
||||
@ -1245,8 +1245,8 @@ ufs_extattr_vnode_inactive(struct vnode *vp, struct proc *p)
|
||||
}
|
||||
|
||||
LIST_FOREACH(uele, &ump->um_extattr.uepm_list, uele_entries)
|
||||
ufs_extattr_rm(vp, uele->uele_namespace, uele->uele_attrname,
|
||||
NULL, p);
|
||||
ufs_extattr_rm(vp, uele->uele_attrnamespace,
|
||||
uele->uele_attrname, NULL, p);
|
||||
|
||||
ufs_extattr_uepm_unlock(ump, p);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user