Import 2.3.26pre2
[davej-history.git] / fs / sysv / file.c
blob36650f14171df6f2d2e560a7b5db9ce2741d4f71
1 /*
2 * linux/fs/sysv/file.c
4 * minix/file.c
5 * Copyright (C) 1991, 1992 Linus Torvalds
7 * coh/file.c
8 * Copyright (C) 1993 Pascal Haible, Bruno Haible
10 * sysv/file.c
11 * Copyright (C) 1993 Bruno Haible
13 * SystemV/Coherent regular file handling primitives
16 #include <linux/kernel.h>
17 #include <linux/fs.h>
18 #include <linux/sysv_fs.h>
19 #include <linux/errno.h>
20 #include <linux/fcntl.h>
21 #include <linux/stat.h>
22 #include <linux/string.h>
23 #include <linux/locks.h>
24 #include <linux/pagemap.h>
26 #include <asm/uaccess.h>
28 #define NBUF 32
30 #define MIN(a,b) (((a)<(b))?(a):(b))
31 #define MAX(a,b) (((a)>(b))?(a):(b))
34 * Write to a file (through the page cache).
36 static ssize_t
37 sysv_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
39 return generic_file_write(file, buf, count,
40 ppos, block_write_partial_page);
44 * We have mostly NULLs here: the current defaults are OK for
45 * the coh filesystem.
47 static struct file_operations sysv_file_operations = {
48 NULL, /* lseek - default */
49 generic_file_read, /* read */
50 sysv_file_write, /* write */
51 NULL, /* readdir - bad */
52 NULL, /* poll - default */
53 NULL, /* ioctl - default */
54 generic_file_mmap, /* mmap */
55 NULL, /* no special open is needed */
56 NULL, /* flush */
57 NULL, /* release */
58 sysv_sync_file, /* fsync */
59 NULL, /* fasync */
60 NULL, /* check_media_change */
61 NULL /* revalidate */
64 struct inode_operations sysv_file_inode_operations = {
65 &sysv_file_operations, /* default file operations */
66 NULL, /* create */
67 NULL, /* lookup */
68 NULL, /* link */
69 NULL, /* unlink */
70 NULL, /* symlink */
71 NULL, /* mkdir */
72 NULL, /* rmdir */
73 NULL, /* mknod */
74 NULL, /* rename */
75 NULL, /* readlink */
76 NULL, /* follow_link */
77 sysv_get_block, /* get_block */
78 block_read_full_page, /* readpage */
79 block_write_full_page, /* writepage */
80 block_flushpage, /* flushpage */
81 sysv_truncate, /* truncate */
82 NULL, /* permission */
83 NULL, /* smap */
84 NULL /* revalidate */