5 * Copyright (C) 1991, 1992 Linus Torvalds
8 * Copyright (C) 1993 Pascal Haible, Bruno Haible
11 * Copyright (C) 1993 Bruno Haible
13 * SystemV/Coherent regular file handling primitives
16 #include <linux/kernel.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>
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).
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
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 */
58 sysv_sync_file
, /* fsync */
60 NULL
, /* check_media_change */
64 struct inode_operations sysv_file_inode_operations
= {
65 &sysv_file_operations
, /* default file operations */
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 */