1 Index: shfs-0.35/shfs/Linux-2.6/inode.c
2 ===================================================================
3 --- shfs-0.35.orig/shfs/Linux-2.6/inode.c 2007-06-04 13:22:58.091024104 +0200
4 +++ shfs-0.35/shfs/Linux-2.6/inode.c 2007-06-04 13:22:58.397977440 +0200
9 +#ifdef NEW_VFS_DENTRY_API
11 +shfs_get_sb(struct file_system_type *fs_type,
12 + int flags, const char *dev_name, void *data, struct vfsmount *mnt)
14 + return get_sb_nodev(fs_type, flags, data, shfs_read_super, mnt);
17 static struct super_block *
18 shfs_get_sb(struct file_system_type *fs_type,
19 int flags, const char *dev_name, void *data)
21 return get_sb_nodev(fs_type, flags, data, shfs_read_super);
25 static struct file_system_type sh_fs_type = {
27 Index: shfs-0.35/shfs/Linux-2.6/file.c
28 ===================================================================
29 --- shfs-0.35.orig/shfs/Linux-2.6/file.c 2007-06-04 13:22:58.096023344 +0200
30 +++ shfs-0.35/shfs/Linux-2.6/file.c 2007-06-04 13:22:58.397977440 +0200
35 -shfs_file_flush(struct file *f)
36 +do_file_flush(struct file *f)
38 struct dentry *dentry = f->f_dentry;
39 struct shfs_sb_info *info = info_from_dentry(dentry);
44 +#ifdef FLUSH_HAS_LOCK_OWNER
45 +shfs_file_flush(struct file *f, fl_owner_t id)
47 +shfs_file_flush(struct file *f)
50 + return do_file_flush(f);
54 shfs_file_release(struct inode *inode, struct file *f)
56 struct dentry *dentry = f->f_dentry;
59 written = generic_file_write(f, buf, count, offset);
61 - result = shfs_file_flush(f);
62 + result = do_file_flush(f);
63 written = result < 0 ? result: written;
66 Index: shfs-0.35/shfs/Linux-2.6/proc.c
67 ===================================================================
68 --- shfs-0.35.orig/shfs/Linux-2.6/proc.c 2007-06-04 13:22:58.102022432 +0200
69 +++ shfs-0.35/shfs/Linux-2.6/proc.c 2007-06-04 13:22:58.398977288 +0200
74 +#ifdef NEW_VFS_DENTRY_API
76 +shfs_statfs(struct dentry *dentry, struct kstatfs *attr)
78 + struct shfs_sb_info *info = info_from_sb(dentry->d_sb);
81 + return info->fops.statfs(info, attr);
85 shfs_statfs(struct super_block *sb, struct kstatfs *attr)
89 return info->fops.statfs(info, attr);
93 Index: shfs-0.35/shfs/Linux-2.6/shfs_fs.h
94 ===================================================================
95 --- shfs-0.35.orig/shfs/Linux-2.6/shfs_fs.h 2007-06-04 13:22:58.107021672 +0200
96 +++ shfs-0.35/shfs/Linux-2.6/shfs_fs.h 2007-06-04 13:22:58.398977288 +0200
99 #include <linux/ioctl.h>
100 #include <linux/pagemap.h>
101 +#include <linux/version.h>
103 +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,17)
104 +#define NEW_VFS_DENTRY_API
105 +#define FLUSH_HAS_LOCK_OWNER
108 #define SHFS_MAX_AGE(info) (((info)->ttl * HZ) / 1000)
109 #define SOCKBUF_SIZE (SHFS_PATH_MAX * 10)
111 void set_garbage(struct shfs_sb_info *info, int write, int count);
112 int get_name(struct dentry *d, char *name);
113 int shfs_notify_change(struct dentry *dentry, struct iattr *attr);
115 +#ifdef NEW_VFS_DENTRY_API
116 +int shfs_statfs(struct dentry *dentry, struct kstatfs *attr);
118 int shfs_statfs(struct super_block *sb, struct kstatfs *attr);
122 void shfs_set_inode_attr(struct inode *inode, struct shfs_fattr *fattr);
123 Index: shfs-0.35/shfs/Linux-2.6/symlink.c
124 ===================================================================
125 --- shfs-0.35.orig/shfs/Linux-2.6/symlink.c 2007-06-04 13:22:58.113020760 +0200
126 +++ shfs-0.35/shfs/Linux-2.6/symlink.c 2007-06-04 13:22:58.398977288 +0200
133 shfs_follow_link(struct dentry *dentry, struct nameidata *nd)
135 struct shfs_sb_info *info = info_from_dentry(dentry);
137 DEBUG("%s\n", real_name);
138 result = vfs_follow_link(nd, real_name);
144 struct inode_operations shfs_symlink_inode_operations = {
145 Index: shfs-0.35/shfs/Linux-2.6/dcache.c
146 ===================================================================
147 --- shfs-0.35.orig/shfs/Linux-2.6/dcache.c 2007-06-04 13:22:58.121019544 +0200
148 +++ shfs-0.35/shfs/Linux-2.6/dcache.c 2007-06-04 13:22:58.398977288 +0200
150 spin_lock(&dcache_lock);
151 next = parent->d_subdirs.next;
152 while (next != &parent->d_subdirs) {
153 - dentry = list_entry(next, struct dentry, d_child);
154 + dentry = list_entry(next, struct dentry, d_u.d_child);
155 dentry->d_fsdata = NULL;
156 shfs_age_dentry(info, dentry);
159 spin_lock(&dcache_lock);
160 next = parent->d_subdirs.next;
161 while (next != &parent->d_subdirs) {
162 - dent = list_entry(next, struct dentry, d_child);
163 + dent = list_entry(next, struct dentry, d_u.d_child);
164 if ((unsigned long)dent->d_fsdata == fpos) {