1 --- a/fs/yaffs2/yaffs_fs.c
2 +++ b/fs/yaffs2/yaffs_fs.c
5 static int yaffs_statfs(struct super_block *sb, struct statfs *buf);
8 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25))
9 +static struct inode *yaffs_iget(struct super_block *sb, unsigned long ino);
11 static void yaffs_read_inode(struct inode *inode);
15 static void yaffs_put_inode(struct inode *inode);
16 static void yaffs_delete_inode(struct inode *);
19 static struct super_operations yaffs_super_ops = {
20 .statfs = yaffs_statfs,
21 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25))
22 .read_inode = yaffs_read_inode,
24 .put_inode = yaffs_put_inode,
25 .put_super = yaffs_put_super,
26 .delete_inode = yaffs_delete_inode,
29 (KERN_DEBUG "yaffs_get_inode for object %d\n", obj->objectId));
31 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25))
32 + inode = yaffs_iget(sb, obj->objectId);
36 inode = iget(sb, obj->objectId);
38 /* NB Side effect: iget calls back to yaffs_read_inode(). */
39 /* iget also increments the inode's i_count */
40 /* NB You can't be holding grossLock or deadlock will happen! */
45 @@ -1427,6 +1441,39 @@
49 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25))
50 +static struct inode *yaffs_iget(struct super_block *sb, unsigned long ino)
53 + yaffs_Device *dev = yaffs_SuperToDevice(sb);
54 + struct inode *inode;
57 + (KERN_DEBUG "yaffs_iget for %lu\n", ino));
59 + inode = iget_locked(sb, ino);
61 + return ERR_PTR(-ENOMEM);
62 + if (!(inode->i_state & I_NEW))
65 + /* NB This is called as a side effect of other functions, but
66 + * we had to release the lock to prevent deadlocks, so
67 + * need to lock again.
70 + yaffs_GrossLock(dev);
72 + obj = yaffs_FindObjectByNumber(dev, inode->i_ino);
74 + yaffs_FillInodeFromObject(inode, obj);
76 + yaffs_GrossUnlock(dev);
78 + unlock_new_inode(inode);
82 static void yaffs_read_inode(struct inode *inode)
84 /* NB This is called as a side effect of other functions, but
87 yaffs_GrossUnlock(dev);
89 +#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)) */
91 static LIST_HEAD(yaffs_dev_list);