aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fat
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fat')
-rw-r--r--fs/fat/file.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/fs/fat/file.c b/fs/fat/file.c
index 7059928fb351..bdf91e97397d 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -11,7 +11,6 @@
11#include <linux/mount.h> 11#include <linux/mount.h>
12#include <linux/time.h> 12#include <linux/time.h>
13#include <linux/msdos_fs.h> 13#include <linux/msdos_fs.h>
14#include <linux/smp_lock.h>
15#include <linux/buffer_head.h> 14#include <linux/buffer_head.h>
16#include <linux/writeback.h> 15#include <linux/writeback.h>
17#include <linux/backing-dev.h> 16#include <linux/backing-dev.h>
@@ -229,8 +228,7 @@ static int fat_free(struct inode *inode, int skip)
229 228
230void fat_truncate(struct inode *inode) 229void fat_truncate(struct inode *inode)
231{ 230{
232 struct super_block *sb = inode->i_sb; 231 struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb);
233 struct msdos_sb_info *sbi = MSDOS_SB(sb);
234 const unsigned int cluster_size = sbi->cluster_size; 232 const unsigned int cluster_size = sbi->cluster_size;
235 int nr_clusters; 233 int nr_clusters;
236 234
@@ -243,9 +241,7 @@ void fat_truncate(struct inode *inode)
243 241
244 nr_clusters = (inode->i_size + (cluster_size - 1)) >> sbi->cluster_bits; 242 nr_clusters = (inode->i_size + (cluster_size - 1)) >> sbi->cluster_bits;
245 243
246 lock_super(sb);
247 fat_free(inode, nr_clusters); 244 fat_free(inode, nr_clusters);
248 unlock_super(sb);
249 fat_flush_inodes(inode->i_sb, inode, NULL); 245 fat_flush_inodes(inode->i_sb, inode, NULL);
250} 246}
251 247
@@ -298,14 +294,11 @@ static int fat_allow_set_time(struct msdos_sb_info *sbi, struct inode *inode)
298 294
299int fat_setattr(struct dentry *dentry, struct iattr *attr) 295int fat_setattr(struct dentry *dentry, struct iattr *attr)
300{ 296{
301 struct super_block *sb = dentry->d_sb;
302 struct msdos_sb_info *sbi = MSDOS_SB(dentry->d_sb); 297 struct msdos_sb_info *sbi = MSDOS_SB(dentry->d_sb);
303 struct inode *inode = dentry->d_inode; 298 struct inode *inode = dentry->d_inode;
304 int mask, error = 0; 299 int mask, error = 0;
305 unsigned int ia_valid; 300 unsigned int ia_valid;
306 301
307 lock_super(sb);
308
309 /* 302 /*
310 * Expand the file. Since inode_setattr() updates ->i_size 303 * Expand the file. Since inode_setattr() updates ->i_size
311 * before calling the ->truncate(), but FAT needs to fill the 304 * before calling the ->truncate(), but FAT needs to fill the
@@ -358,7 +351,6 @@ int fat_setattr(struct dentry *dentry, struct iattr *attr)
358 mask = sbi->options.fs_fmask; 351 mask = sbi->options.fs_fmask;
359 inode->i_mode &= S_IFMT | (S_IRWXUGO & ~mask); 352 inode->i_mode &= S_IFMT | (S_IRWXUGO & ~mask);
360out: 353out:
361 unlock_super(sb);
362 return error; 354 return error;
363} 355}
364EXPORT_SYMBOL_GPL(fat_setattr); 356EXPORT_SYMBOL_GPL(fat_setattr);