* add p cc
[mascara-docs.git] / i386 / linux / linux-2.3.21 / fs / minix / file.c
blob6683c393cc6487abc9ece8bac4cd7fbb6fe33a90
1 /*
2 * linux/fs/minix/file.c
4 * Copyright (C) 1991, 1992 Linus Torvalds
6 * minix regular file handling primitives
7 */
9 #include <linux/sched.h>
10 #include <linux/kernel.h>
11 #include <linux/errno.h>
12 #include <linux/fcntl.h>
13 #include <linux/stat.h>
14 #include <linux/locks.h>
15 #include <linux/mm.h>
16 #include <linux/pagemap.h>
18 #include <asm/uaccess.h>
19 #include <asm/system.h>
21 #define NBUF 32
23 #define MIN(a,b) (((a)<(b))?(a):(b))
24 #define MAX(a,b) (((a)>(b))?(a):(b))
26 #include <linux/fs.h>
27 #include <linux/minix_fs.h>
30 * Write to a file (through the page cache).
32 static ssize_t
33 minix_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
35 return generic_file_write(file, buf, count,
36 ppos, block_write_partial_page);
40 * We have mostly NULLs here: the current defaults are OK for
41 * the minix filesystem.
43 static struct file_operations minix_file_operations = {
44 NULL, /* lseek - default */
45 generic_file_read, /* read */
46 minix_file_write, /* write */
47 NULL, /* readdir - bad */
48 NULL, /* poll - default */
49 NULL, /* ioctl - default */
50 generic_file_mmap, /* mmap */
51 NULL, /* no special open is needed */
52 NULL, /* flush */
53 NULL, /* release */
54 minix_sync_file, /* fsync */
55 NULL, /* fasync */
56 NULL, /* check_media_change */
57 NULL /* revalidate */
60 struct inode_operations minix_file_inode_operations = {
61 &minix_file_operations, /* default file operations */
62 NULL, /* create */
63 NULL, /* lookup */
64 NULL, /* link */
65 NULL, /* unlink */
66 NULL, /* symlink */
67 NULL, /* mkdir */
68 NULL, /* rmdir */
69 NULL, /* mknod */
70 NULL, /* rename */
71 NULL, /* readlink */
72 NULL, /* follow_link */
73 minix_get_block, /* get_block */
74 block_read_full_page, /* readpage */
75 block_write_full_page, /* writepage */
76 block_flushpage, /* flushpage */
77 minix_truncate, /* truncate */
78 NULL, /* permission */
79 NULL, /* smap */
80 NULL, /* revalidate */