diff options
Diffstat (limited to 'fs/fat/namei_vfat.c')
-rw-r--r-- | fs/fat/namei_vfat.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c index 4afdc3f..6a7152d 100644 --- a/fs/fat/namei_vfat.c +++ b/fs/fat/namei_vfat.c @@ -788,7 +788,7 @@ static int vfat_create(struct inode *dir, struct dentry *dentry, umode_t mode, mutex_lock(&MSDOS_SB(sb)->s_lock); - ts = CURRENT_TIME_SEC; + ts = current_time(dir); err = vfat_add_entry(dir, &dentry->d_name, 0, 0, &ts, &sinfo); if (err) goto out; @@ -832,7 +832,7 @@ static int vfat_rmdir(struct inode *dir, struct dentry *dentry) drop_nlink(dir); clear_nlink(inode); - inode->i_mtime = inode->i_atime = CURRENT_TIME_SEC; + inode->i_mtime = inode->i_atime = current_time(inode); fat_detach(inode); vfat_d_version_set(dentry, dir->i_version); out: @@ -858,7 +858,7 @@ static int vfat_unlink(struct inode *dir, struct dentry *dentry) if (err) goto out; clear_nlink(inode); - inode->i_mtime = inode->i_atime = CURRENT_TIME_SEC; + inode->i_mtime = inode->i_atime = current_time(inode); fat_detach(inode); vfat_d_version_set(dentry, dir->i_version); out: @@ -877,7 +877,7 @@ static int vfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) mutex_lock(&MSDOS_SB(sb)->s_lock); - ts = CURRENT_TIME_SEC; + ts = current_time(dir); cluster = fat_alloc_new_dir(dir, &ts); if (cluster < 0) { err = cluster; @@ -914,7 +914,8 @@ out: } static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry, - struct inode *new_dir, struct dentry *new_dentry) + struct inode *new_dir, struct dentry *new_dentry, + unsigned int flags) { struct buffer_head *dotdot_bh; struct msdos_dir_entry *dotdot_de; @@ -925,6 +926,9 @@ static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry, int err, is_dir, update_dotdot, corrupt = 0; struct super_block *sb = old_dir->i_sb; + if (flags & ~RENAME_NOREPLACE) + return -EINVAL; + old_sinfo.bh = sinfo.bh = dotdot_bh = NULL; old_inode = d_inode(old_dentry); new_inode = d_inode(new_dentry); @@ -942,7 +946,7 @@ static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry, } } - ts = CURRENT_TIME_SEC; + ts = current_time(old_dir); if (new_inode) { if (is_dir) { err = fat_dir_empty(new_inode); |