/** * @file tarfs_common.h * * Contains defines of various constants and debugging macros * * @author Jaroslav Drazan * @author Petr Cermak */ /* ************************************************************************* * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * ************************************************************************* */ #ifndef __TARFS_COMMON__ #define __TARFS_COMMON__ // Uncomment this to enable debugging messages //#define DEBUG #define TARFS_BLKSIZE 512 /**< Size of one tar block */ #define TARFS_BLKSIZE_BITS 9 /**< No. of bits of size */ #define TARFS_MAGIC 0x4625 /**< Magic number of this filesystem */ #define FSNAME "tarfs" /**< Registered name of this fs */ #define TARFS_EVAL ((unsigned long) - 1) /**< Error return value when returning unsigned long values */ #define TARFS_THISDIR_FPOS ((unsigned long) - 2) /**< Value of filp->f_pos. Means '.' directory */ #define TARFS_PARENTDIR_FPOS ((unsigned long) - 3) /**< Value of filp->f_pos. Means '..' directory */ #define TARFS_ROOT_INO ((unsigned long) - 4) /**< Inode number of root directory if not present in tar */ #define TARFS_NUMLENGTH 11 /**< Length of octal number in tar */ /** * influences return value of function is_right_prefix() * * to allow reading/listing files added to tar archive later * it's nessery to search the archive to the end, * so the function is_right_prefix must return -1 also in case * dname doesn't contain fname. * So if this macro is set to 0, it's more effective to read dirs, * but adding files is not supported * * to allow reading added files set this macro to -1, otherwise to 0 * * @see is_right_prefix() */ #define TARFS_CAN_ADD -1 #ifdef DEBUG #define PRINTD(X) printk("<1>" X "\n"); #else #define PRINTD(X) #endif #endif // __TARFS_CONSTS_H__