aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fat/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fat/file.c')
-rw-r--r--fs/fat/file.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/fat/file.c b/fs/fat/file.c
index 8707a8cfa02c..ddde37025ca6 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -313,6 +313,8 @@ static int fat_allow_set_time(struct msdos_sb_info *sbi, struct inode *inode)
313 return 0; 313 return 0;
314} 314}
315 315
316#define TIMES_SET_FLAGS (ATTR_MTIME_SET | ATTR_ATIME_SET | ATTR_TIMES_SET)
317
316int fat_setattr(struct dentry *dentry, struct iattr *attr) 318int fat_setattr(struct dentry *dentry, struct iattr *attr)
317{ 319{
318 struct msdos_sb_info *sbi = MSDOS_SB(dentry->d_sb); 320 struct msdos_sb_info *sbi = MSDOS_SB(dentry->d_sb);
@@ -336,9 +338,9 @@ int fat_setattr(struct dentry *dentry, struct iattr *attr)
336 338
337 /* Check for setting the inode time. */ 339 /* Check for setting the inode time. */
338 ia_valid = attr->ia_valid; 340 ia_valid = attr->ia_valid;
339 if (ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET)) { 341 if (ia_valid & TIMES_SET_FLAGS) {
340 if (fat_allow_set_time(sbi, inode)) 342 if (fat_allow_set_time(sbi, inode))
341 attr->ia_valid &= ~(ATTR_MTIME_SET | ATTR_ATIME_SET); 343 attr->ia_valid &= ~TIMES_SET_FLAGS;
342 } 344 }
343 345
344 error = inode_change_ok(inode, attr); 346 error = inode_change_ok(inode, attr);