1 Index: linux-2.6.25.4/fs/yaffs2/yaffs_fs.c
2 ===================================================================
3 --- linux-2.6.25.4.orig/fs/yaffs2/yaffs_fs.c
4 +++ linux-2.6.25.4/fs/yaffs2/yaffs_fs.c
5 @@ -181,7 +181,13 @@ static int yaffs_statfs(struct super_blo
7 static int yaffs_statfs(struct super_block *sb, struct statfs *buf);
10 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25))
11 +static struct inode *yaffs_iget(struct super_block *sb, unsigned long ino);
13 static void yaffs_read_inode(struct inode *inode);
17 static void yaffs_put_inode(struct inode *inode);
18 static void yaffs_delete_inode(struct inode *);
19 @@ -284,7 +290,9 @@ static struct file_operations yaffs_dir_
21 static struct super_operations yaffs_super_ops = {
22 .statfs = yaffs_statfs,
23 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25))
24 .read_inode = yaffs_read_inode,
26 .put_inode = yaffs_put_inode,
27 .put_super = yaffs_put_super,
28 .delete_inode = yaffs_delete_inode,
29 @@ -844,11 +852,17 @@ struct inode *yaffs_get_inode(struct sup
31 (KERN_DEBUG "yaffs_get_inode for object %d\n", obj->objectId));
33 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25))
34 + inode = yaffs_iget(sb, obj->objectId);
38 inode = iget(sb, obj->objectId);
40 /* NB Side effect: iget calls back to yaffs_read_inode(). */
41 /* iget also increments the inode's i_count */
42 /* NB You can't be holding grossLock or deadlock will happen! */
47 @@ -1427,6 +1441,39 @@ static int yaffs_sync_fs(struct super_bl
51 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25))
52 +static struct inode *yaffs_iget(struct super_block *sb, unsigned long ino)
55 + yaffs_Device *dev = yaffs_SuperToDevice(sb);
56 + struct inode *inode;
59 + (KERN_DEBUG "yaffs_iget for %lu\n", ino));
61 + inode = iget_locked(sb, ino);
63 + return ERR_PTR(-ENOMEM);
64 + if (!(inode->i_state & I_NEW))
67 + /* NB This is called as a side effect of other functions, but
68 + * we had to release the lock to prevent deadlocks, so
69 + * need to lock again.
72 + yaffs_GrossLock(dev);
74 + obj = yaffs_FindObjectByNumber(dev, inode->i_ino);
76 + yaffs_FillInodeFromObject(inode, obj);
78 + yaffs_GrossUnlock(dev);
80 + unlock_new_inode(inode);
84 static void yaffs_read_inode(struct inode *inode)
86 /* NB This is called as a side effect of other functions, but
87 @@ -1448,6 +1495,7 @@ static void yaffs_read_inode(struct inod
89 yaffs_GrossUnlock(dev);
91 +#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)) */
93 static LIST_HEAD(yaffs_dev_list);