diff options
Diffstat (limited to 'fs/sysv/namei.c')
-rw-r--r-- | fs/sysv/namei.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/sysv/namei.c b/fs/sysv/namei.c index a42de45ce40d..d8817f139763 100644 --- a/fs/sysv/namei.c +++ b/fs/sysv/namei.c | |||
@@ -120,7 +120,7 @@ static int sysv_link(struct dentry * old_dentry, struct inode * dir, | |||
120 | { | 120 | { |
121 | struct inode *inode = d_inode(old_dentry); | 121 | struct inode *inode = d_inode(old_dentry); |
122 | 122 | ||
123 | inode->i_ctime = CURRENT_TIME_SEC; | 123 | inode->i_ctime = current_time(inode); |
124 | inode_inc_link_count(inode); | 124 | inode_inc_link_count(inode); |
125 | ihold(inode); | 125 | ihold(inode); |
126 | 126 | ||
@@ -206,7 +206,8 @@ static int sysv_rmdir(struct inode * dir, struct dentry * dentry) | |||
206 | * higher-level routines. | 206 | * higher-level routines. |
207 | */ | 207 | */ |
208 | static int sysv_rename(struct inode * old_dir, struct dentry * old_dentry, | 208 | static int sysv_rename(struct inode * old_dir, struct dentry * old_dentry, |
209 | struct inode * new_dir, struct dentry * new_dentry) | 209 | struct inode * new_dir, struct dentry * new_dentry, |
210 | unsigned int flags) | ||
210 | { | 211 | { |
211 | struct inode * old_inode = d_inode(old_dentry); | 212 | struct inode * old_inode = d_inode(old_dentry); |
212 | struct inode * new_inode = d_inode(new_dentry); | 213 | struct inode * new_inode = d_inode(new_dentry); |
@@ -216,6 +217,9 @@ static int sysv_rename(struct inode * old_dir, struct dentry * old_dentry, | |||
216 | struct sysv_dir_entry * old_de; | 217 | struct sysv_dir_entry * old_de; |
217 | int err = -ENOENT; | 218 | int err = -ENOENT; |
218 | 219 | ||
220 | if (flags & ~RENAME_NOREPLACE) | ||
221 | return -EINVAL; | ||
222 | |||
219 | old_de = sysv_find_entry(old_dentry, &old_page); | 223 | old_de = sysv_find_entry(old_dentry, &old_page); |
220 | if (!old_de) | 224 | if (!old_de) |
221 | goto out; | 225 | goto out; |
@@ -240,7 +244,7 @@ static int sysv_rename(struct inode * old_dir, struct dentry * old_dentry, | |||
240 | if (!new_de) | 244 | if (!new_de) |
241 | goto out_dir; | 245 | goto out_dir; |
242 | sysv_set_link(new_de, new_page, old_inode); | 246 | sysv_set_link(new_de, new_page, old_inode); |
243 | new_inode->i_ctime = CURRENT_TIME_SEC; | 247 | new_inode->i_ctime = current_time(new_inode); |
244 | if (dir_de) | 248 | if (dir_de) |
245 | drop_nlink(new_inode); | 249 | drop_nlink(new_inode); |
246 | inode_dec_link_count(new_inode); | 250 | inode_dec_link_count(new_inode); |