2006-01-06 00:11:41 -08:00
|
|
|
/* 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.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <linux/fs.h>
|
2006-12-29 16:48:24 -08:00
|
|
|
#include <linux/mm.h>
|
2008-04-29 00:58:51 -07:00
|
|
|
#include <linux/ramfs.h>
|
|
|
|
|
|
|
|
|
|
#include "internal.h"
|
2006-01-06 00:11:41 -08:00
|
|
|
|
2006-03-28 01:56:42 -08:00
|
|
|
const struct file_operations ramfs_file_operations = {
|
2014-04-02 14:33:16 -04:00
|
|
|
.read_iter = generic_file_read_iter,
|
2014-04-03 03:17:43 -04:00
|
|
|
.write_iter = generic_file_write_iter,
|
2006-01-06 00:11:41 -08:00
|
|
|
.mmap = generic_file_mmap,
|
2010-05-26 17:53:41 +02:00
|
|
|
.fsync = noop_fsync,
|
2007-06-01 11:49:19 +02:00
|
|
|
.splice_read = generic_file_splice_read,
|
2014-04-05 04:27:08 -04:00
|
|
|
.splice_write = iter_file_splice_write,
|
2006-01-06 00:11:41 -08:00
|
|
|
.llseek = generic_file_llseek,
|
|
|
|
|
};
|
|
|
|
|
|
2007-02-12 00:55:40 -08:00
|
|
|
const struct inode_operations ramfs_file_inode_operations = {
|
2010-05-27 22:42:19 +10:00
|
|
|
.setattr = simple_setattr,
|
2006-01-06 00:11:41 -08:00
|
|
|
.getattr = simple_getattr,
|
|
|
|
|
};
|