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))
29 * Write to a file (through the page cache).
32 minix_file_write(struct file
*file
, const char *buf
, size_t count
, loff_t
*ppos
)
34 return generic_file_write(file
, buf
, count
,
35 ppos
, block_write_partial_page
);
39 * We have mostly NULLs here: the current defaults are OK for
40 * the minix filesystem.
42 static struct file_operations minix_file_operations
= {
43 NULL
, /* lseek - default */
44 generic_file_read
, /* read */
45 minix_file_write
, /* write */
46 NULL
, /* readdir - bad */
47 NULL
, /* poll - default */
48 NULL
, /* ioctl - default */
49 generic_file_mmap
, /* mmap */
50 NULL
, /* no special open is needed */
53 minix_sync_file
, /* fsync */
55 NULL
, /* check_media_change */
59 struct inode_operations minix_file_inode_operations
= {
60 &minix_file_operations
, /* default file operations */
71 NULL
, /* follow_link */
72 minix_get_block
, /* get_block */
73 block_read_full_page
, /* readpage */
74 block_write_full_page
, /* writepage */
75 block_flushpage
, /* flushpage */
76 minix_truncate
, /* truncate */
77 NULL
, /* permission */
79 NULL
, /* revalidate */