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

tarfs_tar.h File Reference

#include <linux/fs.h>

Go to the source code of this file.

Functions

int tar_quick_validation (struct super_block *s)
 Performs quick valiadtion of tar.

unsigned long tar_get_root_ino (struct super_block *s)
 Returns number of root inode.

unsigned long tar_length (struct super_block *s)
 Returns number of blocks in tar.

int tar_fill_inode (struct super_block *s, struct inode *inode, int *rdev)
 Reads inode from tar.

unsigned long tar_readdir (struct file *filp, void *dirent, filldir_t filldir)
 Reads directory entries.

unsigned long tar_lookup (struct super_block *s, unsigned long ino, const char *fname, unsigned int fsize)
 Searches for file in given directory.

unsigned long tar_read_page (struct super_block *s, struct inode *inode, loff_t offset, void *buffer)
 Fills buffer with data from given inode.


Detailed Description

Header file for tarfs_tar.c Contains functions needed for parsing tar This interface is aimed for interoperability with VFS

Author:
Jaroslav Drazan <jaroslavdrazan@seznam.cz>

Petr Cermak <xgxg@seznam.cz>

Definition in file tarfs_tar.h.


Function Documentation

int tar_fill_inode struct super_block *  s,
struct inode *  inode,
int *  rdev
 

Reads inode from tar.

Fills inode data like times, acces rights, size of file

Parameters:
s Super block structure needed to perform i/o operations
inode Inode structure to be filled
rdev [out] If inode type is device, this parameter is filled with value kdev_t_to_nr(major, minor)
Returns:
Type of inode, as defined in stat.h (S_IFREG, S_IFLNK, S_IFCHR, S_IFBLK, S_IFIFO, S_IFDIR), 0 in case of error

Definition at line 739 of file tarfs_tar.c.

References AREGTYPE, BLKTYPE, CHRTYPE, posix_header::devmajor, posix_header::devminor, DIRTYPE, FIFOTYPE, posix_header::gid, is_tar(), posix_header::linkname, LNKTYPE, posix_header::mode, posix_header::mtime, oct_to_dec(), OFFSET_BY_INO, offset_by_name(), pom_read_name(), read_block(), REGTYPE, short_name_size(), posix_header::size, skip_blocks(), SYMTYPE, TARFS_EVAL, TARFS_NUMLENGTH, TARFS_ROOT_INO, posix_header::typeflag, and posix_header::uid.

Referenced by tarfs_read_inode().

unsigned long tar_get_root_ino struct super_block *  s  ) 
 

Returns number of root inode.

Parameters:
s Super block structure needed to perform i/o operations
Returns:
Number of root inode, TARFS_EVAL - error

Definition at line 184 of file tarfs_tar.c.

References AREGTYPE, BLKTYPE, CHRTYPE, DIRTYPE, FIFOTYPE, get_root_ino_pom(), hcc(), is_tar(), LNKTYPE, oct_to_dec(), read_block(), REGTYPE, posix_header::size, SYMTYPE, TARFS_BLKSIZE, TARFS_EVAL, TARFS_NUMLENGTH, and posix_header::typeflag.

Referenced by tarfs_read_super().

unsigned long tar_length struct super_block *  s  ) 
 

Returns number of blocks in tar.

Parameters:
s Super block structure needed to perform i/o operations
Returns:
Number of blocks, 0 - error (or empty)

Definition at line 241 of file tarfs_tar.c.

References hcc(), is_nullblock(), is_tar(), oct_to_dec(), read_block(), posix_header::size, tar_quick_validation(), TARFS_BLKSIZE, and TARFS_NUMLENGTH.

Referenced by tarfs_statfs().

unsigned long tar_lookup struct super_block *  s,
unsigned long  ino,
const char *  fname,
unsigned int  fsize
 

Searches for file in given directory.

Parameters:
s Super block structure needed to perform i/o operations
ino Inode of directory to be searched in
fname Name of desired file
fsize Size of fname
Returns:
Inode number of file if found, TARFS_EVAL otherwise

Definition at line 1499 of file tarfs_tar.c.

References DIRTYPE, hcc(), is_tar(), posix_header::name, oct_to_dec(), OFFSET_BY_INO, offset_by_name2(), pom_read_name(), read_block(), short_name_size(), posix_header::size, TARFS_BLKSIZE, TARFS_EVAL, TARFS_NUMLENGTH, TARFS_ROOT_INO, and posix_header::typeflag.

Referenced by tarfs_lookup().

int tar_quick_validation struct super_block *  s  ) 
 

Performs quick valiadtion of tar.

This function controls only the first block

Parameters:
s Super block structure needed to perform i/o operations
Returns:
1 - OK, 0 - is not tar, or other error

Definition at line 137 of file tarfs_tar.c.

References is_tar(), and read_block().

Referenced by tar_length(), and tarfs_read_super().

unsigned long tar_read_page struct super_block *  s,
struct inode *  inode,
loff_t  offset,
void *  buffer
 

Fills buffer with data from given inode.

Reads data from inode with given offset to the end of file or end of buffer (max PAGE_SIZE bytes)

Parameters:
s Super block structure needed to perform i/o operations
inode Inode with data to be read
offset Offset of desired data
buffer Alredy allocated buffer of size PAGE_SIZE (PAGE_SIZE should be multiple of TARFS_BLKSIZE)
Returns:
0 - EOF, 1 - OK, 2 - Symlink, TARFS_EVAL otherwise

Definition at line 1099 of file tarfs_tar.c.

References find_nolink(), hcc(), read_block(), symlinkname(), TARFS_BLKSIZE, TARFS_EVAL, and TARFS_ROOT_INO.

Referenced by tarfs_readpage().

unsigned long tar_readdir struct file *  filp,
void *  dirent,
filldir_t  filldir
 

Reads directory entries.

Reads directory entries, until stopped by returning <0 from filldir function, after that, it stores last entry id read into filp->f_pos. When called again, it continues from the last f_pos stored.

Parameters:
filp A file structure representing directory being read
dirent Falls through this function to the filldir call
filldir Pointer to a function called to add new dir entry
Returns:
Count of directory entries read, TARFS_EVAL otherwise

Definition at line 1218 of file tarfs_tar.c.

References AREGTYPE, BLKTYPE, CHRTYPE, DIRTYPE, FIFOTYPE, get_type(), hcc(), is_nullblock(), is_right_prefix(), is_tar(), LNKTYPE, posix_header::name, oct_to_dec(), OFFSET_BY_INO, pom_read_name(), read_block(), REGTYPE, short_name_size(), posix_header::size, skip_blocks(), SYMTYPE, TARFS_BLKSIZE, TARFS_EVAL, TARFS_NUMLENGTH, TARFS_PARENTDIR_FPOS, TARFS_ROOT_INO, TARFS_THISDIR_FPOS, and posix_header::typeflag.

Referenced by tarfs_readdir().


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