Change the first arg to fileops fo_stat routine to struct file *, adjust
callers and appropriate routines to cope. This makes fo_stat more consistent with rest of fileops routines and also makes the fo_stat match FreeBSD as an added bonus. Discussed with Luke Mewburn on tech-kern@.
This commit is contained in:
parent
c1dca7fa03
commit
b6d1d4db02
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vfs_syscalls_12.c,v 1.7 2001/04/07 09:00:57 jdolecek Exp $ */
|
||||
/* $NetBSD: vfs_syscalls_12.c,v 1.8 2001/04/09 10:22:01 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
@ -218,7 +218,7 @@ compat_12_sys_fstat(p, v, retval)
|
||||
return (EBADF);
|
||||
|
||||
FILE_USE(fp);
|
||||
error = (*fp->f_ops->fo_stat)(fp->f_data, &ub, p);
|
||||
error = (*fp->f_ops->fo_stat)(fp, &ub, p);
|
||||
FILE_UNUSE(fp, p);
|
||||
|
||||
if (error == 0) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vfs_syscalls_43.c,v 1.16 2001/04/07 09:00:57 jdolecek Exp $ */
|
||||
/* $NetBSD: vfs_syscalls_43.c,v 1.17 2001/04/09 10:22:01 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
@ -229,7 +229,7 @@ compat_43_sys_fstat(p, v, retval)
|
||||
return (EBADF);
|
||||
|
||||
FILE_USE(fp);
|
||||
error = (*fp->f_ops->fo_stat)(fp->f_data, &ub, p);
|
||||
error = (*fp->f_ops->fo_stat)(fp, &ub, p);
|
||||
FILE_UNUSE(fp, p);
|
||||
|
||||
if (error == 0) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: netbsd32_fs.c,v 1.3 2001/04/09 09:39:10 jdolecek Exp $ */
|
||||
/* $NetBSD: netbsd32_fs.c,v 1.4 2001/04/09 10:22:01 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998, 2001 Matthew R. Green
|
||||
@ -602,7 +602,7 @@ netbsd32___fstat13(p, v, retval)
|
||||
return (EBADF);
|
||||
|
||||
FILE_USE(fp);
|
||||
error = (*fp->f_ops->fo_stat)(fp->f_data, &ub, p);
|
||||
error = (*fp->f_ops->fo_stat)(fp, &ub, p);
|
||||
FILE_UNUSE(fp, p);
|
||||
|
||||
if (error == 0) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: osf1_descrip.c,v 1.10 2001/04/09 10:08:51 jdolecek Exp $ */
|
||||
/* $NetBSD: osf1_descrip.c,v 1.11 2001/04/09 10:22:01 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
|
||||
@ -248,7 +248,7 @@ osf1_sys_fstat(p, v, retval)
|
||||
return (EBADF);
|
||||
|
||||
FILE_USE(fp);
|
||||
error = (*fp->f_ops->fo_stat)(fp->f_data, &ub, p);
|
||||
error = (*fp->f_ops->fo_stat)(fp, &ub, p);
|
||||
FILE_UNUSE(fp, p);
|
||||
|
||||
osf1_cvt_stat_from_native(&ub, &oub);
|
||||
@ -281,7 +281,7 @@ osf1_sys_fstat2(p, v, retval)
|
||||
return (EBADF);
|
||||
|
||||
FILE_USE(fp);
|
||||
error = (*fp->f_ops->fo_stat)(fp->f_data, &ub, p);
|
||||
error = (*fp->f_ops->fo_stat)(fp, &ub, p);
|
||||
FILE_UNUSE(fp, p);
|
||||
|
||||
osf1_cvt_stat2_from_native(&ub, &oub);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kern_descrip.c,v 1.73 2001/04/07 09:00:57 jdolecek Exp $ */
|
||||
/* $NetBSD: kern_descrip.c,v 1.74 2001/04/09 10:22:02 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1989, 1991, 1993
|
||||
@ -487,7 +487,7 @@ sys___fstat13(struct proc *p, void *v, register_t *retval)
|
||||
return (EBADF);
|
||||
|
||||
FILE_USE(fp);
|
||||
error = (*fp->f_ops->fo_stat)(fp->f_data, &ub, p);
|
||||
error = (*fp->f_ops->fo_stat)(fp, &ub, p);
|
||||
FILE_UNUSE(fp, p);
|
||||
|
||||
if (error == 0)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sys_socket.c,v 1.23 2001/04/07 09:00:57 jdolecek Exp $ */
|
||||
/* $NetBSD: sys_socket.c,v 1.24 2001/04/09 10:22:02 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1990, 1993
|
||||
@ -191,12 +191,12 @@ soo_poll(fp, events, p)
|
||||
}
|
||||
|
||||
int
|
||||
soo_stat(fdata, ub, p)
|
||||
void *fdata;
|
||||
soo_stat(fp, ub, p)
|
||||
struct file *fp;
|
||||
struct stat *ub;
|
||||
struct proc *p;
|
||||
{
|
||||
struct socket *so = fdata;
|
||||
struct socket *so = (struct socket *)fp->f_data;
|
||||
|
||||
memset((caddr_t)ub, 0, sizeof(*ub));
|
||||
ub->st_mode = S_IFSOCK;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vfs_vnops.c,v 1.47 2001/04/07 09:00:57 jdolecek Exp $ */
|
||||
/* $NetBSD: vfs_vnops.c,v 1.48 2001/04/09 10:22:02 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1989, 1993
|
||||
@ -62,8 +62,12 @@
|
||||
#include <miscfs/union/union.h>
|
||||
#endif
|
||||
|
||||
struct fileops vnops =
|
||||
{ vn_read, vn_write, vn_ioctl, vn_fcntl, vn_poll, vn_stat, vn_closefile };
|
||||
static int vn_statfile __P((struct file *fp, struct stat *sb, struct proc *p));
|
||||
|
||||
struct fileops vnops = {
|
||||
vn_read, vn_write, vn_ioctl, vn_fcntl, vn_poll,
|
||||
vn_statfile, vn_closefile
|
||||
};
|
||||
|
||||
/*
|
||||
* Common code for vnode open operations.
|
||||
@ -433,6 +437,17 @@ vn_write(fp, offset, uio, cred, flags)
|
||||
/*
|
||||
* File table vnode stat routine.
|
||||
*/
|
||||
static int
|
||||
vn_statfile(fp, sb, p)
|
||||
struct file *fp;
|
||||
struct stat *sb;
|
||||
struct proc *p;
|
||||
{
|
||||
struct vnode *vp = (struct vnode *)fp->f_data;
|
||||
|
||||
return vn_stat(vp, sb, p);
|
||||
}
|
||||
|
||||
int
|
||||
vn_stat(fdata, sb, p)
|
||||
void *fdata;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fdesc_vnops.c,v 1.61 2001/04/09 09:39:09 jdolecek Exp $ */
|
||||
/* $NetBSD: fdesc_vnops.c,v 1.62 2001/04/09 10:22:00 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -489,7 +489,7 @@ fdesc_attr(fd, vap, cred, p)
|
||||
|
||||
case DTYPE_SOCKET:
|
||||
FILE_USE(fp);
|
||||
error = (*fp->f_ops->fo_stat)(fp->f_data, &stb, p);
|
||||
error = (*fp->f_ops->fo_stat)(fp, &stb, p);
|
||||
FILE_UNUSE(fp, p);
|
||||
if (error == 0) {
|
||||
vattr_null(vap);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: file.h,v 1.24 2001/04/07 09:00:58 jdolecek Exp $ */
|
||||
/* $NetBSD: file.h,v 1.25 2001/04/09 10:22:02 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1989, 1993
|
||||
@ -76,7 +76,7 @@ struct file {
|
||||
caddr_t data, struct proc *p);
|
||||
int (*fo_poll) (struct file *fp, int events,
|
||||
struct proc *p);
|
||||
int (*fo_stat) (void *fdata, struct stat *sp,
|
||||
int (*fo_stat) (struct file *fp, struct stat *sp,
|
||||
struct proc *p);
|
||||
int (*fo_close) (struct file *fp, struct proc *p);
|
||||
} *f_ops;
|
||||
|
Loading…
Reference in New Issue
Block a user