- Linus: drop support for old-style Makefiles entirely. Big.
[davej-history.git] / fs / ufs / file.c
blob2a27f6f2325bcb9e51a5af47e723e6a5abd1b2b4
1 /*
2 * linux/fs/ufs/file.c
4 * Copyright (C) 1998
5 * Daniel Pirkl <daniel.pirkl@email.cz>
6 * Charles University, Faculty of Mathematics and Physics
8 * from
10 * linux/fs/ext2/file.c
12 * Copyright (C) 1992, 1993, 1994, 1995
13 * Remy Card (card@masi.ibp.fr)
14 * Laboratoire MASI - Institut Blaise Pascal
15 * Universite Pierre et Marie Curie (Paris VI)
17 * from
19 * linux/fs/minix/file.c
21 * Copyright (C) 1991, 1992 Linus Torvalds
23 * ext2 fs regular file handling primitives
26 #include <asm/uaccess.h>
27 #include <asm/system.h>
29 #include <linux/errno.h>
30 #include <linux/fs.h>
31 #include <linux/ufs_fs.h>
32 #include <linux/fcntl.h>
33 #include <linux/sched.h>
34 #include <linux/stat.h>
35 #include <linux/locks.h>
36 #include <linux/mm.h>
37 #include <linux/pagemap.h>
40 * Make sure the offset never goes beyond the 32-bit mark..
42 static long long ufs_file_lseek(
43 struct file *file,
44 long long offset,
45 int origin )
47 long long retval;
48 struct inode *inode = file->f_dentry->d_inode;
50 switch (origin) {
51 case 2:
52 offset += inode->i_size;
53 break;
54 case 1:
55 offset += file->f_pos;
57 retval = -EINVAL;
58 /* make sure the offset fits in 32 bits */
59 if (((unsigned long long) offset >> 32) == 0) {
60 if (offset != file->f_pos) {
61 file->f_pos = offset;
62 file->f_reada = 0;
63 file->f_version = ++event;
65 retval = offset;
67 return retval;
71 * We have mostly NULL's here: the current defaults are ok for
72 * the ufs filesystem.
74 struct file_operations ufs_file_operations = {
75 llseek: ufs_file_lseek,
76 read: generic_file_read,
77 write: generic_file_write,
78 mmap: generic_file_mmap,
81 struct inode_operations ufs_file_inode_operations = {
82 truncate: ufs_truncate,