aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fat
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fat')
-rw-r--r--fs/fat/fat.h6
-rw-r--r--fs/fat/file.c8
-rw-r--r--fs/fat/inode.c33
-rw-r--r--fs/fat/namei_msdos.c4
-rw-r--r--fs/fat/namei_vfat.c4
5 files changed, 27 insertions, 28 deletions
diff --git a/fs/fat/fat.h b/fs/fat/fat.h
index 1510a4d51990..66994f316e18 100644
--- a/fs/fat/fat.h
+++ b/fs/fat/fat.h
@@ -141,7 +141,7 @@ static inline struct msdos_inode_info *MSDOS_I(struct inode *inode)
141static inline int fat_mode_can_hold_ro(struct inode *inode) 141static inline int fat_mode_can_hold_ro(struct inode *inode)
142{ 142{
143 struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); 143 struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb);
144 mode_t mask; 144 umode_t mask;
145 145
146 if (S_ISDIR(inode->i_mode)) { 146 if (S_ISDIR(inode->i_mode)) {
147 if (!sbi->options.rodir) 147 if (!sbi->options.rodir)
@@ -156,8 +156,8 @@ static inline int fat_mode_can_hold_ro(struct inode *inode)
156} 156}
157 157
158/* Convert attribute bits and a mask to the UNIX mode. */ 158/* Convert attribute bits and a mask to the UNIX mode. */
159static inline mode_t fat_make_mode(struct msdos_sb_info *sbi, 159static inline umode_t fat_make_mode(struct msdos_sb_info *sbi,
160 u8 attrs, mode_t mode) 160 u8 attrs, umode_t mode)
161{ 161{
162 if (attrs & ATTR_RO && !((attrs & ATTR_DIR) && !sbi->options.rodir)) 162 if (attrs & ATTR_RO && !((attrs & ATTR_DIR) && !sbi->options.rodir))
163 mode &= ~S_IWUGO; 163 mode &= ~S_IWUGO;
diff --git a/fs/fat/file.c b/fs/fat/file.c
index c118acf16e43..a71fe3715ee8 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -44,7 +44,7 @@ static int fat_ioctl_set_attributes(struct file *file, u32 __user *user_attr)
44 goto out; 44 goto out;
45 45
46 mutex_lock(&inode->i_mutex); 46 mutex_lock(&inode->i_mutex);
47 err = mnt_want_write(file->f_path.mnt); 47 err = mnt_want_write_file(file);
48 if (err) 48 if (err)
49 goto out_unlock_inode; 49 goto out_unlock_inode;
50 50
@@ -108,7 +108,7 @@ static int fat_ioctl_set_attributes(struct file *file, u32 __user *user_attr)
108 fat_save_attrs(inode, attr); 108 fat_save_attrs(inode, attr);
109 mark_inode_dirty(inode); 109 mark_inode_dirty(inode);
110out_drop_write: 110out_drop_write:
111 mnt_drop_write(file->f_path.mnt); 111 mnt_drop_write_file(file);
112out_unlock_inode: 112out_unlock_inode:
113 mutex_unlock(&inode->i_mutex); 113 mutex_unlock(&inode->i_mutex);
114out: 114out:
@@ -314,7 +314,7 @@ EXPORT_SYMBOL_GPL(fat_getattr);
314static int fat_sanitize_mode(const struct msdos_sb_info *sbi, 314static int fat_sanitize_mode(const struct msdos_sb_info *sbi,
315 struct inode *inode, umode_t *mode_ptr) 315 struct inode *inode, umode_t *mode_ptr)
316{ 316{
317 mode_t mask, perm; 317 umode_t mask, perm;
318 318
319 /* 319 /*
320 * Note, the basic check is already done by a caller of 320 * Note, the basic check is already done by a caller of
@@ -351,7 +351,7 @@ static int fat_sanitize_mode(const struct msdos_sb_info *sbi,
351 351
352static int fat_allow_set_time(struct msdos_sb_info *sbi, struct inode *inode) 352static int fat_allow_set_time(struct msdos_sb_info *sbi, struct inode *inode)
353{ 353{
354 mode_t allow_utime = sbi->options.allow_utime; 354 umode_t allow_utime = sbi->options.allow_utime;
355 355
356 if (current_fsuid() != inode->i_uid) { 356 if (current_fsuid() != inode->i_uid) {
357 if (in_group_p(inode->i_gid)) 357 if (in_group_p(inode->i_gid))
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 808cac7edcfb..3ab841054d53 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -518,7 +518,6 @@ static struct inode *fat_alloc_inode(struct super_block *sb)
518static void fat_i_callback(struct rcu_head *head) 518static void fat_i_callback(struct rcu_head *head)
519{ 519{
520 struct inode *inode = container_of(head, struct inode, i_rcu); 520 struct inode *inode = container_of(head, struct inode, i_rcu);
521 INIT_LIST_HEAD(&inode->i_dentry);
522 kmem_cache_free(fat_inode_cachep, MSDOS_I(inode)); 521 kmem_cache_free(fat_inode_cachep, MSDOS_I(inode));
523} 522}
524 523
@@ -672,7 +671,7 @@ int fat_sync_inode(struct inode *inode)
672 671
673EXPORT_SYMBOL_GPL(fat_sync_inode); 672EXPORT_SYMBOL_GPL(fat_sync_inode);
674 673
675static int fat_show_options(struct seq_file *m, struct vfsmount *mnt); 674static int fat_show_options(struct seq_file *m, struct dentry *root);
676static const struct super_operations fat_sops = { 675static const struct super_operations fat_sops = {
677 .alloc_inode = fat_alloc_inode, 676 .alloc_inode = fat_alloc_inode,
678 .destroy_inode = fat_destroy_inode, 677 .destroy_inode = fat_destroy_inode,
@@ -811,9 +810,9 @@ static const struct export_operations fat_export_ops = {
811 .get_parent = fat_get_parent, 810 .get_parent = fat_get_parent,
812}; 811};
813 812
814static int fat_show_options(struct seq_file *m, struct vfsmount *mnt) 813static int fat_show_options(struct seq_file *m, struct dentry *root)
815{ 814{
816 struct msdos_sb_info *sbi = MSDOS_SB(mnt->mnt_sb); 815 struct msdos_sb_info *sbi = MSDOS_SB(root->d_sb);
817 struct fat_mount_options *opts = &sbi->options; 816 struct fat_mount_options *opts = &sbi->options;
818 int isvfat = opts->isvfat; 817 int isvfat = opts->isvfat;
819 818
@@ -898,7 +897,7 @@ enum {
898 Opt_charset, Opt_shortname_lower, Opt_shortname_win95, 897 Opt_charset, Opt_shortname_lower, Opt_shortname_win95,
899 Opt_shortname_winnt, Opt_shortname_mixed, Opt_utf8_no, Opt_utf8_yes, 898 Opt_shortname_winnt, Opt_shortname_mixed, Opt_utf8_no, Opt_utf8_yes,
900 Opt_uni_xl_no, Opt_uni_xl_yes, Opt_nonumtail_no, Opt_nonumtail_yes, 899 Opt_uni_xl_no, Opt_uni_xl_yes, Opt_nonumtail_no, Opt_nonumtail_yes,
901 Opt_obsolate, Opt_flush, Opt_tz_utc, Opt_rodir, Opt_err_cont, 900 Opt_obsolete, Opt_flush, Opt_tz_utc, Opt_rodir, Opt_err_cont,
902 Opt_err_panic, Opt_err_ro, Opt_discard, Opt_err, 901 Opt_err_panic, Opt_err_ro, Opt_discard, Opt_err,
903}; 902};
904 903
@@ -928,17 +927,17 @@ static const match_table_t fat_tokens = {
928 {Opt_err_panic, "errors=panic"}, 927 {Opt_err_panic, "errors=panic"},
929 {Opt_err_ro, "errors=remount-ro"}, 928 {Opt_err_ro, "errors=remount-ro"},
930 {Opt_discard, "discard"}, 929 {Opt_discard, "discard"},
931 {Opt_obsolate, "conv=binary"}, 930 {Opt_obsolete, "conv=binary"},
932 {Opt_obsolate, "conv=text"}, 931 {Opt_obsolete, "conv=text"},
933 {Opt_obsolate, "conv=auto"}, 932 {Opt_obsolete, "conv=auto"},
934 {Opt_obsolate, "conv=b"}, 933 {Opt_obsolete, "conv=b"},
935 {Opt_obsolate, "conv=t"}, 934 {Opt_obsolete, "conv=t"},
936 {Opt_obsolate, "conv=a"}, 935 {Opt_obsolete, "conv=a"},
937 {Opt_obsolate, "fat=%u"}, 936 {Opt_obsolete, "fat=%u"},
938 {Opt_obsolate, "blocksize=%u"}, 937 {Opt_obsolete, "blocksize=%u"},
939 {Opt_obsolate, "cvf_format=%20s"}, 938 {Opt_obsolete, "cvf_format=%20s"},
940 {Opt_obsolate, "cvf_options=%100s"}, 939 {Opt_obsolete, "cvf_options=%100s"},
941 {Opt_obsolate, "posix"}, 940 {Opt_obsolete, "posix"},
942 {Opt_err, NULL}, 941 {Opt_err, NULL},
943}; 942};
944static const match_table_t msdos_tokens = { 943static const match_table_t msdos_tokens = {
@@ -1170,7 +1169,7 @@ static int parse_options(struct super_block *sb, char *options, int is_vfat,
1170 break; 1169 break;
1171 1170
1172 /* obsolete mount options */ 1171 /* obsolete mount options */
1173 case Opt_obsolate: 1172 case Opt_obsolete:
1174 fat_msg(sb, KERN_INFO, "\"%s\" option is obsolete, " 1173 fat_msg(sb, KERN_INFO, "\"%s\" option is obsolete, "
1175 "not supported now", p); 1174 "not supported now", p);
1176 break; 1175 break;
diff --git a/fs/fat/namei_msdos.c b/fs/fat/namei_msdos.c
index 216b419f30e2..c5938c9084b9 100644
--- a/fs/fat/namei_msdos.c
+++ b/fs/fat/namei_msdos.c
@@ -264,7 +264,7 @@ static int msdos_add_entry(struct inode *dir, const unsigned char *name,
264} 264}
265 265
266/***** Create a file */ 266/***** Create a file */
267static int msdos_create(struct inode *dir, struct dentry *dentry, int mode, 267static int msdos_create(struct inode *dir, struct dentry *dentry, umode_t mode,
268 struct nameidata *nd) 268 struct nameidata *nd)
269{ 269{
270 struct super_block *sb = dir->i_sb; 270 struct super_block *sb = dir->i_sb;
@@ -346,7 +346,7 @@ out:
346} 346}
347 347
348/***** Make a directory */ 348/***** Make a directory */
349static int msdos_mkdir(struct inode *dir, struct dentry *dentry, int mode) 349static int msdos_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
350{ 350{
351 struct super_block *sb = dir->i_sb; 351 struct super_block *sb = dir->i_sb;
352 struct fat_slot_info sinfo; 352 struct fat_slot_info sinfo;
diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c
index c25cf151b84b..a81eb2367d39 100644
--- a/fs/fat/namei_vfat.c
+++ b/fs/fat/namei_vfat.c
@@ -782,7 +782,7 @@ error:
782 return ERR_PTR(err); 782 return ERR_PTR(err);
783} 783}
784 784
785static int vfat_create(struct inode *dir, struct dentry *dentry, int mode, 785static int vfat_create(struct inode *dir, struct dentry *dentry, umode_t mode,
786 struct nameidata *nd) 786 struct nameidata *nd)
787{ 787{
788 struct super_block *sb = dir->i_sb; 788 struct super_block *sb = dir->i_sb;
@@ -871,7 +871,7 @@ out:
871 return err; 871 return err;
872} 872}
873 873
874static int vfat_mkdir(struct inode *dir, struct dentry *dentry, int mode) 874static int vfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
875{ 875{
876 struct super_block *sb = dir->i_sb; 876 struct super_block *sb = dir->i_sb;
877 struct inode *inode; 877 struct inode *inode;