wok diff squashfs/stuff/squashfs-patch-2.6.25 @ rev 2949
Up: enlightenment-pam (0.16.999.060)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri May 08 09:43:18 2009 +0200 (2009-05-08) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/squashfs/stuff/squashfs-patch-2.6.25 Fri May 08 09:43:18 2009 +0200 1.3 @@ -0,0 +1,161 @@ 1.4 +diff -x .gitignore -Nurp linux-2.6.25-rc7.orig/fs/squashfs/inode.c linux-2.6.25-rc7.new/fs/squashfs/inode.c 1.5 +--- linux-2.6.25-rc7.orig/fs/squashfs/inode.c 2008-04-05 00:19:09.000000000 +0100 1.6 ++++ linux-2.6.25-rc7.new/fs/squashfs/inode.c 2008-04-05 00:22:44.000000000 +0100 1.7 +@@ -1,7 +1,7 @@ 1.8 + /* 1.9 + * Squashfs - a compressed read only filesystem for Linux 1.10 + * 1.11 +- * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 1.12 ++ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 1.13 + * Phillip Lougher <phillip@lougher.demon.co.uk> 1.14 + * 1.15 + * This program is free software; you can redistribute it and/or 1.16 +@@ -37,7 +37,10 @@ 1.17 + 1.18 + int squashfs_cached_blks; 1.19 + 1.20 +-static void vfs_read_inode(struct inode *i); 1.21 ++static struct dentry *squashfs_fh_to_dentry(struct super_block *s, 1.22 ++ struct fid *fid, int fh_len, int fh_type); 1.23 ++static struct dentry *squashfs_fh_to_parent(struct super_block *s, 1.24 ++ struct fid *fid, int fh_len, int fh_type); 1.25 + static struct dentry *squashfs_get_parent(struct dentry *child); 1.26 + static int squashfs_read_inode(struct inode *i, squashfs_inode_t inode); 1.27 + static int squashfs_statfs(struct dentry *, struct kstatfs *); 1.28 +@@ -78,15 +81,9 @@ static struct super_operations squashfs_ 1.29 + .remount_fs = squashfs_remount 1.30 + }; 1.31 + 1.32 +-static struct super_operations squashfs_export_super_ops = { 1.33 +- .alloc_inode = squashfs_alloc_inode, 1.34 +- .destroy_inode = squashfs_destroy_inode, 1.35 +- .statfs = squashfs_statfs, 1.36 +- .put_super = squashfs_put_super, 1.37 +- .read_inode = vfs_read_inode 1.38 +-}; 1.39 +- 1.40 + static struct export_operations squashfs_export_ops = { 1.41 ++ .fh_to_dentry = squashfs_fh_to_dentry, 1.42 ++ .fh_to_parent = squashfs_fh_to_parent, 1.43 + .get_parent = squashfs_get_parent 1.44 + }; 1.45 + 1.46 +@@ -630,42 +627,72 @@ static squashfs_inode_t squashfs_inode_l 1.47 + out: 1.48 + return SQUASHFS_INVALID_BLK; 1.49 + } 1.50 +- 1.51 + 1.52 +-static void vfs_read_inode(struct inode *i) 1.53 ++ 1.54 ++ 1.55 ++static struct dentry *squashfs_export_iget(struct super_block *s, 1.56 ++ unsigned int inode_number) 1.57 + { 1.58 +- struct squashfs_sb_info *msblk = i->i_sb->s_fs_info; 1.59 +- squashfs_inode_t inode = squashfs_inode_lookup(i->i_sb, i->i_ino); 1.60 ++ squashfs_inode_t inode; 1.61 ++ struct inode *i; 1.62 ++ struct dentry *dentry; 1.63 + 1.64 +- TRACE("Entered vfs_read_inode\n"); 1.65 ++ TRACE("Entered squashfs_export_iget\n"); 1.66 + 1.67 +- if(inode != SQUASHFS_INVALID_BLK) 1.68 +- (msblk->read_inode)(i, inode); 1.69 ++ inode = squashfs_inode_lookup(s, inode_number); 1.70 ++ if(inode == SQUASHFS_INVALID_BLK) { 1.71 ++ dentry = ERR_PTR(-ENOENT); 1.72 ++ goto failure; 1.73 ++ } 1.74 ++ 1.75 ++ i = squashfs_iget(s, inode, inode_number); 1.76 ++ if(i == NULL) { 1.77 ++ dentry = ERR_PTR(-EACCES); 1.78 ++ goto failure; 1.79 ++ } 1.80 ++ 1.81 ++ dentry = d_alloc_anon(i); 1.82 ++ if (dentry == NULL) { 1.83 ++ iput(i); 1.84 ++ dentry = ERR_PTR(-ENOMEM); 1.85 ++ } 1.86 ++ 1.87 ++failure: 1.88 ++ return dentry; 1.89 ++} 1.90 ++ 1.91 ++ 1.92 ++static struct dentry *squashfs_fh_to_dentry(struct super_block *s, 1.93 ++ struct fid *fid, int fh_len, int fh_type) 1.94 ++{ 1.95 ++ if((fh_type != FILEID_INO32_GEN && fh_type != FILEID_INO32_GEN_PARENT) || 1.96 ++ fh_len < 2) 1.97 ++ return NULL; 1.98 ++ 1.99 ++ return squashfs_export_iget(s, fid->i32.ino); 1.100 ++} 1.101 ++ 1.102 ++ 1.103 ++static struct dentry *squashfs_fh_to_parent(struct super_block *s, 1.104 ++ struct fid *fid, int fh_len, int fh_type) 1.105 ++{ 1.106 ++ if(fh_type != FILEID_INO32_GEN_PARENT || fh_len < 4) 1.107 ++ return NULL; 1.108 ++ 1.109 ++ return squashfs_export_iget(s, fid->i32.parent_ino); 1.110 + } 1.111 + 1.112 + 1.113 + static struct dentry *squashfs_get_parent(struct dentry *child) 1.114 + { 1.115 + struct inode *i = child->d_inode; 1.116 +- struct inode *parent = iget(i->i_sb, SQUASHFS_I(i)->u.s2.parent_inode); 1.117 +- struct dentry *rv; 1.118 + 1.119 + TRACE("Entered squashfs_get_parent\n"); 1.120 + 1.121 +- if(parent == NULL) { 1.122 +- rv = ERR_PTR(-EACCES); 1.123 +- goto out; 1.124 +- } 1.125 +- 1.126 +- rv = d_alloc_anon(parent); 1.127 +- if(rv == NULL) 1.128 +- rv = ERR_PTR(-ENOMEM); 1.129 +- 1.130 +-out: 1.131 +- return rv; 1.132 ++ return squashfs_export_iget(i->i_sb, SQUASHFS_I(i)->u.s2.parent_inode); 1.133 + } 1.134 + 1.135 +- 1.136 ++ 1.137 + SQSH_EXTERN struct inode *squashfs_iget(struct super_block *s, 1.138 + squashfs_inode_t inode, unsigned int inode_number) 1.139 + { 1.140 +@@ -1257,7 +1284,6 @@ static int squashfs_fill_super(struct su 1.141 + if (read_inode_lookup_table(s) == 0) 1.142 + goto failed_mount; 1.143 + 1.144 +- s->s_op = &squashfs_export_super_ops; 1.145 + s->s_export_op = &squashfs_export_ops; 1.146 + 1.147 + allocate_root: 1.148 +@@ -2124,7 +2150,7 @@ static int __init init_squashfs_fs(void) 1.149 + if (err) 1.150 + goto out; 1.151 + 1.152 +- printk(KERN_INFO "squashfs: version 3.3 (2007/10/31) " 1.153 ++ printk(KERN_INFO "squashfs: version 3.3-CVS (2008/04/04) " 1.154 + "Phillip Lougher\n"); 1.155 + 1.156 + err = register_filesystem(&squashfs_fs_type); 1.157 +@@ -2187,6 +2213,6 @@ static void destroy_inodecache(void) 1.158 + 1.159 + module_init(init_squashfs_fs); 1.160 + module_exit(exit_squashfs_fs); 1.161 +-MODULE_DESCRIPTION("squashfs 3.2-r2-CVS, a compressed read-only filesystem"); 1.162 ++MODULE_DESCRIPTION("squashfs 3.3, a compressed read-only filesystem"); 1.163 + MODULE_AUTHOR("Phillip Lougher <phillip@lougher.demon.co.uk>"); 1.164 + MODULE_LICENSE("GPL");