fsc_device.c File Reference

FS Char Device settings, implementation. More...

#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/fs.h>
#include <linux/sched.h>
#include <linux/statfs.h>
#include <linux/mm.h>
#include <asm/uaccess.h>
#include <asm/errno.h>
#include <linux/buffer_head.h>
#include <linux/pagemap.h>
#include <linux/proc_fs.h>
#include <asm/atomic.h>
#include "fsc_debug.h"
#include "fsc_device.h"

Go to the source code of this file.

Functions

 module_param (fsc_major, int, S_IRUSR)
ssize_t fsc_read (struct file *filp, char *buf, size_t count, loff_t *f_pos)
 Char Device read function. Allways called from user space by FS Deamon. The deamon reads content of output_buffer and sends it as commands and data to database. On empty output buffer (zero declared length) the caller will be blocked - added into wait queue. The caller will be woken up after writing any data into output buffer from kernel FS. This function don't support reading larger ammount of data then output buffer size. Greater number of char to be read can be specified, but the maximum ouput buffer length is returned. If count is less than output_buffer length, count characters will be read, but the kernel FS remains blocked until whole output_buffer is read.
ssize_t fsc_write (struct file *filp, const char *buf, size_t count, loff_t *f_pos)
 Char Device write function.
int fsc_release (struct inode *inode, struct file *filp)
 Release (close) the char device.
int fsc_open (struct inode *inode, struct file *filp)
 Open the char device.
void fsc_init (void)
 FS Character Device initialization.
void fsc_fini (void)
 FS Character Device fini.
int fsc_read_procmem (char *buf, char **start, off_t offset, int count, int *eof, void *data)
 Prints information about the fsc device.
int fsc_waitforempty_output (void)
 Wait for empty output buffer.
int fsc_waitforfull_input (void)
 Wait for full input buffer.
int __fsc_query__ (const char *out_buf, const int out_count, char *in_buf, int in_count)
 File System Char Device communication channel.
int fsc_query (const char *out_buf, const int out_count, char *in_buf, int in_count)

Variables

buffer fsc_output_buffer
buffer fsc_input_buffer
atomic_t fsc_available = ATOMIC_INIT(1)
semaphore fsc_sem
mutex query_mutex
int fsc_major = 0
file_operations fsc_fops


Detailed Description

FS Char Device settings, implementation.

Author:
Michal Podzimek, Michal Ficek, Tomas Pop, MFF UK, 2007
This file implements special char device used for comunication between kernel part of a filesystem and userspace deamon. Be carefull if using it this char device has very special behaviour, in some cases it behaves more like block device Especialy We mean this two features

Definition in file fsc_device.c.


Generated on Mon May 28 13:33:08 2007 for MYSQLFS by  doxygen 1.5.0