wok rev 235

Add: shfs
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 17 10:53:05 2008 +0100 (2008-02-17)
parents 0c00fe2eff1a
children 6f0f8c0fbedc
files shfs/receipt shfs/stuff/shfs-0.35-2.6.24.2.u
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/shfs/receipt	Sun Feb 17 10:53:05 2008 +0100
     1.3 @@ -0,0 +1,49 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="shfs"
     1.7 +VERSION="0.35"
     1.8 +CATEGORY="network"
     1.9 +SHORT_DESC="(secure) SHell FileSystem Linux kernel module and userland tool."
    1.10 +MAINTAINER="pascal.bellard@ads-lu.com"
    1.11 +TARBALL="shfs-$VERSION.tar.gz"
    1.12 +WEB_SITE="http://$PACKAGE.sourceforge.net/"
    1.13 +WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
    1.14 +WANTED="linux"
    1.15 +DEPENDS="dropbear"
    1.16 +BUILD_DEPENDS="perl"
    1.17 +
    1.18 +# Rules to configure and make the package.
    1.19 +compile_rules()
    1.20 +{
    1.21 +	local kver
    1.22 +	kver=$(grep "kernel version" ../linux/linux-*/.config)
    1.23 +	kver=${kver##* }
    1.24 +	cd $PACKAGE-$VERSION
    1.25 +	patch -p0 < ../stuff/$PACKAGE-$VERSION-$kver.u
    1.26 +	while read subs ; do
    1.27 +		perl -pi -e "$subs" Makefile
    1.28 +	done << EOF
    1.29 +s,^KERNEL=.*,KERNEL=$kver,
    1.30 +s,^KERNEL_SOURCES=.*,KERNEL_SOURCES=$(cd ../../linux/linux-$kver* ; pwd),
    1.31 +s,^ROOT=.*,ROOT=$(pwd)/_pkg,
    1.32 +EOF
    1.33 +	make 
    1.34 +	mkdir -p _pkg/lib/modules/$kver-slitaz/kernel/fs/shfs/ _pkg/usr/bin
    1.35 +	cp shfs/Linux-2.6/shfs.ko _pkg/lib/modules/$kver-slitaz/kernel/fs/shfs/
    1.36 +	cp shfsmount/shfsmount _pkg/usr/bin
    1.37 +}
    1.38 +
    1.39 +
    1.40 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.41 +genpkg_rules()
    1.42 +{
    1.43 +	cp -a $PACKAGE-$VERSION/_pkg/* $fs
    1.44 +	strip -s $fs/usr/bin/*
    1.45 +}
    1.46 +
    1.47 +# Pre and post install commands for Tazpkg.
    1.48 +post_install()
    1.49 +{
    1.50 +	depmod -a
    1.51 +}
    1.52 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/shfs/stuff/shfs-0.35-2.6.24.2.u	Sun Feb 17 10:53:05 2008 +0100
     2.3 @@ -0,0 +1,437 @@
     2.4 +--- shfs/Linux-2.6/dcache.c
     2.5 ++++ shfs/Linux-2.6/dcache.c
     2.6 +@@ -68,7 +68,7 @@ shfs_invalidate_dircache_entries(struct 
     2.7 + 	spin_lock(&dcache_lock);
     2.8 + 	next = parent->d_subdirs.next;
     2.9 + 	while (next != &parent->d_subdirs) {
    2.10 +-		dentry = list_entry(next, struct dentry, d_child);
    2.11 ++		dentry = list_entry(next, struct dentry, d_u.d_child);
    2.12 + 		dentry->d_fsdata = NULL;
    2.13 + 		shfs_age_dentry(info, dentry);
    2.14 + 		next = next->next;
    2.15 +@@ -101,7 +101,7 @@ shfs_dget_fpos(struct dentry *dentry, st
    2.16 + 	spin_lock(&dcache_lock);
    2.17 + 	next = parent->d_subdirs.next;
    2.18 + 	while (next != &parent->d_subdirs) {
    2.19 +-		dent = list_entry(next, struct dentry, d_child);
    2.20 ++		dent = list_entry(next, struct dentry, d_u.d_child);
    2.21 + 		if ((unsigned long)dent->d_fsdata == fpos) {
    2.22 + 			if (dent->d_inode)
    2.23 + 				dget_locked(dent);
    2.24 +--- shfs/Linux-2.6/dir.c
    2.25 ++++ shfs/Linux-2.6/dir.c
    2.26 +@@ -300,8 +300,8 @@ shfs_create(struct inode* dir, struct de
    2.27 + 	
    2.28 + 	shfs_invalid_dir_cache(dir);
    2.29 + 	result = shfs_instantiate(dentry);
    2.30 +-	if (forced_write && dentry->d_inode && dentry->d_inode->u.generic_ip)
    2.31 +-		((struct shfs_inode_info *)dentry->d_inode->u.generic_ip)->unset_write_on_close = 1;
    2.32 ++	if (forced_write && dentry->d_inode && dentry->d_inode->i_private)
    2.33 ++		((struct shfs_inode_info *)dentry->d_inode->i_private)->unset_write_on_close = 1;
    2.34 + 	return result;
    2.35 + }
    2.36 + 
    2.37 +@@ -488,7 +488,7 @@ shfs_d_delete(struct dentry *dentry)
    2.38 + 	return 0;
    2.39 + }
    2.40 + 
    2.41 +-static struct dentry_operations shfs_dentry_operations = {
    2.42 ++struct dentry_operations shfs_dentry_operations = {
    2.43 + 	.d_revalidate	= shfs_d_revalidate,
    2.44 + 	.d_delete 	= shfs_d_delete,
    2.45 + };
    2.46 +--- shfs/Linux-2.6/fcache.c
    2.47 ++++ shfs/Linux-2.6/fcache.c
    2.48 +@@ -29,12 +29,12 @@ struct shfs_file {
    2.49 + 	char          	*data;
    2.50 + };
    2.51 + 
    2.52 +-kmem_cache_t	*file_cache = NULL;
    2.53 ++struct kmem_cache	*file_cache = NULL;
    2.54 + 
    2.55 + void
    2.56 + fcache_init(void)
    2.57 + {
    2.58 +-	file_cache = kmem_cache_create("shfs_file", sizeof(struct shfs_file), 0, 0, NULL, NULL);
    2.59 ++	file_cache = kmem_cache_create("shfs_file", sizeof(struct shfs_file), 0, 0, NULL);
    2.60 + 	DEBUG("file_cache: %p\n", file_cache);
    2.61 + }
    2.62 + 
    2.63 +@@ -100,7 +100,7 @@ fcache_file_open(struct file *f)
    2.64 + 		VERBOSE("dir in file cache?\n");
    2.65 + 		return -EINVAL;
    2.66 + 	}
    2.67 +-	p = (struct shfs_inode_info *)inode->u.generic_ip;
    2.68 ++	p = (struct shfs_inode_info *)inode->i_private;
    2.69 + 	if (!p) {
    2.70 + 		VERBOSE("inode without info\n");
    2.71 + 		return -EINVAL;
    2.72 +@@ -127,7 +127,7 @@ fcache_file_sync(struct file *f)
    2.73 + 		VERBOSE("dir in file cache?\n");
    2.74 + 		return -EINVAL;
    2.75 + 	}
    2.76 +-	p = (struct shfs_inode_info *)inode->u.generic_ip;
    2.77 ++	p = (struct shfs_inode_info *)inode->i_private;
    2.78 + 	if (!p) {
    2.79 + 		VERBOSE("inode without info\n");
    2.80 + 		return -EINVAL;
    2.81 +@@ -160,7 +160,7 @@ fcache_file_close(struct file *f)
    2.82 + 	if (result == 0) {
    2.83 + 		struct shfs_inode_info *p;
    2.84 + 
    2.85 +-		p = (struct shfs_inode_info *)f->f_dentry->d_inode->u.generic_ip;
    2.86 ++		p = (struct shfs_inode_info *)f->f_dentry->d_inode->i_private;
    2.87 + 		if (!p) {
    2.88 + 			VERBOSE("inode without info\n");
    2.89 + 			return -EINVAL;
    2.90 +@@ -184,7 +184,7 @@ fcache_file_clear(struct inode *inode)
    2.91 + 		return -EINVAL;
    2.92 + 	}
    2.93 + 	DEBUG("ino: %lu\n", inode->i_ino);
    2.94 +-	p = (struct shfs_inode_info *)inode->u.generic_ip;
    2.95 ++	p = (struct shfs_inode_info *)inode->i_private;
    2.96 + 	if (!p) {
    2.97 + 		VERBOSE("inode without info\n");
    2.98 + 		return -EINVAL;
    2.99 +@@ -226,7 +226,7 @@ fcache_file_read(struct file *f, unsigne
   2.100 + 		VERBOSE("dir in file cache?\n");
   2.101 + 		return -EINVAL;
   2.102 + 	}
   2.103 +-	p = (struct shfs_inode_info *)inode->u.generic_ip;
   2.104 ++	p = (struct shfs_inode_info *)inode->i_private;
   2.105 + 	if (!p) {
   2.106 + 		VERBOSE("inode without info\n");
   2.107 + 		return -EINVAL;
   2.108 +@@ -327,7 +327,7 @@ fcache_file_write(struct file *f, unsign
   2.109 + 		VERBOSE("dir in file cache?\n");
   2.110 + 		return -EINVAL;
   2.111 + 	}
   2.112 +-	p = (struct shfs_inode_info *)inode->u.generic_ip;
   2.113 ++	p = (struct shfs_inode_info *)inode->i_private;
   2.114 + 	if (!p) {
   2.115 + 		VERBOSE("inode without info\n");
   2.116 + 		return -EINVAL;
   2.117 +--- shfs/Linux-2.6/file.c
   2.118 ++++ shfs/Linux-2.6/file.c
   2.119 +@@ -90,7 +90,7 @@ shfs_file_commitwrite(struct file *f, st
   2.120 + 	struct dentry *dentry = f->f_dentry;
   2.121 + 	struct shfs_sb_info *info = info_from_dentry(dentry);
   2.122 + 	struct inode *inode = p->mapping->host;
   2.123 +-	struct shfs_inode_info *i = (struct shfs_inode_info *)inode->u.generic_ip;
   2.124 ++	struct shfs_inode_info *i = (struct shfs_inode_info *)inode->i_private;
   2.125 + 	char *buffer = kmap(p) + offset;
   2.126 + 	int written = 0, result;
   2.127 + 	unsigned count = to - offset;
   2.128 +@@ -199,7 +199,7 @@ shfs_file_open(struct inode *inode, stru
   2.129 + }
   2.130 + 
   2.131 + static int
   2.132 +-shfs_file_flush(struct file *f)
   2.133 ++shfs_file_flush(struct file *f, fl_owner_t id)
   2.134 + {
   2.135 + 	struct dentry *dentry = f->f_dentry;
   2.136 + 	struct shfs_sb_info *info = info_from_dentry(dentry);
   2.137 +@@ -242,8 +242,8 @@ shfs_file_release(struct inode *inode, s
   2.138 + 		}
   2.139 + 	}
   2.140 + 	/* if file was forced to be writeable, change attrs back on close */
   2.141 +-	if (dentry->d_inode && dentry->d_inode->u.generic_ip) {
   2.142 +-		if  (((struct shfs_inode_info *)dentry->d_inode->u.generic_ip)->unset_write_on_close) {
   2.143 ++	if (dentry->d_inode && dentry->d_inode->i_private) {
   2.144 ++		if  (((struct shfs_inode_info *)dentry->d_inode->i_private)->unset_write_on_close) {
   2.145 + 			char name[SHFS_PATH_MAX];
   2.146 + 
   2.147 + 			if (get_name(dentry, name) < 0)
   2.148 +@@ -292,7 +292,9 @@ shfs_slow_read(struct file *f, char *buf
   2.149 + 		goto error;
   2.150 + 	}
   2.151 + 	if (result != 0) {
   2.152 +-		copy_to_user(buf, (char *)page, result);
   2.153 ++		if (copy_to_user(buf, (char *)page, result)) {
   2.154 ++			goto error;
   2.155 ++		}
   2.156 + 		*ppos += result;
   2.157 + 	}
   2.158 + error:
   2.159 +@@ -309,9 +311,9 @@ shfs_slow_write(struct file *f, const ch
   2.160 + 	int result;
   2.161 + 	
   2.162 + 	DEBUG("\n");
   2.163 +-	written = generic_file_write(f, buf, count, offset);
   2.164 ++	written = do_sync_write(f, buf, count, offset);
   2.165 + 	if (written > 0) {
   2.166 +-		result = shfs_file_flush(f);
   2.167 ++		result = shfs_file_flush(f, 0);
   2.168 + 		written = result < 0 ? result: written;
   2.169 + 	}
   2.170 + 	
   2.171 +@@ -320,8 +322,8 @@ shfs_slow_write(struct file *f, const ch
   2.172 + 
   2.173 + struct file_operations shfs_file_operations = {
   2.174 + 	.llseek		= generic_file_llseek,
   2.175 +-	.read		= generic_file_read,
   2.176 +-	.write		= generic_file_write,
   2.177 ++	.read		= do_sync_read,
   2.178 ++	.write		= do_sync_write,
   2.179 + 	.ioctl		= shfs_ioctl,
   2.180 + 	.mmap		= generic_file_mmap,
   2.181 + 	.open		= shfs_file_open,
   2.182 +--- shfs/Linux-2.6/inode.c
   2.183 ++++ shfs/Linux-2.6/inode.c
   2.184 +@@ -29,13 +29,13 @@ int debug_level;
   2.185 + 	unsigned long alloc;
   2.186 + #endif
   2.187 + 
   2.188 +-kmem_cache_t	*inode_cache = NULL;
   2.189 ++struct kmem_cache	*inode_cache = NULL;
   2.190 + 
   2.191 + void 
   2.192 + shfs_set_inode_attr(struct inode *inode, struct shfs_fattr *fattr)
   2.193 + {
   2.194 + 	struct shfs_sb_info *info = info_from_inode(inode);
   2.195 +-	struct shfs_inode_info *i = inode->u.generic_ip;
   2.196 ++	struct shfs_inode_info *i = inode->i_private;
   2.197 + 	struct timespec last_time = inode->i_mtime;
   2.198 + 	loff_t last_size = inode->i_size;
   2.199 + 
   2.200 +@@ -52,7 +52,8 @@ shfs_set_inode_attr(struct inode *inode,
   2.201 + 	inode->i_ctime	= fattr->f_ctime;
   2.202 + 	inode->i_atime	= fattr->f_atime;
   2.203 + 	inode->i_mtime	= fattr->f_mtime;
   2.204 +-	inode->i_blksize= fattr->f_blksize;
   2.205 ++	//inode->i_blksize= fattr->f_blksize;
   2.206 ++	inode->i_blkbits= 12; // 4K
   2.207 + 	inode->i_blocks	= fattr->f_blocks;
   2.208 + 	inode->i_size	= fattr->f_size;
   2.209 + 
   2.210 +@@ -60,7 +61,7 @@ shfs_set_inode_attr(struct inode *inode,
   2.211 + 
   2.212 + 	if (!timespec_equal(&inode->i_mtime, &last_time) || inode->i_size != last_size) {
   2.213 + 		DEBUG("inode changed (%ld/%ld, %lu/%lu)\n", inode->i_mtime.tv_sec, last_time.tv_sec, (unsigned long)inode->i_size, (unsigned long)last_size);
   2.214 +-		invalidate_inode_pages(inode->i_mapping);
   2.215 ++		invalidate_mapping_pages(inode->i_mapping, 0, ~0UL);
   2.216 + 		fcache_file_clear(inode);
   2.217 + 	}
   2.218 + }
   2.219 +@@ -75,7 +76,7 @@ shfs_iget(struct super_block *sb, struct
   2.220 + 	if (!inode)
   2.221 + 		return NULL;
   2.222 + 	inode->i_ino = fattr->f_ino;
   2.223 +-	i = inode->u.generic_ip = (struct shfs_inode_info *)KMEM_ALLOC("inode", inode_cache, GFP_KERNEL);
   2.224 ++	i = inode->i_private = (struct shfs_inode_info *)KMEM_ALLOC("inode", inode_cache, GFP_KERNEL);
   2.225 + 	if (!i)
   2.226 + 		return NULL;
   2.227 + 	i->cache = NULL;
   2.228 +@@ -107,7 +108,7 @@ shfs_delete_inode(struct inode *inode)
   2.229 + 	struct shfs_inode_info *i;
   2.230 + 
   2.231 + 	DEBUG("ino: %lu\n", inode->i_ino);
   2.232 +-	i = (struct shfs_inode_info *)inode->u.generic_ip;
   2.233 ++	i = (struct shfs_inode_info *)inode->i_private;
   2.234 + 	if (!i) {
   2.235 + 		VERBOSE("invalid inode\n");
   2.236 + 		goto out;
   2.237 +@@ -158,7 +159,7 @@ shfs_refresh_inode(struct dentry *dentry
   2.238 + 		 * But we do want to invalidate the caches ...
   2.239 + 		 */
   2.240 + 		if (!S_ISDIR(inode->i_mode))
   2.241 +-			invalidate_inode_pages(inode->i_mapping);
   2.242 ++			invalidate_mapping_pages(inode->i_mapping, 0, ~0UL);
   2.243 + 		else
   2.244 + 			shfs_invalid_dir_cache(inode);
   2.245 + 		result = -EIO;
   2.246 +@@ -172,7 +173,7 @@ shfs_revalidate_inode(struct dentry *den
   2.247 + {
   2.248 + 	struct shfs_sb_info *info = info_from_dentry(dentry);
   2.249 + 	struct inode *inode = dentry->d_inode;
   2.250 +-	struct shfs_inode_info *i = (struct shfs_inode_info *)inode->u.generic_ip;
   2.251 ++	struct shfs_inode_info *i = (struct shfs_inode_info *)inode->i_private;
   2.252 + 	int result;
   2.253 + 
   2.254 +         DEBUG("%s\n", dentry->d_name.name);
   2.255 +@@ -337,11 +338,11 @@ out:
   2.256 + 	return -EINVAL;
   2.257 + }
   2.258 + 
   2.259 +-static struct super_block *
   2.260 ++static int
   2.261 + shfs_get_sb(struct file_system_type *fs_type,
   2.262 +-	    int flags, const char *dev_name, void *data)
   2.263 ++	    int flags, const char *dev_name, void *data, struct vfsmount *mnt)
   2.264 + {
   2.265 +-	return get_sb_nodev(fs_type, flags, data, shfs_read_super);
   2.266 ++	return get_sb_nodev(fs_type, flags, data, shfs_read_super, mnt);
   2.267 + }
   2.268 + 
   2.269 + static struct file_system_type sh_fs_type = {
   2.270 +@@ -356,7 +357,7 @@ init_shfs(void)
   2.271 + {
   2.272 + 	printk(KERN_NOTICE "SHell File System, (c) 2002-2004 Miroslav Spousta\n");
   2.273 + 	fcache_init();
   2.274 +-	inode_cache = kmem_cache_create("shfs_inode", sizeof(struct shfs_inode_info), 0, 0, NULL, NULL);
   2.275 ++	inode_cache = kmem_cache_create("shfs_inode", sizeof(struct shfs_inode_info), 0, 0, NULL);
   2.276 + 	
   2.277 + 	debug_level = 0;
   2.278 + #ifdef ENABLE_DEBUG
   2.279 +--- shfs/Linux-2.6/proc.c
   2.280 ++++ shfs/Linux-2.6/proc.c
   2.281 +@@ -148,6 +148,7 @@ int
   2.282 + sock_write(struct shfs_sb_info *info, const void *buffer, int count)
   2.283 + {
   2.284 + 	struct file *f = info->sock;
   2.285 ++	struct kiocb kiocb;
   2.286 + 	mm_segment_t fs;
   2.287 + 	int c, result = 0;
   2.288 + 	unsigned long flags, sigpipe;
   2.289 +@@ -173,12 +174,13 @@ sock_write(struct shfs_sb_info *info, co
   2.290 + 	SIGRECALC;
   2.291 + 	SIGUNLOCK(flags);
   2.292 + 
   2.293 ++	init_sync_kiocb(&kiocb, f);
   2.294 + 	do {
   2.295 + 		struct iovec vec[1];
   2.296 + 
   2.297 + 		vec[0].iov_base = (void *)buffer;
   2.298 + 		vec[0].iov_len = c;
   2.299 +-		result = f->f_op->writev(f, (const struct iovec *) &vec, 1, &f->f_pos);
   2.300 ++		result = f->f_op->aio_write(&kiocb, (const struct iovec *) &vec, 1, f->f_pos);
   2.301 + 		if (result < 0) {
   2.302 + 			DEBUG("error: %d\n", result);
   2.303 + 			if (result == -EAGAIN)
   2.304 +@@ -218,6 +220,7 @@ int
   2.305 + sock_read(struct shfs_sb_info *info, void *buffer, int count)
   2.306 + {
   2.307 + 	struct file *f = info->sock;
   2.308 ++	struct kiocb kiocb;
   2.309 + 	mm_segment_t fs;
   2.310 + 	int c, result = 0;
   2.311 + 	unsigned long flags, sigpipe;
   2.312 +@@ -256,12 +259,13 @@ sock_read(struct shfs_sb_info *info, voi
   2.313 + 	fs = get_fs();
   2.314 + 	set_fs(get_ds());
   2.315 + 
   2.316 ++	init_sync_kiocb(&kiocb, f);
   2.317 + 	do {
   2.318 + 		struct iovec vec[1];
   2.319 + 
   2.320 + 		vec[0].iov_base = buffer;
   2.321 + 		vec[0].iov_len = c;
   2.322 +-		result = f->f_op->readv(f, (const struct iovec *)&vec, 1, &f->f_pos);
   2.323 ++		result = f->f_op->aio_read(&kiocb, (const struct iovec *) &vec, 1, f->f_pos);
   2.324 + 		if (!result) {
   2.325 + 			/*  peer has closed socket */
   2.326 + 			result = -EIO;
   2.327 +@@ -302,6 +306,7 @@ int 
   2.328 + sock_readln(struct shfs_sb_info *info, char *buffer, int count)
   2.329 + {
   2.330 + 	struct file *f = info->sock;
   2.331 ++	struct kiocb kiocb;
   2.332 + 	mm_segment_t fs;
   2.333 + 	int c, l = 0, result;
   2.334 + 	char *nl;
   2.335 +@@ -315,6 +320,7 @@ sock_readln(struct shfs_sb_info *info, c
   2.336 + 		if (result < 0)
   2.337 + 			return result;
   2.338 + 	}
   2.339 ++	init_sync_kiocb(&kiocb, f);
   2.340 + 	while (1) {
   2.341 + 		struct iovec vec[1];
   2.342 + 
   2.343 +@@ -350,7 +356,7 @@ sock_readln(struct shfs_sb_info *info, c
   2.344 + 
   2.345 + 		vec[0].iov_base = BUFFER+LEN;
   2.346 + 		vec[0].iov_len = c;
   2.347 +-		result = f->f_op->readv(f, (const struct iovec *)&vec, 1, &f->f_pos);
   2.348 ++		result = f->f_op->aio_read(&kiocb, (const struct iovec *) &vec, 1, f->f_pos);
   2.349 + 		SIGLOCK(flags);
   2.350 + 		if (result == -EPIPE && !sigpipe) {
   2.351 + 			sigdelset(&current->pending.signal, SIGPIPE);
   2.352 +@@ -571,9 +577,9 @@ error:
   2.353 + }
   2.354 + 
   2.355 + int
   2.356 +-shfs_statfs(struct super_block *sb, struct kstatfs *attr)
   2.357 ++shfs_statfs(struct dentry *dentry, struct kstatfs *attr)
   2.358 + {
   2.359 +-	struct shfs_sb_info *info = info_from_sb(sb);
   2.360 ++	struct shfs_sb_info *info = info_from_sb(dentry->d_sb);
   2.361 + 
   2.362 + 	DEBUG("\n");
   2.363 + 	return info->fops.statfs(info, attr);
   2.364 +--- shfs/Linux-2.6/shfs_debug.h
   2.365 ++++ shfs/Linux-2.6/shfs_debug.h
   2.366 +@@ -19,7 +19,7 @@ extern int debug_level;
   2.367 + extern unsigned long alloc;
   2.368 + 
   2.369 + static inline void *
   2.370 +-__kmem_malloc_debug(char *s, kmem_cache_t *cache, int flags)
   2.371 ++__kmem_malloc_debug(char *s, struct kmem_cache *cache, int flags)
   2.372 + {
   2.373 + 	if (debug_level >= SHFS_ALLOC) {
   2.374 + 		void *x = kmem_cache_alloc(cache, flags);
   2.375 +@@ -32,7 +32,7 @@ __kmem_malloc_debug(char *s, kmem_cache_
   2.376 + }
   2.377 + 
   2.378 + static inline void
   2.379 +-__kmem_free_debug(char *s, kmem_cache_t *cache, void *p)
   2.380 ++__kmem_free_debug(char *s, struct kmem_cache *cache, void *p)
   2.381 + {
   2.382 + 	if (debug_level >= SHFS_ALLOC) {
   2.383 + 		VERBOSE("free (%s): %p\n", s, p);
   2.384 +--- shfs/Linux-2.6/shfs_fs.h
   2.385 ++++ shfs/Linux-2.6/shfs_fs.h
   2.386 +@@ -74,10 +74,10 @@ int shfs_fill_cache(struct file*, void*,
   2.387 + 
   2.388 + /* shfs/fcache.c */
   2.389 + #include <linux/slab.h>
   2.390 +-extern kmem_cache_t *file_cache;
   2.391 +-extern kmem_cache_t *dir_head_cache;
   2.392 +-extern kmem_cache_t *dir_entry_cache;
   2.393 +-extern kmem_cache_t *dir_name_cache;
   2.394 ++extern struct kmem_cache *file_cache;
   2.395 ++extern struct kmem_cache *dir_head_cache;
   2.396 ++extern struct kmem_cache *dir_entry_cache;
   2.397 ++extern struct kmem_cache *dir_name_cache;
   2.398 + void fcache_init(void);
   2.399 + void fcache_finish(void);
   2.400 + int fcache_file_open(struct file*);
   2.401 +@@ -101,7 +101,7 @@ int reply(char *s);
   2.402 + void set_garbage(struct shfs_sb_info *info, int write, int count);
   2.403 + int get_name(struct dentry *d, char *name);
   2.404 + int shfs_notify_change(struct dentry *dentry, struct iattr *attr);
   2.405 +-int shfs_statfs(struct super_block *sb, struct kstatfs *attr);
   2.406 ++int shfs_statfs(struct dentry *dentry, struct kstatfs *attr);
   2.407 + 	
   2.408 + /* shfs/inode.c */
   2.409 + void shfs_set_inode_attr(struct inode *inode, struct shfs_fattr *fattr);
   2.410 +--- shfs/Linux-2.6/symlink.c
   2.411 ++++ shfs/Linux-2.6/symlink.c
   2.412 +@@ -41,7 +41,7 @@ error:
   2.413 + 	return result;
   2.414 + }
   2.415 + 
   2.416 +-static int
   2.417 ++static void *
   2.418 + shfs_follow_link(struct dentry *dentry, struct nameidata *nd)
   2.419 + {
   2.420 + 	struct shfs_sb_info *info = info_from_dentry(dentry);
   2.421 +@@ -51,7 +51,6 @@ shfs_follow_link(struct dentry *dentry, 
   2.422 + 	
   2.423 + 	DEBUG("%s\n", dentry->d_name.name);
   2.424 + 
   2.425 +-	result = -ENAMETOOLONG;
   2.426 + 	if (get_name(dentry, name) < 0)
   2.427 + 		goto error;
   2.428 + 
   2.429 +@@ -59,9 +58,9 @@ shfs_follow_link(struct dentry *dentry, 
   2.430 + 	if (result < 0)
   2.431 + 		goto error;
   2.432 + 	DEBUG("%s\n", real_name);
   2.433 +-	result = vfs_follow_link(nd, real_name);
   2.434 ++	nd_set_link(nd, real_name);
   2.435 + error:
   2.436 +-	return result;
   2.437 ++	return NULL;
   2.438 + }
   2.439 + 
   2.440 + struct inode_operations shfs_symlink_inode_operations = {