Blame view

fs/sysv/file.c 1.24 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  /*
   *  linux/fs/sysv/file.c
   *
   *  minix/file.c
   *  Copyright (C) 1991, 1992  Linus Torvalds
   *
   *  coh/file.c
   *  Copyright (C) 1993  Pascal Haible, Bruno Haible
   *
   *  sysv/file.c
   *  Copyright (C) 1993  Bruno Haible
   *
   *  SystemV/Coherent regular file handling primitives
   */
  
  #include "sysv.h"
  
  /*
   * We have mostly NULLs here: the current defaults are OK for
   * the coh filesystem.
   */
4b6f5d20b   Arjan van de Ven   [PATCH] Make most...
22
  const struct file_operations sysv_file_operations = {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
23
  	.llseek		= generic_file_llseek,
543ade1fc   Badari Pulavarty   [PATCH] Streamlin...
24
25
26
27
  	.read		= do_sync_read,
  	.aio_read	= generic_file_aio_read,
  	.write		= do_sync_write,
  	.aio_write	= generic_file_aio_write,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
28
  	.mmap		= generic_file_mmap,
1b061d924   Christoph Hellwig   rename the generi...
29
  	.fsync		= generic_file_fsync,
5ffc4ef45   Jens Axboe   sendfile: remove ...
30
  	.splice_read	= generic_file_splice_read,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
31
  };
d39aae9ec   Christoph Hellwig   add missing setat...
32
33
34
35
36
37
38
39
  static int sysv_setattr(struct dentry *dentry, struct iattr *attr)
  {
  	struct inode *inode = dentry->d_inode;
  	int error;
  
  	error = inode_change_ok(inode, attr);
  	if (error)
  		return error;
1025774ce   Christoph Hellwig   remove inode_setattr
40
41
42
43
44
45
46
47
48
49
50
  
  	if ((attr->ia_valid & ATTR_SIZE) &&
  	    attr->ia_size != i_size_read(inode)) {
  		error = vmtruncate(inode, attr->ia_size);
  		if (error)
  			return error;
  	}
  
  	setattr_copy(inode, attr);
  	mark_inode_dirty(inode);
  	return 0;
d39aae9ec   Christoph Hellwig   add missing setat...
51
  }
c5ef1c42c   Arjan van de Ven   [PATCH] mark stru...
52
  const struct inode_operations sysv_file_inode_operations = {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
53
  	.truncate	= sysv_truncate,
d39aae9ec   Christoph Hellwig   add missing setat...
54
  	.setattr	= sysv_setattr,
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
55
56
  	.getattr	= sysv_getattr,
  };