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/omfs | |
| 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/omfs')
| -rw-r--r-- | fs/omfs/dir.c | 10 | ||||
| -rw-r--r-- | fs/omfs/inode.c | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/fs/omfs/dir.c b/fs/omfs/dir.c index c8cbf3b60645..b7146526afff 100644 --- a/fs/omfs/dir.c +++ b/fs/omfs/dir.c | |||
| @@ -143,7 +143,7 @@ static int omfs_add_link(struct dentry *dentry, struct inode *inode) | |||
| 143 | mark_buffer_dirty(bh); | 143 | mark_buffer_dirty(bh); |
| 144 | brelse(bh); | 144 | brelse(bh); |
| 145 | 145 | ||
| 146 | dir->i_ctime = CURRENT_TIME_SEC; | 146 | dir->i_ctime = current_time(dir); |
| 147 | 147 | ||
| 148 | /* mark affected inodes dirty to rebuild checksums */ | 148 | /* mark affected inodes dirty to rebuild checksums */ |
| 149 | mark_inode_dirty(dir); | 149 | mark_inode_dirty(dir); |
| @@ -371,12 +371,16 @@ static bool omfs_fill_chain(struct inode *dir, struct dir_context *ctx, | |||
| 371 | } | 371 | } |
| 372 | 372 | ||
| 373 | static int omfs_rename(struct inode *old_dir, struct dentry *old_dentry, | 373 | static int omfs_rename(struct inode *old_dir, struct dentry *old_dentry, |
| 374 | struct inode *new_dir, struct dentry *new_dentry) | 374 | struct inode *new_dir, struct dentry *new_dentry, |
| 375 | unsigned int flags) | ||
| 375 | { | 376 | { |
| 376 | struct inode *new_inode = d_inode(new_dentry); | 377 | struct inode *new_inode = d_inode(new_dentry); |
| 377 | struct inode *old_inode = d_inode(old_dentry); | 378 | struct inode *old_inode = d_inode(old_dentry); |
| 378 | int err; | 379 | int err; |
| 379 | 380 | ||
| 381 | if (flags & ~RENAME_NOREPLACE) | ||
| 382 | return -EINVAL; | ||
| 383 | |||
| 380 | if (new_inode) { | 384 | if (new_inode) { |
| 381 | /* overwriting existing file/dir */ | 385 | /* overwriting existing file/dir */ |
| 382 | err = omfs_remove(new_dir, new_dentry); | 386 | err = omfs_remove(new_dir, new_dentry); |
| @@ -395,7 +399,7 @@ static int omfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
| 395 | if (err) | 399 | if (err) |
| 396 | goto out; | 400 | goto out; |
| 397 | 401 | ||
| 398 | old_inode->i_ctime = CURRENT_TIME_SEC; | 402 | old_inode->i_ctime = current_time(old_inode); |
| 399 | mark_inode_dirty(old_inode); | 403 | mark_inode_dirty(old_inode); |
| 400 | out: | 404 | out: |
| 401 | return err; | 405 | return err; |
diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index 3d935c81789a..df7ea8543a2e 100644 --- a/fs/omfs/inode.c +++ b/fs/omfs/inode.c | |||
| @@ -49,7 +49,7 @@ struct inode *omfs_new_inode(struct inode *dir, umode_t mode) | |||
| 49 | inode_init_owner(inode, NULL, mode); | 49 | inode_init_owner(inode, NULL, mode); |
| 50 | inode->i_mapping->a_ops = &omfs_aops; | 50 | inode->i_mapping->a_ops = &omfs_aops; |
| 51 | 51 | ||
| 52 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 52 | inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); |
| 53 | switch (mode & S_IFMT) { | 53 | switch (mode & S_IFMT) { |
| 54 | case S_IFDIR: | 54 | case S_IFDIR: |
| 55 | inode->i_op = &omfs_dir_inops; | 55 | inode->i_op = &omfs_dir_inops; |
