aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysv/file.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /fs/sysv/file.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'fs/sysv/file.c')
-rw-r--r--fs/sysv/file.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/fs/sysv/file.c b/fs/sysv/file.c
new file mode 100644
index 000000000000..da69abc06240
--- /dev/null
+++ b/fs/sysv/file.c
@@ -0,0 +1,49 @@
1/*
2 * linux/fs/sysv/file.c
3 *
4 * minix/file.c
5 * Copyright (C) 1991, 1992 Linus Torvalds
6 *
7 * coh/file.c
8 * Copyright (C) 1993 Pascal Haible, Bruno Haible
9 *
10 * sysv/file.c
11 * Copyright (C) 1993 Bruno Haible
12 *
13 * SystemV/Coherent regular file handling primitives
14 */
15
16#include "sysv.h"
17
18/*
19 * We have mostly NULLs here: the current defaults are OK for
20 * the coh filesystem.
21 */
22struct file_operations sysv_file_operations = {
23 .llseek = generic_file_llseek,
24 .read = generic_file_read,
25 .write = generic_file_write,
26 .mmap = generic_file_mmap,
27 .fsync = sysv_sync_file,
28 .sendfile = generic_file_sendfile,
29};
30
31struct inode_operations sysv_file_inode_operations = {
32 .truncate = sysv_truncate,
33 .getattr = sysv_getattr,
34};
35
36int sysv_sync_file(struct file * file, struct dentry *dentry, int datasync)
37{
38 struct inode *inode = dentry->d_inode;
39 int err;
40
41 err = sync_mapping_buffers(inode->i_mapping);
42 if (!(inode->i_state & I_DIRTY))
43 return err;
44 if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
45 return err;
46
47 err |= sysv_sync_inode(inode);
48 return err ? -EIO : 0;
49}