Implementation of the file operations. More...
#include "file.h"#include "storage.h"#include "mountdata.h"#include <linux/list.h>#include <linux/rwsem.h>#include <linux/fs.h>#include <asm/uaccess.h>
Go to the source code of this file.
Functions | |
| int | mumufs_file_open (struct inode *inode, struct file *file) |
| File open operation. | |
| int | mumufs_file_release (struct inode *inode, struct file *file) |
| File close operation. | |
| ssize_t | mumufs_file_read (struct file *file, char *buffer, size_t size, loff_t *offset) |
| File read operation. | |
| ssize_t | mumufs_file_write (struct file *file, const char *buffer, size_t size, loff_t *offset) |
| File write operation. | |
| unsigned int | mumufs_file_poll (struct file *file, struct poll_table_struct *poll_table) |
| Checks whether there is activity on a file and goes to sleep until something happens on it. | |
Implementation of the file operations.
This file is released under the GPL.
Definition in file file.c.
| int mumufs_file_open | ( | struct inode * | inode, | |
| struct file * | file | |||
| ) |
| unsigned int mumufs_file_poll | ( | struct file * | file, | |
| struct poll_table_struct * | poll_table | |||
| ) |
Checks whether there is activity on a file and goes to sleep until something happens on it.
| file | the opened file kernel "file" structure pointer | |
| poll_table | supports kernel poll mechanism |
Definition at line 235 of file file.c.
References mumufs_storage::blocked_readers, mumufs_storage::buffer_lock, and mumufs_storage::buffer_version.
| ssize_t mumufs_file_read | ( | struct file * | file, | |
| char * | buffer, | |||
| size_t | size, | |||
| loff_t * | offset | |||
| ) |
File read operation.
| file | the opened file kernel "file" structure pointer | |
| buffer | Userspace reading buffer | |
| size | Userspace reading buffer size | |
| offset | File reading position. It must be 0, otherwise read fails. |
Blocking and non-blocking IO is supported
Definition at line 82 of file file.c.
References mumufs_storage::blocked_readers, mumufs_storage::buffer, mumufs_storage::buffer_lock, mumufs_storage::buffer_size, and mumufs_storage::buffer_version.
| int mumufs_file_release | ( | struct inode * | inode, | |
| struct file * | file | |||
| ) |
File close operation.
| inode | the closing file inode pointer | |
| file | the closing file kernel "file" structure pointer |
The storage for the file is freed at the inode putting so there is nothing to do here
| ssize_t mumufs_file_write | ( | struct file * | file, | |
| const char * | buffer, | |||
| size_t | size, | |||
| loff_t * | offset | |||
| ) |
File write operation.
| file | the opened file kernel "file" structure pointer | |
| buffer | Userspace writing buffer | |
| size | Userspace writing buffer size | |
| offset | File writing position. It must be 0, otherwise write fails. |
Definition at line 166 of file file.c.
References mumufs_storage::blocked_readers, mumufs_storage::buffer, mumufs_storage::buffer_lock, mumufs_storage::buffer_size, mumufs_storage::buffer_version, and mumu_mount_data::max_block_size.