diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-10 23:16:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-10 23:16:43 -0400 |
commit | 101105b1717f536ca741f940033996302d4ef191 (patch) | |
tree | 12ab41ae1b1b66105e9fa2ea763356d2be7e8b34 /fs/ufs | |
parent | 35ff96dfd3c9aaa921b3e8dcac76b7697f2dcec0 (diff) | |
parent | 3873691e5ab34fa26948643d038a2b98c4437298 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull more vfs updates from Al Viro:
">rename2() work from Miklos + current_time() from Deepa"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
fs: Replace current_fs_time() with current_time()
fs: Replace CURRENT_TIME_SEC with current_time() for inode timestamps
fs: Replace CURRENT_TIME with current_time() for inode timestamps
fs: proc: Delete inode time initializations in proc_alloc_inode()
vfs: Add current_time() api
vfs: add note about i_op->rename changes to porting
fs: rename "rename2" i_op to "rename"
vfs: remove unused i_op->rename
fs: make remaining filesystems use .rename2
libfs: support RENAME_NOREPLACE in simple_rename()
fs: support RENAME_NOREPLACE for local filesystems
ncpfs: fix unused variable warning
Diffstat (limited to 'fs/ufs')
-rw-r--r-- | fs/ufs/dir.c | 6 | ||||
-rw-r--r-- | fs/ufs/ialloc.c | 2 | ||||
-rw-r--r-- | fs/ufs/inode.c | 6 | ||||
-rw-r--r-- | fs/ufs/namei.c | 12 |
4 files changed, 15 insertions, 11 deletions
diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c index fa3bda1a860f..de01b8f2aa78 100644 --- a/fs/ufs/dir.c +++ b/fs/ufs/dir.c | |||
@@ -100,7 +100,7 @@ void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de, | |||
100 | err = ufs_commit_chunk(page, pos, len); | 100 | err = ufs_commit_chunk(page, pos, len); |
101 | ufs_put_page(page); | 101 | ufs_put_page(page); |
102 | if (update_times) | 102 | if (update_times) |
103 | dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; | 103 | dir->i_mtime = dir->i_ctime = current_time(dir); |
104 | mark_inode_dirty(dir); | 104 | mark_inode_dirty(dir); |
105 | } | 105 | } |
106 | 106 | ||
@@ -389,7 +389,7 @@ got_it: | |||
389 | ufs_set_de_type(sb, de, inode->i_mode); | 389 | ufs_set_de_type(sb, de, inode->i_mode); |
390 | 390 | ||
391 | err = ufs_commit_chunk(page, pos, rec_len); | 391 | err = ufs_commit_chunk(page, pos, rec_len); |
392 | dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; | 392 | dir->i_mtime = dir->i_ctime = current_time(dir); |
393 | 393 | ||
394 | mark_inode_dirty(dir); | 394 | mark_inode_dirty(dir); |
395 | /* OFFSET_CACHE */ | 395 | /* OFFSET_CACHE */ |
@@ -530,7 +530,7 @@ int ufs_delete_entry(struct inode *inode, struct ufs_dir_entry *dir, | |||
530 | pde->d_reclen = cpu_to_fs16(sb, to - from); | 530 | pde->d_reclen = cpu_to_fs16(sb, to - from); |
531 | dir->d_ino = 0; | 531 | dir->d_ino = 0; |
532 | err = ufs_commit_chunk(page, pos, to - from); | 532 | err = ufs_commit_chunk(page, pos, to - from); |
533 | inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC; | 533 | inode->i_ctime = inode->i_mtime = current_time(inode); |
534 | mark_inode_dirty(inode); | 534 | mark_inode_dirty(inode); |
535 | out: | 535 | out: |
536 | ufs_put_page(page); | 536 | ufs_put_page(page); |
diff --git a/fs/ufs/ialloc.c b/fs/ufs/ialloc.c index fd0203ce1f7f..9774555b3721 100644 --- a/fs/ufs/ialloc.c +++ b/fs/ufs/ialloc.c | |||
@@ -290,7 +290,7 @@ cg_found: | |||
290 | inode_init_owner(inode, dir, mode); | 290 | inode_init_owner(inode, dir, mode); |
291 | inode->i_blocks = 0; | 291 | inode->i_blocks = 0; |
292 | inode->i_generation = 0; | 292 | inode->i_generation = 0; |
293 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC; | 293 | inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); |
294 | ufsi->i_flags = UFS_I(dir)->i_flags; | 294 | ufsi->i_flags = UFS_I(dir)->i_flags; |
295 | ufsi->i_lastfrag = 0; | 295 | ufsi->i_lastfrag = 0; |
296 | ufsi->i_shadow = 0; | 296 | ufsi->i_shadow = 0; |
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index e4a4d248a0f5..190d64be22ed 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c | |||
@@ -293,7 +293,7 @@ ufs_inode_getfrag(struct inode *inode, unsigned index, | |||
293 | 293 | ||
294 | if (new) | 294 | if (new) |
295 | *new = 1; | 295 | *new = 1; |
296 | inode->i_ctime = CURRENT_TIME_SEC; | 296 | inode->i_ctime = current_time(inode); |
297 | if (IS_SYNC(inode)) | 297 | if (IS_SYNC(inode)) |
298 | ufs_sync_inode (inode); | 298 | ufs_sync_inode (inode); |
299 | mark_inode_dirty(inode); | 299 | mark_inode_dirty(inode); |
@@ -375,7 +375,7 @@ ufs_inode_getblock(struct inode *inode, u64 ind_block, | |||
375 | mark_buffer_dirty(bh); | 375 | mark_buffer_dirty(bh); |
376 | if (IS_SYNC(inode)) | 376 | if (IS_SYNC(inode)) |
377 | sync_dirty_buffer(bh); | 377 | sync_dirty_buffer(bh); |
378 | inode->i_ctime = CURRENT_TIME_SEC; | 378 | inode->i_ctime = current_time(inode); |
379 | mark_inode_dirty(inode); | 379 | mark_inode_dirty(inode); |
380 | out: | 380 | out: |
381 | brelse (bh); | 381 | brelse (bh); |
@@ -1185,7 +1185,7 @@ static int ufs_truncate(struct inode *inode, loff_t size) | |||
1185 | truncate_setsize(inode, size); | 1185 | truncate_setsize(inode, size); |
1186 | 1186 | ||
1187 | __ufs_truncate_blocks(inode); | 1187 | __ufs_truncate_blocks(inode); |
1188 | inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC; | 1188 | inode->i_mtime = inode->i_ctime = current_time(inode); |
1189 | mark_inode_dirty(inode); | 1189 | mark_inode_dirty(inode); |
1190 | out: | 1190 | out: |
1191 | UFSD("EXIT: err %d\n", err); | 1191 | UFSD("EXIT: err %d\n", err); |
diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c index a1559f762805..8eca4eda8450 100644 --- a/fs/ufs/namei.c +++ b/fs/ufs/namei.c | |||
@@ -153,7 +153,7 @@ static int ufs_link (struct dentry * old_dentry, struct inode * dir, | |||
153 | struct inode *inode = d_inode(old_dentry); | 153 | struct inode *inode = d_inode(old_dentry); |
154 | int error; | 154 | int error; |
155 | 155 | ||
156 | inode->i_ctime = CURRENT_TIME_SEC; | 156 | inode->i_ctime = current_time(inode); |
157 | inode_inc_link_count(inode); | 157 | inode_inc_link_count(inode); |
158 | ihold(inode); | 158 | ihold(inode); |
159 | 159 | ||
@@ -245,7 +245,8 @@ static int ufs_rmdir (struct inode * dir, struct dentry *dentry) | |||
245 | } | 245 | } |
246 | 246 | ||
247 | static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry, | 247 | static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry, |
248 | struct inode *new_dir, struct dentry *new_dentry) | 248 | struct inode *new_dir, struct dentry *new_dentry, |
249 | unsigned int flags) | ||
249 | { | 250 | { |
250 | struct inode *old_inode = d_inode(old_dentry); | 251 | struct inode *old_inode = d_inode(old_dentry); |
251 | struct inode *new_inode = d_inode(new_dentry); | 252 | struct inode *new_inode = d_inode(new_dentry); |
@@ -255,6 +256,9 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
255 | struct ufs_dir_entry *old_de; | 256 | struct ufs_dir_entry *old_de; |
256 | int err = -ENOENT; | 257 | int err = -ENOENT; |
257 | 258 | ||
259 | if (flags & ~RENAME_NOREPLACE) | ||
260 | return -EINVAL; | ||
261 | |||
258 | old_de = ufs_find_entry(old_dir, &old_dentry->d_name, &old_page); | 262 | old_de = ufs_find_entry(old_dir, &old_dentry->d_name, &old_page); |
259 | if (!old_de) | 263 | if (!old_de) |
260 | goto out; | 264 | goto out; |
@@ -279,7 +283,7 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
279 | if (!new_de) | 283 | if (!new_de) |
280 | goto out_dir; | 284 | goto out_dir; |
281 | ufs_set_link(new_dir, new_de, new_page, old_inode, 1); | 285 | ufs_set_link(new_dir, new_de, new_page, old_inode, 1); |
282 | new_inode->i_ctime = CURRENT_TIME_SEC; | 286 | new_inode->i_ctime = current_time(new_inode); |
283 | if (dir_de) | 287 | if (dir_de) |
284 | drop_nlink(new_inode); | 288 | drop_nlink(new_inode); |
285 | inode_dec_link_count(new_inode); | 289 | inode_dec_link_count(new_inode); |
@@ -295,7 +299,7 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
295 | * Like most other Unix systems, set the ctime for inodes on a | 299 | * Like most other Unix systems, set the ctime for inodes on a |
296 | * rename. | 300 | * rename. |
297 | */ | 301 | */ |
298 | old_inode->i_ctime = CURRENT_TIME_SEC; | 302 | old_inode->i_ctime = current_time(old_inode); |
299 | 303 | ||
300 | ufs_delete_entry(old_dir, old_de, old_page); | 304 | ufs_delete_entry(old_dir, old_de, old_page); |
301 | mark_inode_dirty(old_inode); | 305 | mark_inode_dirty(old_inode); |