Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

tarfs_module.c File Reference

#include <linux/module.h>
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/locks.h>
#include <linux/smp_lock.h>
#include "tarfs_tar.h"
#include "tarfs_common.h"

Go to the source code of this file.

Functions

 MODULE_DESCRIPTION ("TAR FS")
 MODULE_AUTHOR ("Petr Cermak;Jaroslav Drazan")
 MODULE_LICENSE ("GPL")
super_block * tarfs_read_super (struct super_block *s, void *data, int silent)
 Reads super block of fs.

void tarfs_read_inode (struct inode *i)
 Reads given inode from device.

int tarfs_statfs (struct super_block *sb, struct statfs *buf)
 Returns some info on mounted fs.

dentry * tarfs_lookup (struct inode *dir, struct dentry *dentry)
 Looks up dentry in directory dir.

int tarfs_readdir (struct file *filp, void *dirent, filldir_t filldir)
int tarfs_readpage (struct file *file, struct page *page)
 Reads one (or a part of) page from tar.

 DECLARE_FSTYPE_DEV (tarfs_type, FSNAME, tarfs_read_super)
void tarfs_get_new_root_inode (struct inode *i)
 Fills given inode as root inode.

int __init init_module ()
 Registers filesystem.

void __exit cleanup_module ()
 Unregisters filesystem.


Variables

super_operations tarfs_ops
inode_operations tarfs_inode_ops
file_operations tarfs_dir_ops
address_space_operations tarfs_aops


Detailed Description

Contains interface for communicating with VFS

Author:
Jaroslav Drazan <jaroslavdrazan@seznam.cz>

Petr Cermak

Definition in file tarfs_module.c.


Function Documentation

void __exit cleanup_module  )  [static]
 

Unregisters filesystem.

Definition at line 324 of file tarfs_module.c.

DECLARE_FSTYPE_DEV tarfs_type  ,
FSNAME  ,
tarfs_read_super 
[static]
 

int __init init_module  )  [static]
 

Registers filesystem.

Returns:
0 - OK, < 0 otherwise

Definition at line 316 of file tarfs_module.c.

MODULE_AUTHOR "Petr Cermak;Jaroslav Drazan"   ) 
 

MODULE_DESCRIPTION "TAR FS"   ) 
 

MODULE_LICENSE "GPL"   ) 
 

void tarfs_get_new_root_inode struct inode *  i  ) 
 

Fills given inode as root inode.

Called, if there is no root inode present in tar file

Parameters:
i Inode structure to be filled

Definition at line 187 of file tarfs_module.c.

References PRINTD, tarfs_dir_ops, and tarfs_inode_ops.

Referenced by tarfs_read_inode().

struct dentry * tarfs_lookup struct inode *  dir,
struct dentry *  dentry
[static]
 

Looks up dentry in directory dir.

When found, relevant inode is joined with the dentry by calling d_add function (added to dcache)

Parameters:
dir Direstory to perform search in
dentry Directory entry to be searched for
Returns:
0 - OK, ERR_PTR(-EACCES) - given entry was not found

Definition at line 156 of file tarfs_module.c.

References PRINTD, tar_lookup(), TARFS_EVAL, and tarfs_lookup().

Referenced by tarfs_lookup().

void tarfs_read_inode struct inode *  i  )  [static]
 

Reads given inode from device.

Parameters:
i Pre-filled inode structure to be read.

Definition at line 204 of file tarfs_module.c.

References PRINTD, tar_fill_inode(), tarfs_aops, tarfs_dir_ops, tarfs_get_new_root_inode(), tarfs_inode_ops, and TARFS_ROOT_INO.

struct super_block * tarfs_read_super struct super_block *  s,
void *  data,
int  silent
[static]
 

Reads super block of fs.

Reads super block of tarfs, finds root inode and initializes kernel structures

Parameters:
s A partially filled super block structure from kernel
data Mount data passed by mount syscall
silent Bool value, disables / enables error output when mounting fs.
Returns:
Filled super_block structure

Definition at line 84 of file tarfs_module.c.

References PRINTD, tar_get_root_ino(), tar_quick_validation(), TARFS_BLKSIZE, TARFS_BLKSIZE_BITS, TARFS_EVAL, TARFS_MAGIC, tarfs_ops, and tarfs_read_super().

Referenced by tarfs_read_super().

int tarfs_readdir struct file *  filp,
void *  dirent,
filldir_t  filldir
[static]
 

Definition at line 129 of file tarfs_module.c.

References PRINTD, tar_readdir(), and TARFS_EVAL.

int tarfs_readpage struct file *  file,
struct page *  page
[static]
 

Reads one (or a part of) page from tar.

This function is called when reading from file, mapping into memory, reading symlinks etc.

Parameters:
file File from which to map desired page. We don't need/use it.
page Structure describing page to be read. Contains relevant inode in page->mapping->host.
Returns:
0 - OK, -EIO - error reading page

Definition at line 255 of file tarfs_module.c.

References PRINTD, tar_read_page(), and TARFS_EVAL.

int tarfs_statfs struct super_block *  s,
struct statfs *  stats
[static]
 

Returns some info on mounted fs.

Parameters:
s Super block structure.
stats Structure to fill fs info into.
Returns:
0 - Success

Definition at line 298 of file tarfs_module.c.

References PRINTD, tar_length(), TARFS_BLKSIZE, and TARFS_MAGIC.


Variable Documentation

struct address_space_operations tarfs_aops [static]
 

Initial value:

 {
    readpage:   tarfs_readpage,
}

Definition at line 66 of file tarfs_module.c.

Referenced by tarfs_read_inode().

struct file_operations tarfs_dir_ops [static]
 

Initial value:

 {
    read:       generic_read_dir,
    readdir:    tarfs_readdir,
}

Definition at line 60 of file tarfs_module.c.

Referenced by tarfs_get_new_root_inode(), and tarfs_read_inode().

struct inode_operations tarfs_inode_ops [static]
 

Initial value:

 {
    lookup:     tarfs_lookup,

}

Definition at line 54 of file tarfs_module.c.

Referenced by tarfs_get_new_root_inode(), and tarfs_read_inode().

struct super_operations tarfs_ops [static]
 

Initial value:

 {
    read_inode: tarfs_read_inode,
    statfs:     tarfs_statfs,
}

Definition at line 48 of file tarfs_module.c.

Referenced by tarfs_read_super().


Generated on Fri May 23 02:10:44 2003 for TarFS by doxygen1.3