aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_extattr.c
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2018-02-05 18:58:55 +0000
committerBrooks Davis <brooks@FreeBSD.org>2018-02-05 18:58:55 +0000
commit02bc058f794358b2a6f85fdd385cbf49aaa22fe2 (patch)
tree0c00f3e349d7a372891ac0a6d0792ff77a2463e6 /sys/kern/vfs_extattr.c
parent5e1e3ea237e921377a1d5a8b7adffbaf6a392de0 (diff)
downloadsrc-02bc058f794358b2a6f85fdd385cbf49aaa22fe2.tar.gz
src-02bc058f794358b2a6f85fdd385cbf49aaa22fe2.zip
ANSIfy syscall implementations.
Reviewed by: rwatson Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14172
Notes
Notes: svn path=/head/; revision=328898
Diffstat (limited to 'sys/kern/vfs_extattr.c')
-rw-r--r--sys/kern/vfs_extattr.c229
1 files changed, 121 insertions, 108 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index e9f0c4f48ed7..1ef4b4deb6fe 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -56,16 +56,17 @@ __FBSDID("$FreeBSD$");
*
* Currently this is used only by UFS1 extended attributes.
*/
+#ifndef _SYS_SYSPROTO_H_
+struct extattrctl_args {
+ const char *path;
+ int cmd;
+ const char *filename;
+ int attrnamespace;
+ const char *attrname;
+};
+#endif
int
-sys_extattrctl(td, uap)
- struct thread *td;
- struct extattrctl_args /* {
- const char *path;
- int cmd;
- const char *filename;
- int attrnamespace;
- const char *attrname;
- } */ *uap;
+sys_extattrctl(struct thread *td, struct extattrctl_args *uap)
{
struct vnode *filename_vp;
struct nameidata nd;
@@ -206,16 +207,17 @@ done:
return (error);
}
+#ifndef _SYS_SYSPROTO_H_
+struct extattr_set_fd_args {
+ int fd;
+ int attrnamespace;
+ const char *attrname;
+ void *data;
+ size_t nbytes;
+};
+#endif
int
-sys_extattr_set_fd(td, uap)
- struct thread *td;
- struct extattr_set_fd_args /* {
- int fd;
- int attrnamespace;
- const char *attrname;
- void *data;
- size_t nbytes;
- } */ *uap;
+sys_extattr_set_fd(struct thread *td, struct extattr_set_fd_args *uap)
{
struct file *fp;
char attrname[EXTATTR_MAXNAMELEN];
@@ -241,16 +243,17 @@ sys_extattr_set_fd(td, uap)
return (error);
}
+#ifndef _SYS_SYSPROTO_H_
+struct extattr_set_file_args {
+ const char *path;
+ int attrnamespace;
+ const char *attrname;
+ void *data;
+ size_t nbytes;
+};
+#endif
int
-sys_extattr_set_file(td, uap)
- struct thread *td;
- struct extattr_set_file_args /* {
- const char *path;
- int attrnamespace;
- const char *attrname;
- void *data;
- size_t nbytes;
- } */ *uap;
+sys_extattr_set_file(struct thread *td, struct extattr_set_file_args *uap)
{
struct nameidata nd;
char attrname[EXTATTR_MAXNAMELEN];
@@ -276,16 +279,17 @@ sys_extattr_set_file(td, uap)
return (error);
}
+#ifndef _SYS_SYSPROTO_H_
+struct extattr_set_link_args {
+ const char *path;
+ int attrnamespace;
+ const char *attrname;
+ void *data;
+ size_t nbytes;
+};
+#endif
int
-sys_extattr_set_link(td, uap)
- struct thread *td;
- struct extattr_set_link_args /* {
- const char *path;
- int attrnamespace;
- const char *attrname;
- void *data;
- size_t nbytes;
- } */ *uap;
+sys_extattr_set_link(struct thread *td, struct extattr_set_link_args *uap)
{
struct nameidata nd;
char attrname[EXTATTR_MAXNAMELEN];
@@ -381,16 +385,17 @@ done:
return (error);
}
+#ifndef _SYS_SYSPROTO_H_
+struct extattr_get_fd_args {
+ int fd;
+ int attrnamespace;
+ const char *attrname;
+ void *data;
+ size_t nbytes;
+};
+#endif
int
-sys_extattr_get_fd(td, uap)
- struct thread *td;
- struct extattr_get_fd_args /* {
- int fd;
- int attrnamespace;
- const char *attrname;
- void *data;
- size_t nbytes;
- } */ *uap;
+sys_extattr_get_fd(struct thread *td, struct extattr_get_fd_args *uap)
{
struct file *fp;
char attrname[EXTATTR_MAXNAMELEN];
@@ -416,16 +421,17 @@ sys_extattr_get_fd(td, uap)
return (error);
}
+#ifndef _SYS_SYSPROTO_H_
+struct extattr_get_file_args {
+ const char *path;
+ int attrnamespace;
+ const char *attrname;
+ void *data;
+ size_t nbytes;
+};
+#endif
int
-sys_extattr_get_file(td, uap)
- struct thread *td;
- struct extattr_get_file_args /* {
- const char *path;
- int attrnamespace;
- const char *attrname;
- void *data;
- size_t nbytes;
- } */ *uap;
+sys_extattr_get_file(struct thread *td, struct extattr_get_file_args *uap)
{
struct nameidata nd;
char attrname[EXTATTR_MAXNAMELEN];
@@ -450,16 +456,17 @@ sys_extattr_get_file(td, uap)
return (error);
}
+#ifndef _SYS_SYSPROTO_H_
+struct extattr_get_link_args {
+ const char *path;
+ int attrnamespace;
+ const char *attrname;
+ void *data;
+ size_t nbytes;
+};
+#endif
int
-sys_extattr_get_link(td, uap)
- struct thread *td;
- struct extattr_get_link_args /* {
- const char *path;
- int attrnamespace;
- const char *attrname;
- void *data;
- size_t nbytes;
- } */ *uap;
+sys_extattr_get_link(struct thread *td, struct extattr_get_link_args *uap)
{
struct nameidata nd;
char attrname[EXTATTR_MAXNAMELEN];
@@ -527,14 +534,15 @@ done:
return (error);
}
+#ifndef _SYS_SYSPROTO_H_
+struct extattr_delete_fd_args {
+ int fd;
+ int attrnamespace;
+ const char *attrname;
+};
+#endif
int
-sys_extattr_delete_fd(td, uap)
- struct thread *td;
- struct extattr_delete_fd_args /* {
- int fd;
- int attrnamespace;
- const char *attrname;
- } */ *uap;
+sys_extattr_delete_fd(struct thread *td, struct extattr_delete_fd_args *uap)
{
struct file *fp;
char attrname[EXTATTR_MAXNAMELEN];
@@ -559,14 +567,15 @@ sys_extattr_delete_fd(td, uap)
return (error);
}
+#ifndef _SYS_SYSPROTO_H_
+struct extattr_delete_file_args {
+ const char *path;
+ int attrnamespace;
+ const char *attrname;
+};
+#endif
int
-sys_extattr_delete_file(td, uap)
- struct thread *td;
- struct extattr_delete_file_args /* {
- const char *path;
- int attrnamespace;
- const char *attrname;
- } */ *uap;
+sys_extattr_delete_file(struct thread *td, struct extattr_delete_file_args *uap)
{
struct nameidata nd;
char attrname[EXTATTR_MAXNAMELEN];
@@ -589,14 +598,15 @@ sys_extattr_delete_file(td, uap)
return(error);
}
+#ifndef _SYS_SYSPROTO_H_
+struct extattr_delete_link_args {
+ const char *path;
+ int attrnamespace;
+ const char *attrname;
+};
+#endif
int
-sys_extattr_delete_link(td, uap)
- struct thread *td;
- struct extattr_delete_link_args /* {
- const char *path;
- int attrnamespace;
- const char *attrname;
- } */ *uap;
+sys_extattr_delete_link(struct thread *td, struct extattr_delete_link_args *uap)
{
struct nameidata nd;
char attrname[EXTATTR_MAXNAMELEN];
@@ -684,15 +694,16 @@ done:
}
+#ifndef _SYS_SYSPROTO_H_
+struct extattr_list_fd_args {
+ int fd;
+ int attrnamespace;
+ void *data;
+ size_t nbytes;
+};
+#endif
int
-sys_extattr_list_fd(td, uap)
- struct thread *td;
- struct extattr_list_fd_args /* {
- int fd;
- int attrnamespace;
- void *data;
- size_t nbytes;
- } */ *uap;
+sys_extattr_list_fd(struct thread *td, struct extattr_list_fd_args *uap)
{
struct file *fp;
cap_rights_t rights;
@@ -712,15 +723,16 @@ sys_extattr_list_fd(td, uap)
return (error);
}
+#ifndef _SYS_SYSPROTO_H_
+struct extattr_list_file_args {
+ const char *path;
+ int attrnamespace;
+ void *data;
+ size_t nbytes;
+}
+#endif
int
-sys_extattr_list_file(td, uap)
- struct thread*td;
- struct extattr_list_file_args /* {
- const char *path;
- int attrnamespace;
- void *data;
- size_t nbytes;
- } */ *uap;
+sys_extattr_list_file(struct thread *td, struct extattr_list_file_args *uap)
{
struct nameidata nd;
int error;
@@ -739,15 +751,16 @@ sys_extattr_list_file(td, uap)
return (error);
}
+#ifndef _SYS_SYSPROTO_H_
+struct extattr_list_link_args {
+ const char *path;
+ int attrnamespace;
+ void *data;
+ size_t nbytes;
+};
+#endif
int
-sys_extattr_list_link(td, uap)
- struct thread*td;
- struct extattr_list_link_args /* {
- const char *path;
- int attrnamespace;
- void *data;
- size_t nbytes;
- } */ *uap;
+sys_extattr_list_link(struct thread *td, struct extattr_list_link_args *uap)
{
struct nameidata nd;
int error;