From 7b4e779a6141dafe0ae677bb6171894faa2daf6b Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sat, 7 Aug 2010 10:13:17 +0200 Subject: squashfs3: rename all static symbols to use 'squashfs3' --- fs/squashfs3/inode.c | 216 +++++++++++++++++++++--------------------- fs/squashfs3/squashfs2_0.c | 38 ++++---- include/linux/squashfs3_fs.h | 4 - 3 files changed, 127 insertions(+), 131 deletions(-) diff --git a/fs/squashfs3/inode.c b/fs/squashfs3/inode.c index fc275fc..a8825a0 100644 --- a/fs/squashfs3/inode.c +++ b/fs/squashfs3/inode.c @@ -37,71 +37,71 @@ #include "squashfs3.h" -static struct dentry *squashfs_fh_to_dentry(struct super_block *s, +static struct dentry *squashfs3_fh_to_dentry(struct super_block *s, struct fid *fid, int fh_len, int fh_type); -static struct dentry *squashfs_fh_to_parent(struct super_block *s, +static struct dentry *squashfs3_fh_to_parent(struct super_block *s, struct fid *fid, int fh_len, int fh_type); -static struct dentry *squashfs_get_parent(struct dentry *child); -static int squashfs_read_inode(struct inode *i, squashfs3_inode_t inode); -static int squashfs_statfs(struct dentry *, struct kstatfs *); -static int squashfs_symlink_readpage(struct file *file, struct page *page); +static struct dentry *squashfs3_get_parent(struct dentry *child); +static int squashfs3_read_inode(struct inode *i, squashfs3_inode_t inode); +static int squashfs3_statfs(struct dentry *, struct kstatfs *); +static int squashfs3_symlink_readpage(struct file *file, struct page *page); static long long read_blocklist(struct inode *inode, int index, int readahead_blks, char *block_list, unsigned short **block_p, unsigned int *bsize); -static int squashfs_readpage(struct file *file, struct page *page); -static int squashfs_readdir(struct file *, void *, filldir_t); -static struct dentry *squashfs_lookup(struct inode *, struct dentry *, +static int squashfs3_readpage(struct file *file, struct page *page); +static int squashfs3_readdir(struct file *, void *, filldir_t); +static struct dentry *squashfs3_lookup(struct inode *, struct dentry *, struct nameidata *); -static int squashfs_remount(struct super_block *s, int *flags, char *data); -static void squashfs_put_super(struct super_block *); -static int squashfs_get_sb(struct file_system_type *,int, const char *, void *, +static int squashfs3_remount(struct super_block *s, int *flags, char *data); +static void squashfs3_put_super(struct super_block *); +static int squashfs3_get_sb(struct file_system_type *,int, const char *, void *, struct vfsmount *); -static struct inode *squashfs_alloc_inode(struct super_block *sb); -static void squashfs_destroy_inode(struct inode *inode); +static struct inode *squashfs3_alloc_inode(struct super_block *sb); +static void squashfs3_destroy_inode(struct inode *inode); static int init_inodecache(void); static void destroy_inodecache(void); -static struct file_system_type squashfs_fs_type = { +static struct file_system_type squashfs3_fs_type = { .owner = THIS_MODULE, .name = "squashfs", - .get_sb = squashfs_get_sb, + .get_sb = squashfs3_get_sb, .kill_sb = kill_block_super, .fs_flags = FS_REQUIRES_DEV }; -static const unsigned char squashfs_filetype_table[] = { +static const unsigned char squashfs3_filetype_table[] = { DT_UNKNOWN, DT_DIR, DT_REG, DT_LNK, DT_BLK, DT_CHR, DT_FIFO, DT_SOCK }; -static struct super_operations squashfs_super_ops = { - .alloc_inode = squashfs_alloc_inode, - .destroy_inode = squashfs_destroy_inode, - .statfs = squashfs_statfs, - .put_super = squashfs_put_super, - .remount_fs = squashfs_remount +static struct super_operations squashfs3_super_ops = { + .alloc_inode = squashfs3_alloc_inode, + .destroy_inode = squashfs3_destroy_inode, + .statfs = squashfs3_statfs, + .put_super = squashfs3_put_super, + .remount_fs = squashfs3_remount }; -static struct export_operations squashfs_export_ops = { - .fh_to_dentry = squashfs_fh_to_dentry, - .fh_to_parent = squashfs_fh_to_parent, - .get_parent = squashfs_get_parent +static struct export_operations squashfs3_export_ops = { + .fh_to_dentry = squashfs3_fh_to_dentry, + .fh_to_parent = squashfs3_fh_to_parent, + .get_parent = squashfs3_get_parent }; SQSH_EXTERN const struct address_space_operations squashfs3_symlink_aops = { - .readpage = squashfs_symlink_readpage + .readpage = squashfs3_symlink_readpage }; SQSH_EXTERN const struct address_space_operations squashfs3_aops = { - .readpage = squashfs_readpage + .readpage = squashfs3_readpage }; -static const struct file_operations squashfs_dir_ops = { +static const struct file_operations squashfs3_dir_ops = { .read = generic_read_dir, - .readdir = squashfs_readdir + .readdir = squashfs3_readdir }; SQSH_EXTERN struct inode_operations squashfs3_dir_inode_ops = { - .lookup = squashfs_lookup + .lookup = squashfs3_lookup }; @@ -337,7 +337,7 @@ read_failure: } -static struct squashfs3_cache_entry *squashfs_cache_get(struct super_block *s, +static struct squashfs3_cache_entry *squashfs3_cache_get(struct super_block *s, struct squashfs3_cache *cache, long long block, int length) { int i, n; @@ -416,7 +416,7 @@ out: } -static void squashfs_cache_put(struct squashfs3_cache *cache, +static void squashfs3_cache_put(struct squashfs3_cache *cache, struct squashfs3_cache_entry *entry) { spin_lock(&cache->lock); @@ -431,7 +431,7 @@ static void squashfs_cache_put(struct squashfs3_cache *cache, } -static void squashfs_cache_delete(struct squashfs3_cache *cache) +static void squashfs3_cache_delete(struct squashfs3_cache *cache) { int i; @@ -450,7 +450,7 @@ static void squashfs_cache_delete(struct squashfs3_cache *cache) } -static struct squashfs3_cache *squashfs_cache_init(char *name, int entries, +static struct squashfs3_cache *squashfs3_cache_init(char *name, int entries, int block_size, int use_vmalloc) { int i; @@ -485,7 +485,7 @@ static struct squashfs3_cache *squashfs_cache_init(char *name, int entries, return cache; cleanup: - squashfs_cache_delete(cache); + squashfs3_cache_delete(cache); failed: return NULL; } @@ -503,7 +503,7 @@ SQSH_EXTERN int squashfs3_get_cached_block(struct super_block *s, void *buffer, TRACE("Entered squashfs3_get_cached_block [%llx:%x]\n", block, offset); while (1) { - entry = squashfs_cache_get(s, msblk->block_cache, block, 0); + entry = squashfs3_cache_get(s, msblk->block_cache, block, 0); bytes = entry->length - offset; if (entry->error || bytes < 1) { @@ -526,14 +526,14 @@ SQSH_EXTERN int squashfs3_get_cached_block(struct super_block *s, void *buffer, buffer = (char *) buffer + bytes; } block = entry->next_index; - squashfs_cache_put(msblk->block_cache, entry); + squashfs3_cache_put(msblk->block_cache, entry); length -= bytes; offset = 0; } } finish: - squashfs_cache_put(msblk->block_cache, entry); + squashfs3_cache_put(msblk->block_cache, entry); return return_length; } @@ -573,7 +573,7 @@ out: SQSH_EXTERN void release_cached_fragment(struct squashfs3_sb_info *msblk, struct squashfs3_cache_entry *fragment) { - squashfs_cache_put(msblk->fragment_cache, fragment); + squashfs3_cache_put(msblk->fragment_cache, fragment); } @@ -583,11 +583,11 @@ struct squashfs3_cache_entry *get_cached_fragment(struct super_block *s, { struct squashfs3_sb_info *msblk = s->s_fs_info; - return squashfs_cache_get(s, msblk->fragment_cache, start_block, length); + return squashfs3_cache_get(s, msblk->fragment_cache, start_block, length); } -static void squashfs_new_inode(struct squashfs3_sb_info *msblk, struct inode *i, +static void squashfs3_new_inode(struct squashfs3_sb_info *msblk, struct inode *i, struct squashfs3_base_inode_header *inodeb) { i->i_ino = inodeb->inode_number; @@ -605,14 +605,14 @@ static void squashfs_new_inode(struct squashfs3_sb_info *msblk, struct inode *i, } -static squashfs3_inode_t squashfs_inode_lookup(struct super_block *s, int ino) +static squashfs3_inode_t squashfs3_inode_lookup(struct super_block *s, int ino) { struct squashfs3_sb_info *msblk = s->s_fs_info; long long start = msblk->inode_lookup_table[SQUASHFS3_LOOKUP_BLOCK(ino - 1)]; int offset = SQUASHFS3_LOOKUP_BLOCK_OFFSET(ino - 1); squashfs3_inode_t inode; - TRACE("Entered squashfs_inode_lookup, inode_number = %d\n", ino); + TRACE("Entered squashfs3_inode_lookup, inode_number = %d\n", ino); if (msblk->swap) { squashfs3_inode_t sinode; @@ -625,7 +625,7 @@ static squashfs3_inode_t squashfs_inode_lookup(struct super_block *s, int ino) sizeof(inode), &start, &offset)) goto out; - TRACE("squashfs_inode_lookup, inode = 0x%llx\n", inode); + TRACE("squashfs3_inode_lookup, inode = 0x%llx\n", inode); return inode; @@ -651,15 +651,15 @@ static inline struct dentry *d_obtain_alias(struct inode *i) } #endif -static struct dentry *squashfs_export_iget(struct super_block *s, +static struct dentry *squashfs3_export_iget(struct super_block *s, unsigned int inode_number) { squashfs3_inode_t inode; struct dentry *dentry = ERR_PTR(-ENOENT); - TRACE("Entered squashfs_export_iget\n"); + TRACE("Entered squashfs3_export_iget\n"); - inode = squashfs_inode_lookup(s, inode_number); + inode = squashfs3_inode_lookup(s, inode_number); if(inode != SQUASHFS3_INVALID_BLK) dentry = d_obtain_alias(squashfs3_iget(s, inode, inode_number)); @@ -667,34 +667,34 @@ static struct dentry *squashfs_export_iget(struct super_block *s, } -static struct dentry *squashfs_fh_to_dentry(struct super_block *s, +static struct dentry *squashfs3_fh_to_dentry(struct super_block *s, struct fid *fid, int fh_len, int fh_type) { if((fh_type != FILEID_INO32_GEN && fh_type != FILEID_INO32_GEN_PARENT) || fh_len < 2) return NULL; - return squashfs_export_iget(s, fid->i32.ino); + return squashfs3_export_iget(s, fid->i32.ino); } -static struct dentry *squashfs_fh_to_parent(struct super_block *s, +static struct dentry *squashfs3_fh_to_parent(struct super_block *s, struct fid *fid, int fh_len, int fh_type) { if(fh_type != FILEID_INO32_GEN_PARENT || fh_len < 4) return NULL; - return squashfs_export_iget(s, fid->i32.parent_ino); + return squashfs3_export_iget(s, fid->i32.parent_ino); } -static struct dentry *squashfs_get_parent(struct dentry *child) +static struct dentry *squashfs3_get_parent(struct dentry *child) { struct inode *i = child->d_inode; - TRACE("Entered squashfs_get_parent\n"); + TRACE("Entered squashfs3_get_parent\n"); - return squashfs_export_iget(i->i_sb, SQUASHFS3_I(i)->u.s2.parent_inode); + return squashfs3_export_iget(i->i_sb, SQUASHFS3_I(i)->u.s2.parent_inode); } @@ -715,7 +715,7 @@ SQSH_EXTERN struct inode *squashfs3_iget(struct super_block *s, } -static int squashfs_read_inode(struct inode *i, squashfs3_inode_t inode) +static int squashfs3_read_inode(struct inode *i, squashfs3_inode_t inode) { struct super_block *s = i->i_sb; struct squashfs3_sb_info *msblk = s->s_fs_info; @@ -727,7 +727,7 @@ static int squashfs_read_inode(struct inode *i, squashfs3_inode_t inode) union squashfs3_inode_header id, sid; struct squashfs3_base_inode_header *inodeb = &id.base, *sinodeb = &sid.base; - TRACE("Entered squashfs_read_inode\n"); + TRACE("Entered squashfs3_read_inode\n"); if (msblk->swap) { if (!squashfs3_get_cached_block(s, sinodeb, block, offset, @@ -739,7 +739,7 @@ static int squashfs_read_inode(struct inode *i, squashfs3_inode_t inode) sizeof(*inodeb), &next_block, &next_offset)) goto failed_read; - squashfs_new_inode(msblk, i, inodeb); + squashfs3_new_inode(msblk, i, inodeb); switch(inodeb->inode_type) { case SQUASHFS3_FILE_TYPE: { @@ -845,7 +845,7 @@ static int squashfs_read_inode(struct inode *i, squashfs3_inode_t inode) i->i_nlink = inodep->nlink; i->i_size = inodep->file_size; i->i_op = &squashfs3_dir_inode_ops; - i->i_fop = &squashfs_dir_ops; + i->i_fop = &squashfs3_dir_ops; i->i_mode |= S_IFDIR; SQUASHFS3_I(i)->start_block = inodep->start_block; SQUASHFS3_I(i)->offset = inodep->offset; @@ -875,7 +875,7 @@ static int squashfs_read_inode(struct inode *i, squashfs3_inode_t inode) i->i_nlink = inodep->nlink; i->i_size = inodep->file_size; i->i_op = &squashfs3_dir_inode_ops; - i->i_fop = &squashfs_dir_ops; + i->i_fop = &squashfs3_dir_ops; i->i_mode |= S_IFDIR; SQUASHFS3_I(i)->start_block = inodep->start_block; SQUASHFS3_I(i)->offset = inodep->offset; @@ -1055,11 +1055,11 @@ static int read_fragment_index_table(struct super_block *s) } -static int supported_squashfs_filesystem(struct squashfs3_sb_info *msblk, int silent) +static int supported_squashfs3_filesystem(struct squashfs3_sb_info *msblk, int silent) { struct squashfs3_super_block *sblk = &msblk->sblk; - msblk->read_inode = squashfs_read_inode; + msblk->read_inode = squashfs3_read_inode; msblk->read_blocklist = read_blocklist; msblk->read_fragment_index_table = read_fragment_index_table; @@ -1089,14 +1089,14 @@ static int supported_squashfs_filesystem(struct squashfs3_sb_info *msblk, int si } -static int squashfs_fill_super(struct super_block *s, void *data, int silent) +static int squashfs3_fill_super(struct super_block *s, void *data, int silent) { struct squashfs3_sb_info *msblk; struct squashfs3_super_block *sblk; char b[BDEVNAME_SIZE]; struct inode *root; - TRACE("Entered squashfs_fill_superblock\n"); + TRACE("Entered squashfs3_fill_superblock\n"); s->s_fs_info = kzalloc(sizeof(struct squashfs3_sb_info), GFP_KERNEL); if (s->s_fs_info == NULL) { @@ -1149,7 +1149,7 @@ static int squashfs_fill_super(struct super_block *s, void *data, int silent) } /* Check the MAJOR & MINOR versions */ - if(!supported_squashfs_filesystem(msblk, silent)) + if(!supported_squashfs3_filesystem(msblk, silent)) goto failed_mount; /* Check the filesystem does not extend beyond the end of the @@ -1183,9 +1183,9 @@ static int squashfs_fill_super(struct super_block *s, void *data, int silent) s->s_maxbytes = MAX_LFS_FILESIZE; s->s_flags |= MS_RDONLY; - s->s_op = &squashfs_super_ops; + s->s_op = &squashfs3_super_ops; - msblk->block_cache = squashfs_cache_init("metadata", SQUASHFS3_CACHED_BLKS, + msblk->block_cache = squashfs3_cache_init("metadata", SQUASHFS3_CACHED_BLKS, SQUASHFS3_METADATA_SIZE, 0); if (msblk->block_cache == NULL) goto failed_mount; @@ -1232,7 +1232,7 @@ static int squashfs_fill_super(struct super_block *s, void *data, int silent) if (sblk->s_major == 1 && squashfs3_1_0_supported(msblk)) goto allocate_root; - msblk->fragment_cache = squashfs_cache_init("fragment", + msblk->fragment_cache = squashfs3_cache_init("fragment", SQUASHFS3_CACHED_FRAGMENTS, sblk->block_size, 1); if (msblk->fragment_cache == NULL) goto failed_mount; @@ -1248,7 +1248,7 @@ static int squashfs_fill_super(struct super_block *s, void *data, int silent) if (read_inode_lookup_table(s) == 0) goto failed_mount; - s->s_export_op = &squashfs_export_ops; + s->s_export_op = &squashfs3_export_ops; allocate_root: root = new_inode(s); @@ -1263,16 +1263,16 @@ allocate_root: goto failed_mount; } - TRACE("Leaving squashfs_fill_super\n"); + TRACE("Leaving squashfs3_fill_super\n"); return 0; failed_mount: kfree(msblk->inode_lookup_table); kfree(msblk->fragment_index); - squashfs_cache_delete(msblk->fragment_cache); + squashfs3_cache_delete(msblk->fragment_cache); kfree(msblk->uid); vfree(msblk->read_page); - squashfs_cache_delete(msblk->block_cache); + squashfs3_cache_delete(msblk->block_cache); kfree(msblk->fragment_index_2); vfree(msblk->stream.workspace); kfree(s->s_fs_info); @@ -1284,12 +1284,12 @@ failure: } -static int squashfs_statfs(struct dentry *dentry, struct kstatfs *buf) +static int squashfs3_statfs(struct dentry *dentry, struct kstatfs *buf) { struct squashfs3_sb_info *msblk = dentry->d_sb->s_fs_info; struct squashfs3_super_block *sblk = &msblk->sblk; - TRACE("Entered squashfs_statfs\n"); + TRACE("Entered squashfs3_statfs\n"); buf->f_type = SQUASHFS3_MAGIC; buf->f_bsize = sblk->block_size; @@ -1303,7 +1303,7 @@ static int squashfs_statfs(struct dentry *dentry, struct kstatfs *buf) } -static int squashfs_symlink_readpage(struct file *file, struct page *page) +static int squashfs3_symlink_readpage(struct file *file, struct page *page) { struct inode *inode = page->mapping->host; int index = page->index << PAGE_CACHE_SHIFT, length, bytes, avail_bytes; @@ -1311,7 +1311,7 @@ static int squashfs_symlink_readpage(struct file *file, struct page *page) int offset = SQUASHFS3_I(inode)->offset; void *pageaddr = kmap(page); - TRACE("Entered squashfs_symlink_readpage, page index %ld, start block " + TRACE("Entered squashfs3_symlink_readpage, page index %ld, start block " "%llx, offset %x\n", page->index, SQUASHFS3_I(inode)->start_block, SQUASHFS3_I(inode)->offset); @@ -1326,7 +1326,7 @@ static int squashfs_symlink_readpage(struct file *file, struct page *page) } if (length != index) { - ERROR("(squashfs_symlink_readpage) length != index\n"); + ERROR("(squashfs3_symlink_readpage) length != index\n"); bytes = 0; goto skip_read; } @@ -1613,7 +1613,7 @@ failure: } -static int squashfs_readpage(struct file *file, struct page *page) +static int squashfs3_readpage(struct file *file, struct page *page) { struct inode *inode = page->mapping->host; struct squashfs3_sb_info *msblk = inode->i_sb->s_fs_info; @@ -1633,7 +1633,7 @@ static int squashfs_readpage(struct file *file, struct page *page) int file_end = i_size_read(inode) >> sblk->block_log; int sparse = 0; - TRACE("Entered squashfs_readpage, page index %lx, start block %llx\n", + TRACE("Entered squashfs3_readpage, page index %lx, start block %llx\n", page->index, SQUASHFS3_I(inode)->start_block); if (page->index >= ((i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> @@ -1836,7 +1836,7 @@ failure: } -static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir) +static int squashfs3_readdir(struct file *file, void *dirent, filldir_t filldir) { struct inode *i = file->f_dentry->d_inode; struct squashfs3_sb_info *msblk = i->i_sb->s_fs_info; @@ -1847,7 +1847,7 @@ static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir) struct squashfs3_dir_header dirh; struct squashfs3_dir_entry *dire; - TRACE("Entered squashfs_readdir [%llx:%x]\n", next_block, next_offset); + TRACE("Entered squashfs3_readdir [%llx:%x]\n", next_block, next_offset); dire = kmalloc(sizeof(struct squashfs3_dir_entry) + SQUASHFS3_NAME_LEN + 1, GFP_KERNEL); @@ -1871,10 +1871,10 @@ static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir) } TRACE("Calling filldir(%x, %s, %d, %d, %d, %d)\n", (unsigned int) dirent, name, size, (int) - file->f_pos, i_ino, squashfs_filetype_table[1]); + file->f_pos, i_ino, squashfs3_filetype_table[1]); if (filldir(dirent, name, size, file->f_pos, i_ino, - squashfs_filetype_table[1]) < 0) { + squashfs3_filetype_table[1]) < 0) { TRACE("Filldir returned less than 0\n"); goto finish; } @@ -1938,11 +1938,11 @@ static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir) (unsigned int) dirent, dire->name, dire->size + 1, (int) file->f_pos, dirh.start_block, dire->offset, dirh.inode_number + dire->inode_number, - squashfs_filetype_table[dire->type]); + squashfs3_filetype_table[dire->type]); if (filldir(dirent, dire->name, dire->size + 1, file->f_pos, dirh.inode_number + dire->inode_number, - squashfs_filetype_table[dire->type]) < 0) { + squashfs3_filetype_table[dire->type]) < 0) { TRACE("Filldir returned less than 0\n"); goto finish; } @@ -1962,7 +1962,7 @@ failed_read: } -static struct dentry *squashfs_lookup(struct inode *i, struct dentry *dentry, +static struct dentry *squashfs3_lookup(struct inode *i, struct dentry *dentry, struct nameidata *nd) { const unsigned char *name = dentry->d_name.name; @@ -1976,7 +1976,7 @@ static struct dentry *squashfs_lookup(struct inode *i, struct dentry *dentry, struct squashfs3_dir_header dirh; struct squashfs3_dir_entry *dire; - TRACE("Entered squashfs_lookup [%llx:%x]\n", next_block, next_offset); + TRACE("Entered squashfs3_lookup [%llx:%x]\n", next_block, next_offset); dire = kmalloc(sizeof(struct squashfs3_dir_entry) + SQUASHFS3_NAME_LEN + 1, GFP_KERNEL); @@ -2067,19 +2067,19 @@ failed_read: } -static int squashfs_remount(struct super_block *s, int *flags, char *data) +static int squashfs3_remount(struct super_block *s, int *flags, char *data) { *flags |= MS_RDONLY; return 0; } -static void squashfs_put_super(struct super_block *s) +static void squashfs3_put_super(struct super_block *s) { if (s->s_fs_info) { struct squashfs3_sb_info *sbi = s->s_fs_info; - squashfs_cache_delete(sbi->block_cache); - squashfs_cache_delete(sbi->fragment_cache); + squashfs3_cache_delete(sbi->block_cache); + squashfs3_cache_delete(sbi->fragment_cache); vfree(sbi->read_page); kfree(sbi->uid); kfree(sbi->fragment_index); @@ -2092,15 +2092,15 @@ static void squashfs_put_super(struct super_block *s) } -static int squashfs_get_sb(struct file_system_type *fs_type, int flags, +static int squashfs3_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data, struct vfsmount *mnt) { - return get_sb_bdev(fs_type, flags, dev_name, data, squashfs_fill_super, + return get_sb_bdev(fs_type, flags, dev_name, data, squashfs3_fill_super, mnt); } -static int __init init_squashfs_fs(void) +static int __init init_squashfs3_fs(void) { int err = init_inodecache(); if (err) @@ -2109,7 +2109,7 @@ static int __init init_squashfs_fs(void) printk(KERN_INFO "squashfs: version 3.4 (2008/08/26) " "Phillip Lougher\n"); - err = register_filesystem(&squashfs_fs_type); + err = register_filesystem(&squashfs3_fs_type); if (err) destroy_inodecache(); @@ -2118,27 +2118,27 @@ out: } -static void __exit exit_squashfs_fs(void) +static void __exit exit_squashfs3_fs(void) { - unregister_filesystem(&squashfs_fs_type); + unregister_filesystem(&squashfs3_fs_type); destroy_inodecache(); } -static struct kmem_cache * squashfs_inode_cachep; +static struct kmem_cache * squashfs3_inode_cachep; -static struct inode *squashfs_alloc_inode(struct super_block *sb) +static struct inode *squashfs3_alloc_inode(struct super_block *sb) { struct squashfs3_inode_info *ei; - ei = kmem_cache_alloc(squashfs_inode_cachep, GFP_KERNEL); + ei = kmem_cache_alloc(squashfs3_inode_cachep, GFP_KERNEL); return ei ? &ei->vfs_inode : NULL; } -static void squashfs_destroy_inode(struct inode *inode) +static void squashfs3_destroy_inode(struct inode *inode) { - kmem_cache_free(squashfs_inode_cachep, SQUASHFS3_I(inode)); + kmem_cache_free(squashfs3_inode_cachep, SQUASHFS3_I(inode)); } @@ -2152,10 +2152,10 @@ static void init_once(void *foo) static int __init init_inodecache(void) { - squashfs_inode_cachep = kmem_cache_create("squashfs_inode_cache", + squashfs3_inode_cachep = kmem_cache_create("squashfs3_inode_cache", sizeof(struct squashfs3_inode_info), 0, SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT, init_once); - if (squashfs_inode_cachep == NULL) + if (squashfs3_inode_cachep == NULL) return -ENOMEM; return 0; } @@ -2163,12 +2163,12 @@ static int __init init_inodecache(void) static void destroy_inodecache(void) { - kmem_cache_destroy(squashfs_inode_cachep); + kmem_cache_destroy(squashfs3_inode_cachep); } -module_init(init_squashfs_fs); -module_exit(exit_squashfs_fs); +module_init(init_squashfs3_fs); +module_exit(exit_squashfs3_fs); MODULE_DESCRIPTION("squashfs 3.4, a compressed read-only filesystem"); MODULE_AUTHOR("Phillip Lougher "); MODULE_LICENSE("GPL"); diff --git a/fs/squashfs3/squashfs2_0.c b/fs/squashfs3/squashfs2_0.c index 0cc9b7a..e7e2bed 100644 --- a/fs/squashfs3/squashfs2_0.c +++ b/fs/squashfs3/squashfs2_0.c @@ -29,20 +29,20 @@ #include #include "squashfs3.h" -static int squashfs_readdir_2(struct file *file, void *dirent, filldir_t filldir); -static struct dentry *squashfs_lookup_2(struct inode *, struct dentry *, +static int squashfs3_readdir_2(struct file *file, void *dirent, filldir_t filldir); +static struct dentry *squashfs3_lookup_2(struct inode *, struct dentry *, struct nameidata *); -static struct file_operations squashfs_dir_ops_2 = { +static struct file_operations squashfs3_dir_ops_2 = { .read = generic_read_dir, - .readdir = squashfs_readdir_2 + .readdir = squashfs3_readdir_2 }; static struct inode_operations squashfs3_dir_inode_ops_2 = { - .lookup = squashfs_lookup_2 + .lookup = squashfs3_lookup_2 }; -static unsigned char squashfs_filetype_table[] = { +static unsigned char squashfs3_filetype_table[] = { DT_UNKNOWN, DT_DIR, DT_REG, DT_LNK, DT_BLK, DT_CHR, DT_FIFO, DT_SOCK }; @@ -120,7 +120,7 @@ out: } -static void squashfs_new_inode(struct squashfs3_sb_info *msblk, struct inode *i, +static void squashfs3_new_inode(struct squashfs3_sb_info *msblk, struct inode *i, struct squashfs3_base_inode_header_2 *inodeb, unsigned int ino) { struct squashfs3_super_block *sblk = &msblk->sblk; @@ -140,7 +140,7 @@ static void squashfs_new_inode(struct squashfs3_sb_info *msblk, struct inode *i, } -static int squashfs_read_inode_2(struct inode *i, squashfs3_inode_t inode) +static int squashfs3_read_inode_2(struct inode *i, squashfs3_inode_t inode) { struct super_block *s = i->i_sb; struct squashfs3_sb_info *msblk = s->s_fs_info; @@ -156,7 +156,7 @@ static int squashfs_read_inode_2(struct inode *i, squashfs3_inode_t inode) struct squashfs3_base_inode_header_2 *inodeb = &id.base, *sinodeb = &sid.base; - TRACE("Entered squashfs_read_inode_2\n"); + TRACE("Entered squashfs3_read_inode_2\n"); if (msblk->swap) { if (!squashfs3_get_cached_block(s, (char *) sinodeb, block, @@ -171,7 +171,7 @@ static int squashfs_read_inode_2(struct inode *i, squashfs3_inode_t inode) &next_offset)) goto failed_read; - squashfs_new_inode(msblk, i, inodeb, ino); + squashfs3_new_inode(msblk, i, inodeb, ino); switch(inodeb->inode_type) { case SQUASHFS3_FILE_TYPE: { @@ -242,7 +242,7 @@ static int squashfs_read_inode_2(struct inode *i, squashfs3_inode_t inode) i->i_size = inodep->file_size; i->i_op = &squashfs3_dir_inode_ops_2; - i->i_fop = &squashfs_dir_ops_2; + i->i_fop = &squashfs3_dir_ops_2; i->i_mode |= S_IFDIR; i->i_mtime.tv_sec = inodep->mtime; i->i_atime.tv_sec = inodep->mtime; @@ -279,7 +279,7 @@ static int squashfs_read_inode_2(struct inode *i, squashfs3_inode_t inode) i->i_size = inodep->file_size; i->i_op = &squashfs3_dir_inode_ops_2; - i->i_fop = &squashfs_dir_ops_2; + i->i_fop = &squashfs3_dir_ops_2; i->i_mode |= S_IFDIR; i->i_mtime.tv_sec = inodep->mtime; i->i_atime.tv_sec = inodep->mtime; @@ -494,7 +494,7 @@ failure: } -static int squashfs_readdir_2(struct file *file, void *dirent, filldir_t filldir) +static int squashfs3_readdir_2(struct file *file, void *dirent, filldir_t filldir) { struct inode *i = file->f_dentry->d_inode; struct squashfs3_sb_info *msblk = i->i_sb->s_fs_info; @@ -506,7 +506,7 @@ static int squashfs_readdir_2(struct file *file, void *dirent, filldir_t filldir struct squashfs3_dir_header_2 dirh; struct squashfs3_dir_entry_2 *dire; - TRACE("Entered squashfs_readdir_2 [%llx:%x]\n", next_block, next_offset); + TRACE("Entered squashfs3_readdir_2 [%llx:%x]\n", next_block, next_offset); if (!(dire = kmalloc(sizeof(struct squashfs3_dir_entry) + SQUASHFS3_NAME_LEN + 1, GFP_KERNEL))) { @@ -580,12 +580,12 @@ static int squashfs_readdir_2(struct file *file, void *dirent, filldir_t filldir (unsigned int) dirent, dire->name, dire->size + 1, (int) file->f_pos, dirh.start_block, dire->offset, - squashfs_filetype_table[dire->type]); + squashfs3_filetype_table[dire->type]); if (filldir(dirent, dire->name, dire->size + 1, file->f_pos, SQUASHFS3_MK_VFS_INODE( dirh.start_block, dire->offset), - squashfs_filetype_table[dire->type]) + squashfs3_filetype_table[dire->type]) < 0) { TRACE("Filldir returned less than 0\n"); goto finish; @@ -606,7 +606,7 @@ failed_read: } -static struct dentry *squashfs_lookup_2(struct inode *i, struct dentry *dentry, +static struct dentry *squashfs3_lookup_2(struct inode *i, struct dentry *dentry, struct nameidata *nd) { const unsigned char *name = dentry->d_name.name; @@ -622,7 +622,7 @@ static struct dentry *squashfs_lookup_2(struct inode *i, struct dentry *dentry, struct squashfs3_dir_entry_2 *dire; int sorted = sblk->s_major == 2 && sblk->s_minor >= 1; - TRACE("Entered squashfs_lookup_2 [%llx:%x]\n", next_block, next_offset); + TRACE("Entered squashfs3_lookup_2 [%llx:%x]\n", next_block, next_offset); if (!(dire = kmalloc(sizeof(struct squashfs3_dir_entry) + SQUASHFS3_NAME_LEN + 1, GFP_KERNEL))) { @@ -726,7 +726,7 @@ int squashfs3_2_0_supported(struct squashfs3_sb_info *msblk) { struct squashfs3_super_block *sblk = &msblk->sblk; - msblk->read_inode = squashfs_read_inode_2; + msblk->read_inode = squashfs3_read_inode_2; msblk->read_fragment_index_table = read_fragment_index_table_2; sblk->bytes_used = sblk->bytes_used_2; diff --git a/include/linux/squashfs3_fs.h b/include/linux/squashfs3_fs.h index a97297e..a2544ab 100644 --- a/include/linux/squashfs3_fs.h +++ b/include/linux/squashfs3_fs.h @@ -357,10 +357,6 @@ struct squashfs3_fragment_entry { unsigned int unused; } __attribute__ ((packed)); -extern int squashfs_uncompress_block(void *d, int dstlen, void *s, int srclen); -extern int squashfs_uncompress_init(void); -extern int squashfs_uncompress_exit(void); - /* * macros to convert each packed bitfield structure from little endian to big * endian and vice versa. These are needed when creating or using a filesystem -- 1.6.4.4