nfs.c (ea3983ace6b79c96e6ab3d3837e2eaf81ab881e2) nfs.c (8fceb4e0171f6bf64db756c65b2ce5f15aed8b4d)
1/* fs/fat/nfs.c
2 *
3 * This software is licensed under the terms of the GNU General Public
4 * License version 2, as published by the Free Software Foundation, and
5 * may be copied, distributed, and modified under those terms.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of

--- 36 unchanged lines hidden (view full) ---

45 inode = igrab(&i->vfs_inode);
46 if (inode)
47 break;
48 }
49 spin_unlock(&sbi->dir_hash_lock);
50 return inode;
51}
52
1/* fs/fat/nfs.c
2 *
3 * This software is licensed under the terms of the GNU General Public
4 * License version 2, as published by the Free Software Foundation, and
5 * may be copied, distributed, and modified under those terms.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of

--- 36 unchanged lines hidden (view full) ---

45 inode = igrab(&i->vfs_inode);
46 if (inode)
47 break;
48 }
49 spin_unlock(&sbi->dir_hash_lock);
50 return inode;
51}
52
53static struct inode *fat_ilookup(struct super_block *sb, u64 ino, loff_t i_pos)
54{
55 if (MSDOS_SB(sb)->options.nfs == FAT_NFS_NOSTALE_RO)
56 return fat_iget(sb, i_pos);
57
58 else {
59 if ((ino < MSDOS_ROOT_INO) || (ino == MSDOS_FSINFO_INO))
60 return NULL;
61 return ilookup(sb, ino);
62 }
63}
64
53static struct inode *__fat_nfs_get_inode(struct super_block *sb,
54 u64 ino, u32 generation, loff_t i_pos)
55{
65static struct inode *__fat_nfs_get_inode(struct super_block *sb,
66 u64 ino, u32 generation, loff_t i_pos)
67{
56 struct inode *inode;
68 struct inode *inode = fat_ilookup(sb, ino, i_pos);
57
69
58 if ((ino < MSDOS_ROOT_INO) || (ino == MSDOS_FSINFO_INO))
59 return NULL;
60
61 inode = ilookup(sb, ino);
62 if (inode && generation && (inode->i_generation != generation)) {
63 iput(inode);
64 inode = NULL;
65 }
70 if (inode && generation && (inode->i_generation != generation)) {
71 iput(inode);
72 inode = NULL;
73 }
74 if (inode == NULL && MSDOS_SB(sb)->options.nfs == FAT_NFS_NOSTALE_RO) {
75 struct buffer_head *bh = NULL;
76 struct msdos_dir_entry *de ;
77 sector_t blocknr;
78 int offset;
79 fat_get_blknr_offset(MSDOS_SB(sb), i_pos, &blocknr, &offset);
80 bh = sb_bread(sb, blocknr);
81 if (!bh) {
82 fat_msg(sb, KERN_ERR,
83 "unable to read block(%llu) for building NFS inode",
84 (llu)blocknr);
85 return inode;
86 }
87 de = (struct msdos_dir_entry *)bh->b_data;
88 /* If a file is deleted on server and client is not updated
89 * yet, we must not build the inode upon a lookup call.
90 */
91 if (IS_FREE(de[offset].name))
92 inode = NULL;
93 else
94 inode = fat_build_inode(sb, &de[offset], i_pos);
95 brelse(bh);
96 }
66
67 return inode;
68}
69
70static struct inode *fat_nfs_get_inode(struct super_block *sb,
71 u64 ino, u32 generation)
72{
73

--- 147 unchanged lines hidden ---
97
98 return inode;
99}
100
101static struct inode *fat_nfs_get_inode(struct super_block *sb,
102 u64 ino, u32 generation)
103{
104

--- 147 unchanged lines hidden ---