X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Ffat%2Finode.c;h=53f3cf62b7c18c945bdcc3caaddf9466a91ca391;hb=0c0d61ca93d111c521182c0909e478fa709e05c6;hp=c0c5e9c55b588c37264deb5be91bb42c64d1f2a0;hpb=e6d5a11dad44b8ae18ca8fc4ecb72ccccfa0a2d2;p=linux-2.6 diff --git a/fs/fat/inode.c b/fs/fat/inode.c index c0c5e9c55b..53f3cf62b7 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -634,8 +634,6 @@ static const struct super_operations fat_sops = { .clear_inode = fat_clear_inode, .remount_fs = fat_remount, - .read_inode = make_bad_inode, - .show_options = fat_show_options, }; @@ -653,27 +651,18 @@ static const struct super_operations fat_sops = { * of i_logstart is used to store the directory entry offset. */ -static struct dentry * -fat_decode_fh(struct super_block *sb, __u32 *fh, int len, int fhtype, - int (*acceptable)(void *context, struct dentry *de), - void *context) -{ - if (fhtype != 3) - return ERR_PTR(-ESTALE); - if (len < 5) - return ERR_PTR(-ESTALE); - - return sb->s_export_op->find_exported_dentry(sb, fh, NULL, acceptable, context); -} - -static struct dentry *fat_get_dentry(struct super_block *sb, void *inump) +static struct dentry *fat_fh_to_dentry(struct super_block *sb, + struct fid *fid, int fh_len, int fh_type) { struct inode *inode = NULL; struct dentry *result; - __u32 *fh = inump; + u32 *fh = fid->raw; + + if (fh_len < 5 || fh_type != 3) + return NULL; - inode = iget(sb, fh[0]); - if (!inode || is_bad_inode(inode) || inode->i_generation != fh[1]) { + inode = ilookup(sb, fh[0]); + if (!inode || inode->i_generation != fh[1]) { if (inode) iput(inode); inode = NULL; @@ -769,7 +758,7 @@ static struct dentry *fat_get_parent(struct dentry *child) inode = fat_build_inode(child->d_sb, de, i_pos); brelse(bh); if (IS_ERR(inode)) { - parent = ERR_PTR(PTR_ERR(inode)); + parent = ERR_CAST(inode); goto out; } parent = d_alloc_anon(inode); @@ -783,10 +772,9 @@ out: return parent; } -static struct export_operations fat_export_ops = { - .decode_fh = fat_decode_fh, +static const struct export_operations fat_export_ops = { .encode_fh = fat_encode_fh, - .get_dentry = fat_get_dentry, + .fh_to_dentry = fat_fh_to_dentry, .get_parent = fat_get_parent, }; @@ -849,6 +837,8 @@ static int fat_show_options(struct seq_file *m, struct vfsmount *mnt) if (!opts->numtail) seq_puts(m, ",nonumtail"); } + if (sbi->options.flush) + seq_puts(m, ",flush"); return 0; } @@ -1305,10 +1295,8 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, fsinfo = (struct fat_boot_fsinfo *)fsinfo_bh->b_data; if (!IS_FSINFO(fsinfo)) { - printk(KERN_WARNING - "FAT: Did not find valid FSINFO signature.\n" - " Found signature1 0x%08x signature2 0x%08x" - " (sector = %lu)\n", + printk(KERN_WARNING "FAT: Invalid FSINFO signature: " + "0x%08x, 0x%08x (sector = %lu)\n", le32_to_cpu(fsinfo->signature1), le32_to_cpu(fsinfo->signature2), sbi->fsinfo_sector);