Deleted Added
sdiff udiff text old ( 12767 ) new ( 12913 )
full compact
1/*
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 22 unchanged lines hidden (view full) ---

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)vfs_vnops.c 8.2 (Berkeley) 1/21/94
39 * $Id: vfs_vnops.c,v 1.20 1995/12/07 12:47:07 davidg Exp $
40 */
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/kernel.h>
45#include <sys/file.h>
46#include <sys/stat.h>
47#include <sys/buf.h>
48#include <sys/proc.h>
49#include <sys/mount.h>
50#include <sys/namei.h>
51#include <sys/vnode.h>
52#include <sys/ioctl.h>
53
54#include <vm/vm.h>
55#include <vm/vm_param.h>
56#include <vm/vm_object.h>
57#include <vm/vnode_pager.h>
58
59struct fileops vnops =
60 { vn_read, vn_write, vn_ioctl, vn_select, vn_closefile };
61
62/*
63 * Common code for vnode open operations.
64 * Check permissions, and call the VOP_OPEN or VOP_CREATE routine.
65 */
66int

--- 183 unchanged lines hidden (view full) ---

250 if ((ioflg & IO_NODELOCKED) == 0)
251 VOP_UNLOCK(vp);
252 return (error);
253}
254
255/*
256 * File table vnode read routine.
257 */
258int
259vn_read(fp, uio, cred)
260 struct file *fp;
261 struct uio *uio;
262 struct ucred *cred;
263{
264 register struct vnode *vp = (struct vnode *)fp->f_data;
265 int count, error;
266

--- 6 unchanged lines hidden (view full) ---

273 fp->f_offset += count - uio->uio_resid;
274 VOP_UNLOCK(vp);
275 return (error);
276}
277
278/*
279 * File table vnode write routine.
280 */
281int
282vn_write(fp, uio, cred)
283 struct file *fp;
284 struct uio *uio;
285 struct ucred *cred;
286{
287 register struct vnode *vp = (struct vnode *)fp->f_data;
288 int count, error, ioflag = 0;
289

--- 82 unchanged lines hidden (view full) ---

372 sb->st_blocks = vap->va_bytes / S_BLKSIZE;
373#endif
374 return (0);
375}
376
377/*
378 * File table vnode ioctl routine.
379 */
380int
381vn_ioctl(fp, com, data, p)
382 struct file *fp;
383 int com;
384 caddr_t data;
385 struct proc *p;
386{
387 register struct vnode *vp = ((struct vnode *)fp->f_data);
388 struct vattr vattr;

--- 36 unchanged lines hidden (view full) ---

425 }
426 return (error);
427 }
428}
429
430/*
431 * File table vnode select routine.
432 */
433int
434vn_select(fp, which, p)
435 struct file *fp;
436 int which;
437 struct proc *p;
438{
439
440 return (VOP_SELECT(((struct vnode *)fp->f_data), which, fp->f_flag,
441 fp->f_cred, p));
442}
443
444/*
445 * File table vnode close routine.
446 */
447int
448vn_closefile(fp, p)
449 struct file *fp;
450 struct proc *p;
451{
452
453 return (vn_close(((struct vnode *)fp->f_data), fp->f_flag,
454 fp->f_cred, p));
455}
456
457int
458vn_vmio_open(vp, p, cred)
459 struct vnode *vp;
460 struct proc *p;
461 struct ucred *cred;
462{
463 struct vattr vat;
464 int error;
465 /*

--- 42 unchanged lines hidden ---