Explore new heights in alphabetization for _file and _fd variations on
the extended attribute system calls.
This commit is contained in:
parent
534ba86baa
commit
b101411be1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=104743
@ -3838,6 +3838,35 @@ extattr_set_vp(struct vnode *vp, int attrnamespace, const char *attrname,
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_set_fd(td, uap)
|
||||
struct thread *td;
|
||||
struct extattr_set_fd_args /* {
|
||||
syscallarg(int) fd;
|
||||
syscallarg(int) attrnamespace;
|
||||
syscallarg(const char *) attrname;
|
||||
syscallarg(void *) data;
|
||||
syscallarg(size_t) nbytes;
|
||||
} */ *uap;
|
||||
{
|
||||
struct file *fp;
|
||||
char attrname[EXTATTR_MAXNAMELEN];
|
||||
int error;
|
||||
|
||||
error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0)
|
||||
return (error);
|
||||
|
||||
error = extattr_set_vp((struct vnode *)fp->f_data, uap->attrnamespace,
|
||||
attrname, uap->data, uap->nbytes, td);
|
||||
fdrop(fp, td);
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_set_file(td, uap)
|
||||
struct thread *td;
|
||||
@ -3869,35 +3898,6 @@ extattr_set_file(td, uap)
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_set_fd(td, uap)
|
||||
struct thread *td;
|
||||
struct extattr_set_fd_args /* {
|
||||
syscallarg(int) fd;
|
||||
syscallarg(int) attrnamespace;
|
||||
syscallarg(const char *) attrname;
|
||||
syscallarg(void *) data;
|
||||
syscallarg(size_t) nbytes;
|
||||
} */ *uap;
|
||||
{
|
||||
struct file *fp;
|
||||
char attrname[EXTATTR_MAXNAMELEN];
|
||||
int error;
|
||||
|
||||
error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0)
|
||||
return (error);
|
||||
|
||||
error = extattr_set_vp((struct vnode *)fp->f_data, uap->attrnamespace,
|
||||
attrname, uap->data, uap->nbytes, td);
|
||||
fdrop(fp, td);
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_set_link(td, uap)
|
||||
struct thread *td;
|
||||
@ -3999,6 +3999,35 @@ extattr_get_vp(struct vnode *vp, int attrnamespace, const char *attrname,
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_get_fd(td, uap)
|
||||
struct thread *td;
|
||||
struct extattr_get_fd_args /* {
|
||||
syscallarg(int) fd;
|
||||
syscallarg(int) attrnamespace;
|
||||
syscallarg(const char *) attrname;
|
||||
syscallarg(void *) data;
|
||||
syscallarg(size_t) nbytes;
|
||||
} */ *uap;
|
||||
{
|
||||
struct file *fp;
|
||||
char attrname[EXTATTR_MAXNAMELEN];
|
||||
int error;
|
||||
|
||||
error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0)
|
||||
return (error);
|
||||
|
||||
error = extattr_get_vp((struct vnode *)fp->f_data, uap->attrnamespace,
|
||||
attrname, uap->data, uap->nbytes, td);
|
||||
|
||||
fdrop(fp, td);
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_get_file(td, uap)
|
||||
struct thread *td;
|
||||
@ -4030,35 +4059,6 @@ extattr_get_file(td, uap)
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_get_fd(td, uap)
|
||||
struct thread *td;
|
||||
struct extattr_get_fd_args /* {
|
||||
syscallarg(int) fd;
|
||||
syscallarg(int) attrnamespace;
|
||||
syscallarg(const char *) attrname;
|
||||
syscallarg(void *) data;
|
||||
syscallarg(size_t) nbytes;
|
||||
} */ *uap;
|
||||
{
|
||||
struct file *fp;
|
||||
char attrname[EXTATTR_MAXNAMELEN];
|
||||
int error;
|
||||
|
||||
error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0)
|
||||
return (error);
|
||||
|
||||
error = extattr_get_vp((struct vnode *)fp->f_data, uap->attrnamespace,
|
||||
attrname, uap->data, uap->nbytes, td);
|
||||
|
||||
fdrop(fp, td);
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_get_link(td, uap)
|
||||
struct thread *td;
|
||||
@ -4125,34 +4125,6 @@ extattr_delete_vp(struct vnode *vp, int attrnamespace, const char *attrname,
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_delete_file(td, uap)
|
||||
struct thread *td;
|
||||
struct extattr_delete_file_args /* {
|
||||
syscallarg(const char *) path;
|
||||
syscallarg(int) attrnamespace;
|
||||
syscallarg(const char *) attrname;
|
||||
} */ *uap;
|
||||
{
|
||||
struct nameidata nd;
|
||||
char attrname[EXTATTR_MAXNAMELEN];
|
||||
int error;
|
||||
|
||||
error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL);
|
||||
if (error)
|
||||
return(error);
|
||||
|
||||
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td);
|
||||
if ((error = namei(&nd)) != 0)
|
||||
return(error);
|
||||
NDFREE(&nd, NDF_ONLY_PNBUF);
|
||||
|
||||
error = extattr_delete_vp(nd.ni_vp, uap->attrnamespace, attrname, td);
|
||||
|
||||
vrele(nd.ni_vp);
|
||||
return(error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_delete_fd(td, uap)
|
||||
struct thread *td;
|
||||
@ -4181,6 +4153,34 @@ extattr_delete_fd(td, uap)
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_delete_file(td, uap)
|
||||
struct thread *td;
|
||||
struct extattr_delete_file_args /* {
|
||||
syscallarg(const char *) path;
|
||||
syscallarg(int) attrnamespace;
|
||||
syscallarg(const char *) attrname;
|
||||
} */ *uap;
|
||||
{
|
||||
struct nameidata nd;
|
||||
char attrname[EXTATTR_MAXNAMELEN];
|
||||
int error;
|
||||
|
||||
error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL);
|
||||
if (error)
|
||||
return(error);
|
||||
|
||||
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td);
|
||||
if ((error = namei(&nd)) != 0)
|
||||
return(error);
|
||||
NDFREE(&nd, NDF_ONLY_PNBUF);
|
||||
|
||||
error = extattr_delete_vp(nd.ni_vp, uap->attrnamespace, attrname, td);
|
||||
|
||||
vrele(nd.ni_vp);
|
||||
return(error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_delete_link(td, uap)
|
||||
struct thread *td;
|
||||
|
@ -3838,6 +3838,35 @@ extattr_set_vp(struct vnode *vp, int attrnamespace, const char *attrname,
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_set_fd(td, uap)
|
||||
struct thread *td;
|
||||
struct extattr_set_fd_args /* {
|
||||
syscallarg(int) fd;
|
||||
syscallarg(int) attrnamespace;
|
||||
syscallarg(const char *) attrname;
|
||||
syscallarg(void *) data;
|
||||
syscallarg(size_t) nbytes;
|
||||
} */ *uap;
|
||||
{
|
||||
struct file *fp;
|
||||
char attrname[EXTATTR_MAXNAMELEN];
|
||||
int error;
|
||||
|
||||
error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0)
|
||||
return (error);
|
||||
|
||||
error = extattr_set_vp((struct vnode *)fp->f_data, uap->attrnamespace,
|
||||
attrname, uap->data, uap->nbytes, td);
|
||||
fdrop(fp, td);
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_set_file(td, uap)
|
||||
struct thread *td;
|
||||
@ -3869,35 +3898,6 @@ extattr_set_file(td, uap)
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_set_fd(td, uap)
|
||||
struct thread *td;
|
||||
struct extattr_set_fd_args /* {
|
||||
syscallarg(int) fd;
|
||||
syscallarg(int) attrnamespace;
|
||||
syscallarg(const char *) attrname;
|
||||
syscallarg(void *) data;
|
||||
syscallarg(size_t) nbytes;
|
||||
} */ *uap;
|
||||
{
|
||||
struct file *fp;
|
||||
char attrname[EXTATTR_MAXNAMELEN];
|
||||
int error;
|
||||
|
||||
error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0)
|
||||
return (error);
|
||||
|
||||
error = extattr_set_vp((struct vnode *)fp->f_data, uap->attrnamespace,
|
||||
attrname, uap->data, uap->nbytes, td);
|
||||
fdrop(fp, td);
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_set_link(td, uap)
|
||||
struct thread *td;
|
||||
@ -3999,6 +3999,35 @@ extattr_get_vp(struct vnode *vp, int attrnamespace, const char *attrname,
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_get_fd(td, uap)
|
||||
struct thread *td;
|
||||
struct extattr_get_fd_args /* {
|
||||
syscallarg(int) fd;
|
||||
syscallarg(int) attrnamespace;
|
||||
syscallarg(const char *) attrname;
|
||||
syscallarg(void *) data;
|
||||
syscallarg(size_t) nbytes;
|
||||
} */ *uap;
|
||||
{
|
||||
struct file *fp;
|
||||
char attrname[EXTATTR_MAXNAMELEN];
|
||||
int error;
|
||||
|
||||
error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0)
|
||||
return (error);
|
||||
|
||||
error = extattr_get_vp((struct vnode *)fp->f_data, uap->attrnamespace,
|
||||
attrname, uap->data, uap->nbytes, td);
|
||||
|
||||
fdrop(fp, td);
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_get_file(td, uap)
|
||||
struct thread *td;
|
||||
@ -4030,35 +4059,6 @@ extattr_get_file(td, uap)
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_get_fd(td, uap)
|
||||
struct thread *td;
|
||||
struct extattr_get_fd_args /* {
|
||||
syscallarg(int) fd;
|
||||
syscallarg(int) attrnamespace;
|
||||
syscallarg(const char *) attrname;
|
||||
syscallarg(void *) data;
|
||||
syscallarg(size_t) nbytes;
|
||||
} */ *uap;
|
||||
{
|
||||
struct file *fp;
|
||||
char attrname[EXTATTR_MAXNAMELEN];
|
||||
int error;
|
||||
|
||||
error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0)
|
||||
return (error);
|
||||
|
||||
error = extattr_get_vp((struct vnode *)fp->f_data, uap->attrnamespace,
|
||||
attrname, uap->data, uap->nbytes, td);
|
||||
|
||||
fdrop(fp, td);
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_get_link(td, uap)
|
||||
struct thread *td;
|
||||
@ -4125,34 +4125,6 @@ extattr_delete_vp(struct vnode *vp, int attrnamespace, const char *attrname,
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_delete_file(td, uap)
|
||||
struct thread *td;
|
||||
struct extattr_delete_file_args /* {
|
||||
syscallarg(const char *) path;
|
||||
syscallarg(int) attrnamespace;
|
||||
syscallarg(const char *) attrname;
|
||||
} */ *uap;
|
||||
{
|
||||
struct nameidata nd;
|
||||
char attrname[EXTATTR_MAXNAMELEN];
|
||||
int error;
|
||||
|
||||
error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL);
|
||||
if (error)
|
||||
return(error);
|
||||
|
||||
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td);
|
||||
if ((error = namei(&nd)) != 0)
|
||||
return(error);
|
||||
NDFREE(&nd, NDF_ONLY_PNBUF);
|
||||
|
||||
error = extattr_delete_vp(nd.ni_vp, uap->attrnamespace, attrname, td);
|
||||
|
||||
vrele(nd.ni_vp);
|
||||
return(error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_delete_fd(td, uap)
|
||||
struct thread *td;
|
||||
@ -4181,6 +4153,34 @@ extattr_delete_fd(td, uap)
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_delete_file(td, uap)
|
||||
struct thread *td;
|
||||
struct extattr_delete_file_args /* {
|
||||
syscallarg(const char *) path;
|
||||
syscallarg(int) attrnamespace;
|
||||
syscallarg(const char *) attrname;
|
||||
} */ *uap;
|
||||
{
|
||||
struct nameidata nd;
|
||||
char attrname[EXTATTR_MAXNAMELEN];
|
||||
int error;
|
||||
|
||||
error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL);
|
||||
if (error)
|
||||
return(error);
|
||||
|
||||
NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td);
|
||||
if ((error = namei(&nd)) != 0)
|
||||
return(error);
|
||||
NDFREE(&nd, NDF_ONLY_PNBUF);
|
||||
|
||||
error = extattr_delete_vp(nd.ni_vp, uap->attrnamespace, attrname, td);
|
||||
|
||||
vrele(nd.ni_vp);
|
||||
return(error);
|
||||
}
|
||||
|
||||
int
|
||||
extattr_delete_link(td, uap)
|
||||
struct thread *td;
|
||||
|
Loading…
Reference in New Issue
Block a user