Blame view

fs/ramfs/file-mmu.c 1.5 KB
642fb4d1f   David Howells   [PATCH] NOMMU: Pr...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  /* file-mmu.c: ramfs MMU-based file operations
   *
   * Resizable simple ram filesystem for Linux.
   *
   * Copyright (C) 2000 Linus Torvalds.
   *               2000 Transmeta Corp.
   *
   * Usage limits added by David Gibson, Linuxcare Australia.
   * This file is released under the GPL.
   */
  
  /*
   * NOTE! This filesystem is probably most useful
   * not as a real filesystem, but as an example of
   * how virtual filesystems can be written.
   *
   * It doesn't get much simpler than this. Consider
   * that this file implements the full semantics of
   * a POSIX-compliant read-write filesystem.
   *
   * Note in particular how the filesystem does not
   * need to implement any data structures of its own
   * to keep track of the virtual data: using the VFS
   * caches is sufficient.
   */
642fb4d1f   David Howells   [PATCH] NOMMU: Pr...
26
  #include <linux/fs.h>
131612dfe   Dimitri Gorokhovik   [PATCH] ramfs bre...
27
  #include <linux/mm.h>
4488c59c9   Adrian Bunk   fs/ramfs/ extern ...
28
29
30
  #include <linux/ramfs.h>
  
  #include "internal.h"
642fb4d1f   David Howells   [PATCH] NOMMU: Pr...
31

f5e54d6e5   Christoph Hellwig   [PATCH] mark addr...
32
  const struct address_space_operations ramfs_aops = {
642fb4d1f   David Howells   [PATCH] NOMMU: Pr...
33
  	.readpage	= simple_readpage,
800d15a53   Nick Piggin   implement simple ...
34
35
  	.write_begin	= simple_write_begin,
  	.write_end	= simple_write_end,
466262963   Ken Chen   [PATCH] convert r...
36
  	.set_page_dirty = __set_page_dirty_no_writeback,
642fb4d1f   David Howells   [PATCH] NOMMU: Pr...
37
  };
4b6f5d20b   Arjan van de Ven   [PATCH] Make most...
38
  const struct file_operations ramfs_file_operations = {
543ade1fc   Badari Pulavarty   [PATCH] Streamlin...
39
40
41
42
  	.read		= do_sync_read,
  	.aio_read	= generic_file_aio_read,
  	.write		= do_sync_write,
  	.aio_write	= generic_file_aio_write,
642fb4d1f   David Howells   [PATCH] NOMMU: Pr...
43
  	.mmap		= generic_file_mmap,
1b061d924   Christoph Hellwig   rename the generi...
44
  	.fsync		= noop_fsync,
5ffc4ef45   Jens Axboe   sendfile: remove ...
45
  	.splice_read	= generic_file_splice_read,
8b3d3567f   Octavian Purdila   ramfs: enable spl...
46
  	.splice_write	= generic_file_splice_write,
642fb4d1f   David Howells   [PATCH] NOMMU: Pr...
47
48
  	.llseek		= generic_file_llseek,
  };
c5ef1c42c   Arjan van de Ven   [PATCH] mark stru...
49
  const struct inode_operations ramfs_file_inode_operations = {
3322e79a3   Nick Piggin   fs: convert simpl...
50
  	.setattr	= simple_setattr,
642fb4d1f   David Howells   [PATCH] NOMMU: Pr...
51
52
  	.getattr	= simple_getattr,
  };