2 * linux/fs/minix/file.c
4 * Copyright (C) 1991, 1992 Linus Torvalds
6 * minix regular file handling primitives
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>
16 #include <linux/pagemap.h>
18 #include <asm/uaccess.h>
19 #include <asm/system.h>
23 #define MIN(a,b) (((a)<(b))?(a):(b))
24 #define MAX(a,b) (((a)>(b))?(a):(b))
27 #include <linux/minix_fs.h>
30 * Write to a file (through the page cache).
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 */
54 minix_sync_file
, /* fsync */
56 NULL
, /* check_media_change */
60 struct inode_operations minix_file_inode_operations
= {
61 &minix_file_operations
, /* default file operations */
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 */
80 NULL
, /* revalidate */