inode.c (ea3983ace6b79c96e6ab3d3837e2eaf81ab881e2) inode.c (8fceb4e0171f6bf64db756c65b2ce5f15aed8b4d)
1/*
2 * linux/fs/fat/inode.c
3 *
4 * Written 1992,1993 by Werner Almesberger
5 * VFAT extensions by Gordon Chaffee, merged with msdos fs by Henrik Storner
6 * Rewritten for the constant inumbers support by Al Viro
7 *
8 * Fixes:

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

438 de->cdate, de->ctime_cs);
439 fat_time_fat2unix(sbi, &inode->i_atime, 0, de->adate, 0);
440 } else
441 inode->i_ctime = inode->i_atime = inode->i_mtime;
442
443 return 0;
444}
445
1/*
2 * linux/fs/fat/inode.c
3 *
4 * Written 1992,1993 by Werner Almesberger
5 * VFAT extensions by Gordon Chaffee, merged with msdos fs by Henrik Storner
6 * Rewritten for the constant inumbers support by Al Viro
7 *
8 * Fixes:

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

438 de->cdate, de->ctime_cs);
439 fat_time_fat2unix(sbi, &inode->i_atime, 0, de->adate, 0);
440 } else
441 inode->i_ctime = inode->i_atime = inode->i_mtime;
442
443 return 0;
444}
445
446static inline void fat_lock_build_inode(struct msdos_sb_info *sbi)
447{
448 if (sbi->options.nfs == FAT_NFS_NOSTALE_RO)
449 mutex_lock(&sbi->nfs_build_inode_lock);
450}
451
452static inline void fat_unlock_build_inode(struct msdos_sb_info *sbi)
453{
454 if (sbi->options.nfs == FAT_NFS_NOSTALE_RO)
455 mutex_unlock(&sbi->nfs_build_inode_lock);
456}
457
446struct inode *fat_build_inode(struct super_block *sb,
447 struct msdos_dir_entry *de, loff_t i_pos)
448{
449 struct inode *inode;
450 int err;
451
458struct inode *fat_build_inode(struct super_block *sb,
459 struct msdos_dir_entry *de, loff_t i_pos)
460{
461 struct inode *inode;
462 int err;
463
464 fat_lock_build_inode(MSDOS_SB(sb));
452 inode = fat_iget(sb, i_pos);
453 if (inode)
454 goto out;
455 inode = new_inode(sb);
456 if (!inode) {
457 inode = ERR_PTR(-ENOMEM);
458 goto out;
459 }
460 inode->i_ino = iunique(sb, MSDOS_ROOT_INO);
461 inode->i_version = 1;
462 err = fat_fill_inode(inode, de);
463 if (err) {
464 iput(inode);
465 inode = ERR_PTR(err);
466 goto out;
467 }
468 fat_attach(inode, i_pos);
469 insert_inode_hash(inode);
470out:
465 inode = fat_iget(sb, i_pos);
466 if (inode)
467 goto out;
468 inode = new_inode(sb);
469 if (!inode) {
470 inode = ERR_PTR(-ENOMEM);
471 goto out;
472 }
473 inode->i_ino = iunique(sb, MSDOS_ROOT_INO);
474 inode->i_version = 1;
475 err = fat_fill_inode(inode, de);
476 if (err) {
477 iput(inode);
478 inode = ERR_PTR(err);
479 goto out;
480 }
481 fat_attach(inode, i_pos);
482 insert_inode_hash(inode);
483out:
484 fat_unlock_build_inode(MSDOS_SB(sb));
471 return inode;
472}
473
474EXPORT_SYMBOL_GPL(fat_build_inode);
475
476static void fat_evict_inode(struct inode *inode)
477{
478 truncate_inode_pages(&inode->i_data, 0);

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

1242 if (!sbi)
1243 return -ENOMEM;
1244 sb->s_fs_info = sbi;
1245
1246 sb->s_flags |= MS_NODIRATIME;
1247 sb->s_magic = MSDOS_SUPER_MAGIC;
1248 sb->s_op = &fat_sops;
1249 sb->s_export_op = &fat_export_ops;
485 return inode;
486}
487
488EXPORT_SYMBOL_GPL(fat_build_inode);
489
490static void fat_evict_inode(struct inode *inode)
491{
492 truncate_inode_pages(&inode->i_data, 0);

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

1256 if (!sbi)
1257 return -ENOMEM;
1258 sb->s_fs_info = sbi;
1259
1260 sb->s_flags |= MS_NODIRATIME;
1261 sb->s_magic = MSDOS_SUPER_MAGIC;
1262 sb->s_op = &fat_sops;
1263 sb->s_export_op = &fat_export_ops;
1264 mutex_init(&sbi->nfs_build_inode_lock);
1250 ratelimit_state_init(&sbi->ratelimit, DEFAULT_RATELIMIT_INTERVAL,
1251 DEFAULT_RATELIMIT_BURST);
1252
1253 error = parse_options(sb, data, isvfat, silent, &debug, &sbi->options);
1254 if (error)
1255 goto out_fail;
1256
1257 setup(sb); /* flavour-specific stuff that needs options */

--- 355 unchanged lines hidden ---
1265 ratelimit_state_init(&sbi->ratelimit, DEFAULT_RATELIMIT_INTERVAL,
1266 DEFAULT_RATELIMIT_BURST);
1267
1268 error = parse_options(sb, data, isvfat, silent, &debug, &sbi->options);
1269 if (error)
1270 goto out_fail;
1271
1272 setup(sb); /* flavour-specific stuff that needs options */

--- 355 unchanged lines hidden ---