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/jfs/namei.c | |
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/jfs/namei.c')
-rw-r--r-- | fs/jfs/namei.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c index e420c6088336..b41596d71858 100644 --- a/fs/jfs/namei.c +++ b/fs/jfs/namei.c | |||
@@ -162,7 +162,7 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, umode_t mode, | |||
162 | 162 | ||
163 | mark_inode_dirty(ip); | 163 | mark_inode_dirty(ip); |
164 | 164 | ||
165 | dip->i_ctime = dip->i_mtime = CURRENT_TIME; | 165 | dip->i_ctime = dip->i_mtime = current_time(dip); |
166 | 166 | ||
167 | mark_inode_dirty(dip); | 167 | mark_inode_dirty(dip); |
168 | 168 | ||
@@ -298,7 +298,7 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, umode_t mode) | |||
298 | 298 | ||
299 | /* update parent directory inode */ | 299 | /* update parent directory inode */ |
300 | inc_nlink(dip); /* for '..' from child directory */ | 300 | inc_nlink(dip); /* for '..' from child directory */ |
301 | dip->i_ctime = dip->i_mtime = CURRENT_TIME; | 301 | dip->i_ctime = dip->i_mtime = current_time(dip); |
302 | mark_inode_dirty(dip); | 302 | mark_inode_dirty(dip); |
303 | 303 | ||
304 | rc = txCommit(tid, 2, &iplist[0], 0); | 304 | rc = txCommit(tid, 2, &iplist[0], 0); |
@@ -406,7 +406,7 @@ static int jfs_rmdir(struct inode *dip, struct dentry *dentry) | |||
406 | /* update parent directory's link count corresponding | 406 | /* update parent directory's link count corresponding |
407 | * to ".." entry of the target directory deleted | 407 | * to ".." entry of the target directory deleted |
408 | */ | 408 | */ |
409 | dip->i_ctime = dip->i_mtime = CURRENT_TIME; | 409 | dip->i_ctime = dip->i_mtime = current_time(dip); |
410 | inode_dec_link_count(dip); | 410 | inode_dec_link_count(dip); |
411 | 411 | ||
412 | /* | 412 | /* |
@@ -528,7 +528,7 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry) | |||
528 | 528 | ||
529 | ASSERT(ip->i_nlink); | 529 | ASSERT(ip->i_nlink); |
530 | 530 | ||
531 | ip->i_ctime = dip->i_ctime = dip->i_mtime = CURRENT_TIME; | 531 | ip->i_ctime = dip->i_ctime = dip->i_mtime = current_time(ip); |
532 | mark_inode_dirty(dip); | 532 | mark_inode_dirty(dip); |
533 | 533 | ||
534 | /* update target's inode */ | 534 | /* update target's inode */ |
@@ -838,8 +838,8 @@ static int jfs_link(struct dentry *old_dentry, | |||
838 | 838 | ||
839 | /* update object inode */ | 839 | /* update object inode */ |
840 | inc_nlink(ip); /* for new link */ | 840 | inc_nlink(ip); /* for new link */ |
841 | ip->i_ctime = CURRENT_TIME; | 841 | ip->i_ctime = current_time(ip); |
842 | dir->i_ctime = dir->i_mtime = CURRENT_TIME; | 842 | dir->i_ctime = dir->i_mtime = current_time(dir); |
843 | mark_inode_dirty(dir); | 843 | mark_inode_dirty(dir); |
844 | ihold(ip); | 844 | ihold(ip); |
845 | 845 | ||
@@ -1039,7 +1039,7 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry, | |||
1039 | 1039 | ||
1040 | mark_inode_dirty(ip); | 1040 | mark_inode_dirty(ip); |
1041 | 1041 | ||
1042 | dip->i_ctime = dip->i_mtime = CURRENT_TIME; | 1042 | dip->i_ctime = dip->i_mtime = current_time(dip); |
1043 | mark_inode_dirty(dip); | 1043 | mark_inode_dirty(dip); |
1044 | /* | 1044 | /* |
1045 | * commit update of parent directory and link object | 1045 | * commit update of parent directory and link object |
@@ -1078,7 +1078,8 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry, | |||
1078 | * FUNCTION: rename a file or directory | 1078 | * FUNCTION: rename a file or directory |
1079 | */ | 1079 | */ |
1080 | static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, | 1080 | static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, |
1081 | struct inode *new_dir, struct dentry *new_dentry) | 1081 | struct inode *new_dir, struct dentry *new_dentry, |
1082 | unsigned int flags) | ||
1082 | { | 1083 | { |
1083 | struct btstack btstack; | 1084 | struct btstack btstack; |
1084 | ino_t ino; | 1085 | ino_t ino; |
@@ -1097,6 +1098,8 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1097 | s64 new_size = 0; | 1098 | s64 new_size = 0; |
1098 | int commit_flag; | 1099 | int commit_flag; |
1099 | 1100 | ||
1101 | if (flags & ~RENAME_NOREPLACE) | ||
1102 | return -EINVAL; | ||
1100 | 1103 | ||
1101 | jfs_info("jfs_rename: %pd %pd", old_dentry, new_dentry); | 1104 | jfs_info("jfs_rename: %pd %pd", old_dentry, new_dentry); |
1102 | 1105 | ||
@@ -1215,7 +1218,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1215 | tblk->xflag |= COMMIT_DELETE; | 1218 | tblk->xflag |= COMMIT_DELETE; |
1216 | tblk->u.ip = new_ip; | 1219 | tblk->u.ip = new_ip; |
1217 | } else { | 1220 | } else { |
1218 | new_ip->i_ctime = CURRENT_TIME; | 1221 | new_ip->i_ctime = current_time(new_ip); |
1219 | mark_inode_dirty(new_ip); | 1222 | mark_inode_dirty(new_ip); |
1220 | } | 1223 | } |
1221 | } else { | 1224 | } else { |
@@ -1278,10 +1281,10 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1278 | /* | 1281 | /* |
1279 | * Update ctime on changed/moved inodes & mark dirty | 1282 | * Update ctime on changed/moved inodes & mark dirty |
1280 | */ | 1283 | */ |
1281 | old_ip->i_ctime = CURRENT_TIME; | 1284 | old_ip->i_ctime = current_time(old_ip); |
1282 | mark_inode_dirty(old_ip); | 1285 | mark_inode_dirty(old_ip); |
1283 | 1286 | ||
1284 | new_dir->i_ctime = new_dir->i_mtime = current_fs_time(new_dir->i_sb); | 1287 | new_dir->i_ctime = new_dir->i_mtime = current_time(new_dir); |
1285 | mark_inode_dirty(new_dir); | 1288 | mark_inode_dirty(new_dir); |
1286 | 1289 | ||
1287 | /* Build list of inodes modified by this transaction */ | 1290 | /* Build list of inodes modified by this transaction */ |
@@ -1293,7 +1296,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1293 | 1296 | ||
1294 | if (old_dir != new_dir) { | 1297 | if (old_dir != new_dir) { |
1295 | iplist[ipcount++] = new_dir; | 1298 | iplist[ipcount++] = new_dir; |
1296 | old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME; | 1299 | old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); |
1297 | mark_inode_dirty(old_dir); | 1300 | mark_inode_dirty(old_dir); |
1298 | } | 1301 | } |
1299 | 1302 | ||
@@ -1426,7 +1429,7 @@ static int jfs_mknod(struct inode *dir, struct dentry *dentry, | |||
1426 | 1429 | ||
1427 | mark_inode_dirty(ip); | 1430 | mark_inode_dirty(ip); |
1428 | 1431 | ||
1429 | dir->i_ctime = dir->i_mtime = CURRENT_TIME; | 1432 | dir->i_ctime = dir->i_mtime = current_time(dir); |
1430 | 1433 | ||
1431 | mark_inode_dirty(dir); | 1434 | mark_inode_dirty(dir); |
1432 | 1435 | ||