summaryrefslogtreecommitdiffstats
path: root/sys/security
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-06-22 08:41:43 +0000
committerphk <phk@FreeBSD.org>2003-06-22 08:41:43 +0000
commitc81c59299bd255eb5ab7510c9e84e9c54b8003d0 (patch)
treec8262a3d430fc3cafab7fb6aec641ce293cd3361 /sys/security
parent4a223af282e5f60223c443ce3755f565f9db2465 (diff)
downloadFreeBSD-src-c81c59299bd255eb5ab7510c9e84e9c54b8003d0.zip
FreeBSD-src-c81c59299bd255eb5ab7510c9e84e9c54b8003d0.tar.gz
Add a f_vnode field to struct file.
Several of the subtypes have an associated vnode which is used for stuff like the f*() functions. By giving the vnode a speparate field, a number of checks for the specific subtype can be replaced simply with a check for f_vnode != NULL, and we can later free f_data up to subtype specific use. At this point in time, f_data still points to the vnode, so any code I might have overlooked will still work.
Diffstat (limited to 'sys/security')
-rw-r--r--sys/security/mac/mac_framework.c4
-rw-r--r--sys/security/mac/mac_internal.h4
-rw-r--r--sys/security/mac/mac_net.c4
-rw-r--r--sys/security/mac/mac_pipe.c4
-rw-r--r--sys/security/mac/mac_process.c4
-rw-r--r--sys/security/mac/mac_syscalls.c4
-rw-r--r--sys/security/mac/mac_system.c4
-rw-r--r--sys/security/mac/mac_vfs.c4
8 files changed, 16 insertions, 16 deletions
diff --git a/sys/security/mac/mac_framework.c b/sys/security/mac/mac_framework.c
index e5e25dc..79a12ec 100644
--- a/sys/security/mac/mac_framework.c
+++ b/sys/security/mac/mac_framework.c
@@ -3496,7 +3496,7 @@ __mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap)
switch (fp->f_type) {
case DTYPE_FIFO:
case DTYPE_VNODE:
- vp = fp->f_data;
+ vp = fp->f_vnode;
mac_init_vnode_label(&intlabel);
@@ -3704,7 +3704,7 @@ __mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap)
break;
}
- vp = fp->f_data;
+ vp = fp->f_vnode;
error = vn_start_write(vp, &mp, V_WAIT | PCATCH);
if (error != 0) {
mac_destroy_vnode_label(&intlabel);
diff --git a/sys/security/mac/mac_internal.h b/sys/security/mac/mac_internal.h
index e5e25dc..79a12ec 100644
--- a/sys/security/mac/mac_internal.h
+++ b/sys/security/mac/mac_internal.h
@@ -3496,7 +3496,7 @@ __mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap)
switch (fp->f_type) {
case DTYPE_FIFO:
case DTYPE_VNODE:
- vp = fp->f_data;
+ vp = fp->f_vnode;
mac_init_vnode_label(&intlabel);
@@ -3704,7 +3704,7 @@ __mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap)
break;
}
- vp = fp->f_data;
+ vp = fp->f_vnode;
error = vn_start_write(vp, &mp, V_WAIT | PCATCH);
if (error != 0) {
mac_destroy_vnode_label(&intlabel);
diff --git a/sys/security/mac/mac_net.c b/sys/security/mac/mac_net.c
index e5e25dc..79a12ec 100644
--- a/sys/security/mac/mac_net.c
+++ b/sys/security/mac/mac_net.c
@@ -3496,7 +3496,7 @@ __mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap)
switch (fp->f_type) {
case DTYPE_FIFO:
case DTYPE_VNODE:
- vp = fp->f_data;
+ vp = fp->f_vnode;
mac_init_vnode_label(&intlabel);
@@ -3704,7 +3704,7 @@ __mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap)
break;
}
- vp = fp->f_data;
+ vp = fp->f_vnode;
error = vn_start_write(vp, &mp, V_WAIT | PCATCH);
if (error != 0) {
mac_destroy_vnode_label(&intlabel);
diff --git a/sys/security/mac/mac_pipe.c b/sys/security/mac/mac_pipe.c
index e5e25dc..79a12ec 100644
--- a/sys/security/mac/mac_pipe.c
+++ b/sys/security/mac/mac_pipe.c
@@ -3496,7 +3496,7 @@ __mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap)
switch (fp->f_type) {
case DTYPE_FIFO:
case DTYPE_VNODE:
- vp = fp->f_data;
+ vp = fp->f_vnode;
mac_init_vnode_label(&intlabel);
@@ -3704,7 +3704,7 @@ __mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap)
break;
}
- vp = fp->f_data;
+ vp = fp->f_vnode;
error = vn_start_write(vp, &mp, V_WAIT | PCATCH);
if (error != 0) {
mac_destroy_vnode_label(&intlabel);
diff --git a/sys/security/mac/mac_process.c b/sys/security/mac/mac_process.c
index e5e25dc..79a12ec 100644
--- a/sys/security/mac/mac_process.c
+++ b/sys/security/mac/mac_process.c
@@ -3496,7 +3496,7 @@ __mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap)
switch (fp->f_type) {
case DTYPE_FIFO:
case DTYPE_VNODE:
- vp = fp->f_data;
+ vp = fp->f_vnode;
mac_init_vnode_label(&intlabel);
@@ -3704,7 +3704,7 @@ __mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap)
break;
}
- vp = fp->f_data;
+ vp = fp->f_vnode;
error = vn_start_write(vp, &mp, V_WAIT | PCATCH);
if (error != 0) {
mac_destroy_vnode_label(&intlabel);
diff --git a/sys/security/mac/mac_syscalls.c b/sys/security/mac/mac_syscalls.c
index e5e25dc..79a12ec 100644
--- a/sys/security/mac/mac_syscalls.c
+++ b/sys/security/mac/mac_syscalls.c
@@ -3496,7 +3496,7 @@ __mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap)
switch (fp->f_type) {
case DTYPE_FIFO:
case DTYPE_VNODE:
- vp = fp->f_data;
+ vp = fp->f_vnode;
mac_init_vnode_label(&intlabel);
@@ -3704,7 +3704,7 @@ __mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap)
break;
}
- vp = fp->f_data;
+ vp = fp->f_vnode;
error = vn_start_write(vp, &mp, V_WAIT | PCATCH);
if (error != 0) {
mac_destroy_vnode_label(&intlabel);
diff --git a/sys/security/mac/mac_system.c b/sys/security/mac/mac_system.c
index e5e25dc..79a12ec 100644
--- a/sys/security/mac/mac_system.c
+++ b/sys/security/mac/mac_system.c
@@ -3496,7 +3496,7 @@ __mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap)
switch (fp->f_type) {
case DTYPE_FIFO:
case DTYPE_VNODE:
- vp = fp->f_data;
+ vp = fp->f_vnode;
mac_init_vnode_label(&intlabel);
@@ -3704,7 +3704,7 @@ __mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap)
break;
}
- vp = fp->f_data;
+ vp = fp->f_vnode;
error = vn_start_write(vp, &mp, V_WAIT | PCATCH);
if (error != 0) {
mac_destroy_vnode_label(&intlabel);
diff --git a/sys/security/mac/mac_vfs.c b/sys/security/mac/mac_vfs.c
index e5e25dc..79a12ec 100644
--- a/sys/security/mac/mac_vfs.c
+++ b/sys/security/mac/mac_vfs.c
@@ -3496,7 +3496,7 @@ __mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap)
switch (fp->f_type) {
case DTYPE_FIFO:
case DTYPE_VNODE:
- vp = fp->f_data;
+ vp = fp->f_vnode;
mac_init_vnode_label(&intlabel);
@@ -3704,7 +3704,7 @@ __mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap)
break;
}
- vp = fp->f_data;
+ vp = fp->f_vnode;
error = vn_start_write(vp, &mp, V_WAIT | PCATCH);
if (error != 0) {
mac_destroy_vnode_label(&intlabel);
OpenPOWER on IntegriCloud