Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+587 -449
+2 -6
Documentation/filesystems/Locking
··· 51 51 int (*rmdir) (struct inode *,struct dentry *); 52 52 int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t); 53 53 int (*rename) (struct inode *, struct dentry *, 54 - struct inode *, struct dentry *); 55 - int (*rename2) (struct inode *, struct dentry *, 56 54 struct inode *, struct dentry *, unsigned int); 57 55 int (*readlink) (struct dentry *, char __user *,int); 58 56 const char *(*get_link) (struct dentry *, struct inode *, void **); ··· 78 80 mkdir: yes 79 81 unlink: yes (both) 80 82 rmdir: yes (both) (see below) 81 - rename: yes (all) (see below) 82 - rename2: yes (all) (see below) 83 + rename: yes (all) (see below) 83 84 readlink: no 84 85 get_link: no 85 86 setattr: yes ··· 94 97 95 98 Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on 96 99 victim. 97 - cross-directory ->rename() and rename2() has (per-superblock) 98 - ->s_vfs_rename_sem. 100 + cross-directory ->rename() has (per-superblock) ->s_vfs_rename_sem. 99 101 100 102 See Documentation/filesystems/directory-locking for more detailed discussion 101 103 of the locking scheme for directory operations.
+1 -1
Documentation/filesystems/directory-locking
··· 19 19 20 20 4) rename() that is _not_ cross-directory. Locking rules: caller locks 21 21 the parent and finds source and target. In case of exchange (with 22 - RENAME_EXCHANGE in rename2() flags argument) lock both. In any case, 22 + RENAME_EXCHANGE in flags argument) lock both. In any case, 23 23 if the target already exists, lock it. If the source is a non-directory, 24 24 lock it. If we need to lock both, lock them in inode pointer order. 25 25 Then call the method. All locks are exclusive.
+4
Documentation/filesystems/porting
··· 592 592 work just as well; if it's something more complicated, use dentry->d_parent. 593 593 Just be careful not to assume that fetching it more than once will yield 594 594 the same value - in RCU mode it could change under you. 595 + -- 596 + [mandatory] 597 + ->rename() has an added flags argument. Any flags not handled by the 598 + filesystem should result in EINVAL being returned.
+2 -7
Documentation/filesystems/vfs.txt
··· 375 375 int (*rmdir) (struct inode *,struct dentry *); 376 376 int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t); 377 377 int (*rename) (struct inode *, struct dentry *, 378 - struct inode *, struct dentry *); 379 - int (*rename2) (struct inode *, struct dentry *, 380 378 struct inode *, struct dentry *, unsigned int); 381 379 int (*readlink) (struct dentry *, char __user *,int); 382 380 const char *(*get_link) (struct dentry *, struct inode *, ··· 440 442 rename: called by the rename(2) system call to rename the object to 441 443 have the parent and name given by the second inode and dentry. 442 444 443 - rename2: this has an additional flags argument compared to rename. 444 - If no flags are supported by the filesystem then this method 445 - need not be implemented. If some flags are supported then the 446 - filesystem must return -EINVAL for any unsupported or unknown 447 - flags. Currently the following flags are implemented: 445 + The filesystem must return -EINVAL for any unsupported or 446 + unknown flags. Currently the following flags are implemented: 448 447 (1) RENAME_NOREPLACE: this flag indicates that if the target 449 448 of the rename exists the rename should fail with -EEXIST 450 449 instead of replacing the target. The VFS already checks for
+1 -1
arch/powerpc/platforms/cell/spufs/inode.c
··· 103 103 inode->i_mode = mode; 104 104 inode->i_uid = current_fsuid(); 105 105 inode->i_gid = current_fsgid(); 106 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 106 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 107 107 out: 108 108 return inode; 109 109 }
+2 -2
arch/s390/hypfs/inode.c
··· 51 51 struct inode *inode = d_inode(sb_info->update_file); 52 52 53 53 sb_info->last_update = get_seconds(); 54 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 54 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 55 55 } 56 56 57 57 /* directory tree removal functions */ ··· 99 99 ret->i_mode = mode; 100 100 ret->i_uid = hypfs_info->uid; 101 101 ret->i_gid = hypfs_info->gid; 102 - ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME; 102 + ret->i_atime = ret->i_mtime = ret->i_ctime = current_time(ret); 103 103 if (S_ISDIR(mode)) 104 104 set_nlink(ret, 2); 105 105 }
+1 -1
drivers/char/sonypi.c
··· 934 934 935 935 if (ret > 0) { 936 936 struct inode *inode = file_inode(file); 937 - inode->i_atime = current_fs_time(inode->i_sb); 937 + inode->i_atime = current_time(inode); 938 938 } 939 939 940 940 return ret;
+1 -1
drivers/infiniband/hw/qib/qib_fs.c
··· 64 64 inode->i_uid = GLOBAL_ROOT_UID; 65 65 inode->i_gid = GLOBAL_ROOT_GID; 66 66 inode->i_blocks = 0; 67 - inode->i_atime = CURRENT_TIME; 67 + inode->i_atime = current_time(inode); 68 68 inode->i_mtime = inode->i_atime; 69 69 inode->i_ctime = inode->i_atime; 70 70 inode->i_private = data;
+1 -1
drivers/misc/ibmasm/ibmasmfs.c
··· 144 144 if (ret) { 145 145 ret->i_ino = get_next_ino(); 146 146 ret->i_mode = mode; 147 - ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME; 147 + ret->i_atime = ret->i_mtime = ret->i_ctime = current_time(ret); 148 148 } 149 149 return ret; 150 150 }
+1 -1
drivers/oprofile/oprofilefs.c
··· 30 30 if (inode) { 31 31 inode->i_ino = get_next_ino(); 32 32 inode->i_mode = mode; 33 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 33 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 34 34 } 35 35 return inode; 36 36 }
+1 -1
drivers/platform/x86/sony-laptop.c
··· 4116 4116 4117 4117 if (ret > 0) { 4118 4118 struct inode *inode = file_inode(file); 4119 - inode->i_atime = current_fs_time(inode->i_sb); 4119 + inode->i_atime = current_time(inode); 4120 4120 } 4121 4121 4122 4122 return ret;
+6 -2
drivers/staging/lustre/lustre/llite/namei.c
··· 1097 1097 } 1098 1098 1099 1099 static int ll_rename(struct inode *src, struct dentry *src_dchild, 1100 - struct inode *tgt, struct dentry *tgt_dchild) 1100 + struct inode *tgt, struct dentry *tgt_dchild, 1101 + unsigned int flags) 1101 1102 { 1102 1103 struct ptlrpc_request *request = NULL; 1103 1104 struct ll_sb_info *sbi = ll_i2sbi(src); 1104 1105 struct md_op_data *op_data; 1105 1106 int err; 1107 + 1108 + if (flags) 1109 + return -EINVAL; 1106 1110 1107 1111 CDEBUG(D_VFSTRACE, 1108 1112 "VFS Op:oldname=%pd, src_dir="DFID"(%p), newname=%pd, tgt_dir="DFID"(%p)\n", ··· 1152 1148 .rmdir = ll_rmdir, 1153 1149 .symlink = ll_symlink, 1154 1150 .link = ll_link, 1155 - .rename = ll_rename, 1151 + .rename = ll_rename, 1156 1152 .setattr = ll_setattr, 1157 1153 .getattr = ll_getattr, 1158 1154 .permission = ll_inode_permission,
+9 -9
drivers/usb/core/devio.c
··· 2409 2409 snoop(&dev->dev, "%s: CONTROL\n", __func__); 2410 2410 ret = proc_control(ps, p); 2411 2411 if (ret >= 0) 2412 - inode->i_mtime = CURRENT_TIME; 2412 + inode->i_mtime = current_time(inode); 2413 2413 break; 2414 2414 2415 2415 case USBDEVFS_BULK: 2416 2416 snoop(&dev->dev, "%s: BULK\n", __func__); 2417 2417 ret = proc_bulk(ps, p); 2418 2418 if (ret >= 0) 2419 - inode->i_mtime = CURRENT_TIME; 2419 + inode->i_mtime = current_time(inode); 2420 2420 break; 2421 2421 2422 2422 case USBDEVFS_RESETEP: 2423 2423 snoop(&dev->dev, "%s: RESETEP\n", __func__); 2424 2424 ret = proc_resetep(ps, p); 2425 2425 if (ret >= 0) 2426 - inode->i_mtime = CURRENT_TIME; 2426 + inode->i_mtime = current_time(inode); 2427 2427 break; 2428 2428 2429 2429 case USBDEVFS_RESET: ··· 2435 2435 snoop(&dev->dev, "%s: CLEAR_HALT\n", __func__); 2436 2436 ret = proc_clearhalt(ps, p); 2437 2437 if (ret >= 0) 2438 - inode->i_mtime = CURRENT_TIME; 2438 + inode->i_mtime = current_time(inode); 2439 2439 break; 2440 2440 2441 2441 case USBDEVFS_GETDRIVER: ··· 2462 2462 snoop(&dev->dev, "%s: SUBMITURB\n", __func__); 2463 2463 ret = proc_submiturb(ps, p); 2464 2464 if (ret >= 0) 2465 - inode->i_mtime = CURRENT_TIME; 2465 + inode->i_mtime = current_time(inode); 2466 2466 break; 2467 2467 2468 2468 #ifdef CONFIG_COMPAT ··· 2470 2470 snoop(&dev->dev, "%s: CONTROL32\n", __func__); 2471 2471 ret = proc_control_compat(ps, p); 2472 2472 if (ret >= 0) 2473 - inode->i_mtime = CURRENT_TIME; 2473 + inode->i_mtime = current_time(inode); 2474 2474 break; 2475 2475 2476 2476 case USBDEVFS_BULK32: 2477 2477 snoop(&dev->dev, "%s: BULK32\n", __func__); 2478 2478 ret = proc_bulk_compat(ps, p); 2479 2479 if (ret >= 0) 2480 - inode->i_mtime = CURRENT_TIME; 2480 + inode->i_mtime = current_time(inode); 2481 2481 break; 2482 2482 2483 2483 case USBDEVFS_DISCSIGNAL32: ··· 2489 2489 snoop(&dev->dev, "%s: SUBMITURB32\n", __func__); 2490 2490 ret = proc_submiturb_compat(ps, p); 2491 2491 if (ret >= 0) 2492 - inode->i_mtime = CURRENT_TIME; 2492 + inode->i_mtime = current_time(inode); 2493 2493 break; 2494 2494 2495 2495 case USBDEVFS_IOCTL32: ··· 2552 2552 done: 2553 2553 usb_unlock_device(dev); 2554 2554 if (ret >= 0) 2555 - inode->i_atime = CURRENT_TIME; 2555 + inode->i_atime = current_time(inode); 2556 2556 return ret; 2557 2557 } 2558 2558
+4 -4
drivers/usb/gadget/function/f_fs.c
··· 1196 1196 inode = new_inode(sb); 1197 1197 1198 1198 if (likely(inode)) { 1199 - struct timespec current_time = CURRENT_TIME; 1199 + struct timespec ts = current_time(inode); 1200 1200 1201 1201 inode->i_ino = get_next_ino(); 1202 1202 inode->i_mode = perms->mode; 1203 1203 inode->i_uid = perms->uid; 1204 1204 inode->i_gid = perms->gid; 1205 - inode->i_atime = current_time; 1206 - inode->i_mtime = current_time; 1207 - inode->i_ctime = current_time; 1205 + inode->i_atime = ts; 1206 + inode->i_mtime = ts; 1207 + inode->i_ctime = ts; 1208 1208 inode->i_private = data; 1209 1209 if (fops) 1210 1210 inode->i_fop = fops;
+1 -1
drivers/usb/gadget/legacy/inode.c
··· 1913 1913 inode->i_uid = make_kuid(&init_user_ns, default_uid); 1914 1914 inode->i_gid = make_kgid(&init_user_ns, default_gid); 1915 1915 inode->i_atime = inode->i_mtime = inode->i_ctime 1916 - = CURRENT_TIME; 1916 + = current_time(inode); 1917 1917 inode->i_private = data; 1918 1918 inode->i_fop = fops; 1919 1919 }
+2 -1
fs/9p/v9fs.h
··· 148 148 extern int v9fs_vfs_unlink(struct inode *i, struct dentry *d); 149 149 extern int v9fs_vfs_rmdir(struct inode *i, struct dentry *d); 150 150 extern int v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry, 151 - struct inode *new_dir, struct dentry *new_dentry); 151 + struct inode *new_dir, struct dentry *new_dentry, 152 + unsigned int flags); 152 153 extern struct inode *v9fs_inode_from_fid(struct v9fs_session_info *v9ses, 153 154 struct p9_fid *fid, 154 155 struct super_block *sb, int new);
+6 -2
fs/9p/vfs_inode.c
··· 276 276 inode_init_owner(inode, NULL, mode); 277 277 inode->i_blocks = 0; 278 278 inode->i_rdev = rdev; 279 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 279 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 280 280 inode->i_mapping->a_ops = &v9fs_addr_operations; 281 281 282 282 switch (mode & S_IFMT) { ··· 955 955 956 956 int 957 957 v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry, 958 - struct inode *new_dir, struct dentry *new_dentry) 958 + struct inode *new_dir, struct dentry *new_dentry, 959 + unsigned int flags) 959 960 { 960 961 int retval; 961 962 struct inode *old_inode; ··· 966 965 struct p9_fid *olddirfid; 967 966 struct p9_fid *newdirfid; 968 967 struct p9_wstat wstat; 968 + 969 + if (flags) 970 + return -EINVAL; 969 971 970 972 p9_debug(P9_DEBUG_VFS, "\n"); 971 973 retval = 0;
+1 -1
fs/adfs/inode.c
··· 199 199 return; 200 200 201 201 cur_time: 202 - *tv = CURRENT_TIME; 202 + *tv = current_time(inode); 203 203 return; 204 204 205 205 too_early:
+2 -1
fs/affs/affs.h
··· 173 173 extern int affs_symlink(struct inode *dir, struct dentry *dentry, 174 174 const char *symname); 175 175 extern int affs_rename(struct inode *old_dir, struct dentry *old_dentry, 176 - struct inode *new_dir, struct dentry *new_dentry); 176 + struct inode *new_dir, struct dentry *new_dentry, 177 + unsigned int flags); 177 178 178 179 /* inode.c */ 179 180
+3 -3
fs/affs/amigaffs.c
··· 58 58 mark_buffer_dirty_inode(dir_bh, dir); 59 59 affs_brelse(dir_bh); 60 60 61 - dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; 61 + dir->i_mtime = dir->i_ctime = current_time(dir); 62 62 dir->i_version++; 63 63 mark_inode_dirty(dir); 64 64 ··· 112 112 113 113 affs_brelse(bh); 114 114 115 - dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; 115 + dir->i_mtime = dir->i_ctime = current_time(dir); 116 116 dir->i_version++; 117 117 mark_inode_dirty(dir); 118 118 ··· 313 313 else 314 314 clear_nlink(inode); 315 315 affs_unlock_link(inode); 316 - inode->i_ctime = CURRENT_TIME_SEC; 316 + inode->i_ctime = current_time(inode); 317 317 mark_inode_dirty(inode); 318 318 319 319 done:
+1 -1
fs/affs/inode.c
··· 309 309 inode->i_gid = current_fsgid(); 310 310 inode->i_ino = block; 311 311 set_nlink(inode, 1); 312 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC; 312 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 313 313 atomic_set(&AFFS_I(inode)->i_opencnt, 0); 314 314 AFFS_I(inode)->i_blkcnt = 0; 315 315 AFFS_I(inode)->i_lc = NULL;
+5 -1
fs/affs/namei.c
··· 414 414 415 415 int 416 416 affs_rename(struct inode *old_dir, struct dentry *old_dentry, 417 - struct inode *new_dir, struct dentry *new_dentry) 417 + struct inode *new_dir, struct dentry *new_dentry, 418 + unsigned int flags) 418 419 { 419 420 struct super_block *sb = old_dir->i_sb; 420 421 struct buffer_head *bh = NULL; 421 422 int retval; 423 + 424 + if (flags & ~RENAME_NOREPLACE) 425 + return -EINVAL; 422 426 423 427 pr_debug("%s(old=%lu,\"%pd\" to new=%lu,\"%pd\")\n", __func__, 424 428 old_dir->i_ino, old_dentry, new_dir->i_ino, new_dentry);
+7 -2
fs/afs/dir.c
··· 38 38 static int afs_symlink(struct inode *dir, struct dentry *dentry, 39 39 const char *content); 40 40 static int afs_rename(struct inode *old_dir, struct dentry *old_dentry, 41 - struct inode *new_dir, struct dentry *new_dentry); 41 + struct inode *new_dir, struct dentry *new_dentry, 42 + unsigned int flags); 42 43 43 44 const struct file_operations afs_dir_file_operations = { 44 45 .open = afs_dir_open, ··· 1084 1083 * rename a file in an AFS filesystem and/or move it between directories 1085 1084 */ 1086 1085 static int afs_rename(struct inode *old_dir, struct dentry *old_dentry, 1087 - struct inode *new_dir, struct dentry *new_dentry) 1086 + struct inode *new_dir, struct dentry *new_dentry, 1087 + unsigned int flags) 1088 1088 { 1089 1089 struct afs_vnode *orig_dvnode, *new_dvnode, *vnode; 1090 1090 struct key *key; 1091 1091 int ret; 1092 + 1093 + if (flags) 1094 + return -EINVAL; 1092 1095 1093 1096 vnode = AFS_FS_I(d_inode(old_dentry)); 1094 1097 orig_dvnode = AFS_FS_I(old_dir);
+1 -1
fs/attr.c
··· 237 237 inode->i_flags &= ~S_NOSEC; 238 238 } 239 239 240 - now = current_fs_time(inode->i_sb); 240 + now = current_time(inode); 241 241 242 242 attr->ia_ctime = now; 243 243 if (!(ia_valid & ATTR_ATIME_SET))
+1 -1
fs/autofs4/inode.c
··· 359 359 inode->i_uid = d_inode(sb->s_root)->i_uid; 360 360 inode->i_gid = d_inode(sb->s_root)->i_gid; 361 361 } 362 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 362 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 363 363 inode->i_ino = get_next_ino(); 364 364 365 365 if (S_ISDIR(mode)) {
+3 -3
fs/autofs4/root.c
··· 591 591 if (p_ino && !IS_ROOT(dentry)) 592 592 atomic_inc(&p_ino->count); 593 593 594 - dir->i_mtime = CURRENT_TIME; 594 + dir->i_mtime = current_time(dir); 595 595 596 596 return 0; 597 597 } ··· 631 631 d_inode(dentry)->i_size = 0; 632 632 clear_nlink(d_inode(dentry)); 633 633 634 - dir->i_mtime = CURRENT_TIME; 634 + dir->i_mtime = current_time(dir); 635 635 636 636 spin_lock(&sbi->lookup_lock); 637 637 __autofs4_add_expiring(dentry); ··· 762 762 if (p_ino && !IS_ROOT(dentry)) 763 763 atomic_inc(&p_ino->count); 764 764 inc_nlink(dir); 765 - dir->i_mtime = CURRENT_TIME; 765 + dir->i_mtime = current_time(dir); 766 766 767 767 return 0; 768 768 }
+2 -2
fs/bad_inode.c
··· 116 116 .mkdir = bad_inode_mkdir, 117 117 .rmdir = bad_inode_rmdir, 118 118 .mknod = bad_inode_mknod, 119 - .rename2 = bad_inode_rename2, 119 + .rename = bad_inode_rename2, 120 120 .readlink = bad_inode_readlink, 121 121 /* follow_link must be no-op, otherwise unmounting this inode 122 122 won't work */ ··· 153 153 154 154 inode->i_mode = S_IFREG; 155 155 inode->i_atime = inode->i_mtime = inode->i_ctime = 156 - current_fs_time(inode->i_sb); 156 + current_time(inode); 157 157 inode->i_op = &bad_inode_ops; 158 158 inode->i_opflags &= ~IOP_XATTR; 159 159 inode->i_fop = &bad_file_ops;
+12 -8
fs/bfs/dir.c
··· 97 97 set_bit(ino, info->si_imap); 98 98 info->si_freei--; 99 99 inode_init_owner(inode, dir, mode); 100 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC; 100 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 101 101 inode->i_blocks = 0; 102 102 inode->i_op = &bfs_file_inops; 103 103 inode->i_fop = &bfs_file_operations; ··· 165 165 return err; 166 166 } 167 167 inc_nlink(inode); 168 - inode->i_ctime = CURRENT_TIME_SEC; 168 + inode->i_ctime = current_time(inode); 169 169 mark_inode_dirty(inode); 170 170 ihold(inode); 171 171 d_instantiate(new, inode); ··· 194 194 } 195 195 de->ino = 0; 196 196 mark_buffer_dirty_inode(bh, dir); 197 - dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; 197 + dir->i_ctime = dir->i_mtime = current_time(dir); 198 198 mark_inode_dirty(dir); 199 199 inode->i_ctime = dir->i_ctime; 200 200 inode_dec_link_count(inode); ··· 207 207 } 208 208 209 209 static int bfs_rename(struct inode *old_dir, struct dentry *old_dentry, 210 - struct inode *new_dir, struct dentry *new_dentry) 210 + struct inode *new_dir, struct dentry *new_dentry, 211 + unsigned int flags) 211 212 { 212 213 struct inode *old_inode, *new_inode; 213 214 struct buffer_head *old_bh, *new_bh; 214 215 struct bfs_dirent *old_de, *new_de; 215 216 struct bfs_sb_info *info; 216 217 int error = -ENOENT; 218 + 219 + if (flags & ~RENAME_NOREPLACE) 220 + return -EINVAL; 217 221 218 222 old_bh = new_bh = NULL; 219 223 old_inode = d_inode(old_dentry); ··· 253 249 goto end_rename; 254 250 } 255 251 old_de->ino = 0; 256 - old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME_SEC; 252 + old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); 257 253 mark_inode_dirty(old_dir); 258 254 if (new_inode) { 259 - new_inode->i_ctime = CURRENT_TIME_SEC; 255 + new_inode->i_ctime = current_time(new_inode); 260 256 inode_dec_link_count(new_inode); 261 257 } 262 258 mark_buffer_dirty_inode(old_bh, old_dir); ··· 304 300 pos = (block - sblock) * BFS_BSIZE + off; 305 301 if (pos >= dir->i_size) { 306 302 dir->i_size += BFS_DIRENT_SIZE; 307 - dir->i_ctime = CURRENT_TIME_SEC; 303 + dir->i_ctime = current_time(dir); 308 304 } 309 - dir->i_mtime = CURRENT_TIME_SEC; 305 + dir->i_mtime = current_time(dir); 310 306 mark_inode_dirty(dir); 311 307 de->ino = cpu_to_le16((u16)ino); 312 308 for (i = 0; i < BFS_NAMELEN; i++)
+1 -1
fs/binfmt_misc.c
··· 584 584 inode->i_ino = get_next_ino(); 585 585 inode->i_mode = mode; 586 586 inode->i_atime = inode->i_mtime = inode->i_ctime = 587 - current_fs_time(inode->i_sb); 587 + current_time(inode); 588 588 } 589 589 return inode; 590 590 }
+3 -3
fs/btrfs/file.c
··· 1757 1757 if (IS_NOCMTIME(inode)) 1758 1758 return; 1759 1759 1760 - now = current_fs_time(inode->i_sb); 1760 + now = current_time(inode); 1761 1761 if (!timespec_equal(&inode->i_mtime, &now)) 1762 1762 inode->i_mtime = now; 1763 1763 ··· 2578 2578 goto out_free; 2579 2579 2580 2580 inode_inc_iversion(inode); 2581 - inode->i_mtime = inode->i_ctime = current_fs_time(inode->i_sb); 2581 + inode->i_mtime = inode->i_ctime = current_time(inode); 2582 2582 2583 2583 trans->block_rsv = &root->fs_info->trans_block_rsv; 2584 2584 ret = btrfs_update_inode(trans, root, inode); ··· 2842 2842 if (IS_ERR(trans)) { 2843 2843 ret = PTR_ERR(trans); 2844 2844 } else { 2845 - inode->i_ctime = current_fs_time(inode->i_sb); 2845 + inode->i_ctime = current_time(inode); 2846 2846 i_size_write(inode, actual_end); 2847 2847 btrfs_ordered_update_i_size(inode, actual_end, NULL); 2848 2848 ret = btrfs_update_inode(trans, root, inode);
+12 -12
fs/btrfs/inode.c
··· 4059 4059 inode_inc_iversion(inode); 4060 4060 inode_inc_iversion(dir); 4061 4061 inode->i_ctime = dir->i_mtime = 4062 - dir->i_ctime = current_fs_time(inode->i_sb); 4062 + dir->i_ctime = current_time(inode); 4063 4063 ret = btrfs_update_inode(trans, root, dir); 4064 4064 out: 4065 4065 return ret; ··· 4202 4202 4203 4203 btrfs_i_size_write(dir, dir->i_size - name_len * 2); 4204 4204 inode_inc_iversion(dir); 4205 - dir->i_mtime = dir->i_ctime = current_fs_time(dir->i_sb); 4205 + dir->i_mtime = dir->i_ctime = current_time(dir); 4206 4206 ret = btrfs_update_inode_fallback(trans, root, dir); 4207 4207 if (ret) 4208 4208 btrfs_abort_transaction(trans, ret); ··· 4965 4965 inode_inc_iversion(inode); 4966 4966 if (!(mask & (ATTR_CTIME | ATTR_MTIME))) 4967 4967 inode->i_ctime = inode->i_mtime = 4968 - current_fs_time(inode->i_sb); 4968 + current_time(inode); 4969 4969 } 4970 4970 4971 4971 if (newsize > oldsize) { ··· 5672 5672 inode->i_op = &btrfs_dir_ro_inode_operations; 5673 5673 inode->i_fop = &simple_dir_operations; 5674 5674 inode->i_mode = S_IFDIR | S_IRUGO | S_IWUSR | S_IXUGO; 5675 - inode->i_mtime = current_fs_time(inode->i_sb); 5675 + inode->i_mtime = current_time(inode); 5676 5676 inode->i_atime = inode->i_mtime; 5677 5677 inode->i_ctime = inode->i_mtime; 5678 5678 BTRFS_I(inode)->i_otime = inode->i_mtime; ··· 6258 6258 inode_init_owner(inode, dir, mode); 6259 6259 inode_set_bytes(inode, 0); 6260 6260 6261 - inode->i_mtime = current_fs_time(inode->i_sb); 6261 + inode->i_mtime = current_time(inode); 6262 6262 inode->i_atime = inode->i_mtime; 6263 6263 inode->i_ctime = inode->i_mtime; 6264 6264 BTRFS_I(inode)->i_otime = inode->i_mtime; ··· 6372 6372 name_len * 2); 6373 6373 inode_inc_iversion(parent_inode); 6374 6374 parent_inode->i_mtime = parent_inode->i_ctime = 6375 - current_fs_time(parent_inode->i_sb); 6375 + current_time(parent_inode); 6376 6376 ret = btrfs_update_inode(trans, root, parent_inode); 6377 6377 if (ret) 6378 6378 btrfs_abort_transaction(trans, ret); ··· 6590 6590 BTRFS_I(inode)->dir_index = 0ULL; 6591 6591 inc_nlink(inode); 6592 6592 inode_inc_iversion(inode); 6593 - inode->i_ctime = current_fs_time(inode->i_sb); 6593 + inode->i_ctime = current_time(inode); 6594 6594 ihold(inode); 6595 6595 set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags); 6596 6596 ··· 9493 9493 struct btrfs_root *dest = BTRFS_I(new_dir)->root; 9494 9494 struct inode *new_inode = new_dentry->d_inode; 9495 9495 struct inode *old_inode = old_dentry->d_inode; 9496 - struct timespec ctime = CURRENT_TIME; 9496 + struct timespec ctime = current_time(old_inode); 9497 9497 struct dentry *parent; 9498 9498 u64 old_ino = btrfs_ino(old_inode); 9499 9499 u64 new_ino = btrfs_ino(new_inode); ··· 9861 9861 inode_inc_iversion(old_inode); 9862 9862 old_dir->i_ctime = old_dir->i_mtime = 9863 9863 new_dir->i_ctime = new_dir->i_mtime = 9864 - old_inode->i_ctime = current_fs_time(old_dir->i_sb); 9864 + old_inode->i_ctime = current_time(old_dir); 9865 9865 9866 9866 if (old_dentry->d_parent != new_dentry->d_parent) 9867 9867 btrfs_record_unlink_dir(trans, old_dir, old_inode, 1); ··· 9886 9886 9887 9887 if (new_inode) { 9888 9888 inode_inc_iversion(new_inode); 9889 - new_inode->i_ctime = current_fs_time(new_inode->i_sb); 9889 + new_inode->i_ctime = current_time(new_inode); 9890 9890 if (unlikely(btrfs_ino(new_inode) == 9891 9891 BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) { 9892 9892 root_objectid = BTRFS_I(new_inode)->location.objectid; ··· 10404 10404 *alloc_hint = ins.objectid + ins.offset; 10405 10405 10406 10406 inode_inc_iversion(inode); 10407 - inode->i_ctime = current_fs_time(inode->i_sb); 10407 + inode->i_ctime = current_time(inode); 10408 10408 BTRFS_I(inode)->flags |= BTRFS_INODE_PREALLOC; 10409 10409 if (!(mode & FALLOC_FL_KEEP_SIZE) && 10410 10410 (actual_len > inode->i_size) && ··· 10552 10552 .link = btrfs_link, 10553 10553 .mkdir = btrfs_mkdir, 10554 10554 .rmdir = btrfs_rmdir, 10555 - .rename2 = btrfs_rename2, 10555 + .rename = btrfs_rename2, 10556 10556 .symlink = btrfs_symlink, 10557 10557 .setattr = btrfs_setattr, 10558 10558 .mknod = btrfs_mknod,
+4 -4
fs/btrfs/ioctl.c
··· 349 349 350 350 btrfs_update_iflags(inode); 351 351 inode_inc_iversion(inode); 352 - inode->i_ctime = current_fs_time(inode->i_sb); 352 + inode->i_ctime = current_time(inode); 353 353 ret = btrfs_update_inode(trans, root, inode); 354 354 355 355 btrfs_end_transaction(trans, root); ··· 445 445 struct btrfs_root *root = BTRFS_I(dir)->root; 446 446 struct btrfs_root *new_root; 447 447 struct btrfs_block_rsv block_rsv; 448 - struct timespec cur_time = current_fs_time(dir->i_sb); 448 + struct timespec cur_time = current_time(dir); 449 449 struct inode *inode; 450 450 int ret; 451 451 int err; ··· 3291 3291 3292 3292 inode_inc_iversion(inode); 3293 3293 if (!no_time_update) 3294 - inode->i_mtime = inode->i_ctime = current_fs_time(inode->i_sb); 3294 + inode->i_mtime = inode->i_ctime = current_time(inode); 3295 3295 /* 3296 3296 * We round up to the block size at eof when determining which 3297 3297 * extents to clone above, but shouldn't round up the file size. ··· 5106 5106 struct btrfs_root *root = BTRFS_I(inode)->root; 5107 5107 struct btrfs_root_item *root_item = &root->root_item; 5108 5108 struct btrfs_trans_handle *trans; 5109 - struct timespec ct = current_fs_time(inode->i_sb); 5109 + struct timespec ct = current_time(inode); 5110 5110 int ret = 0; 5111 5111 int received_uuid_changed; 5112 5112
+2 -2
fs/btrfs/transaction.c
··· 1474 1474 parent_root = BTRFS_I(parent_inode)->root; 1475 1475 record_root_in_trans(trans, parent_root, 0); 1476 1476 1477 - cur_time = current_fs_time(parent_inode->i_sb); 1477 + cur_time = current_time(parent_inode); 1478 1478 1479 1479 /* 1480 1480 * insert the directory item ··· 1630 1630 btrfs_i_size_write(parent_inode, parent_inode->i_size + 1631 1631 dentry->d_name.len * 2); 1632 1632 parent_inode->i_mtime = parent_inode->i_ctime = 1633 - current_fs_time(parent_inode->i_sb); 1633 + current_time(parent_inode); 1634 1634 ret = btrfs_update_inode_fallback(trans, parent_root, parent_inode); 1635 1635 if (ret) { 1636 1636 btrfs_abort_transaction(trans, ret);
+1 -1
fs/btrfs/xattr.c
··· 252 252 goto out; 253 253 254 254 inode_inc_iversion(inode); 255 - inode->i_ctime = current_fs_time(inode->i_sb); 255 + inode->i_ctime = current_time(inode); 256 256 set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags); 257 257 ret = btrfs_update_inode(trans, root, inode); 258 258 BUG_ON(ret);
+1 -2
fs/cachefiles/namei.c
··· 804 804 !d_backing_inode(subdir)->i_op->lookup || 805 805 !d_backing_inode(subdir)->i_op->mkdir || 806 806 !d_backing_inode(subdir)->i_op->create || 807 - (!d_backing_inode(subdir)->i_op->rename && 808 - !d_backing_inode(subdir)->i_op->rename2) || 807 + !d_backing_inode(subdir)->i_op->rename || 809 808 !d_backing_inode(subdir)->i_op->rmdir || 810 809 !d_backing_inode(subdir)->i_op->unlink) 811 810 goto check_error;
+5 -1
fs/ceph/dir.c
··· 1061 1061 } 1062 1062 1063 1063 static int ceph_rename(struct inode *old_dir, struct dentry *old_dentry, 1064 - struct inode *new_dir, struct dentry *new_dentry) 1064 + struct inode *new_dir, struct dentry *new_dentry, 1065 + unsigned int flags) 1065 1066 { 1066 1067 struct ceph_fs_client *fsc = ceph_sb_to_client(old_dir->i_sb); 1067 1068 struct ceph_mds_client *mdsc = fsc->mdsc; 1068 1069 struct ceph_mds_request *req; 1069 1070 int op = CEPH_MDS_OP_RENAME; 1070 1071 int err; 1072 + 1073 + if (flags) 1074 + return -EINVAL; 1071 1075 1072 1076 if (ceph_snap(old_dir) != ceph_snap(new_dir)) 1073 1077 return -EXDEV;
+2 -2
fs/ceph/file.c
··· 886 886 int num_pages = 0; 887 887 int flags; 888 888 int ret; 889 - struct timespec mtime = current_fs_time(inode->i_sb); 889 + struct timespec mtime = current_time(inode); 890 890 size_t count = iov_iter_count(iter); 891 891 loff_t pos = iocb->ki_pos; 892 892 bool write = iov_iter_rw(iter) == WRITE; ··· 1091 1091 int flags; 1092 1092 int check_caps = 0; 1093 1093 int ret; 1094 - struct timespec mtime = current_fs_time(inode->i_sb); 1094 + struct timespec mtime = current_time(inode); 1095 1095 size_t count = iov_iter_count(from); 1096 1096 1097 1097 if (ceph_snap(file_inode(file)) != CEPH_NOSNAP)
+1 -1
fs/ceph/inode.c
··· 2067 2067 if (dirtied) { 2068 2068 inode_dirty_flags = __ceph_mark_dirty_caps(ci, dirtied, 2069 2069 &prealloc_cf); 2070 - inode->i_ctime = current_fs_time(inode->i_sb); 2070 + inode->i_ctime = current_time(inode); 2071 2071 } 2072 2072 2073 2073 release &= issued;
+1 -1
fs/ceph/xattr.c
··· 1034 1034 dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_XATTR_EXCL, 1035 1035 &prealloc_cf); 1036 1036 ci->i_xattrs.dirty = true; 1037 - inode->i_ctime = current_fs_time(inode->i_sb); 1037 + inode->i_ctime = current_time(inode); 1038 1038 } 1039 1039 1040 1040 spin_unlock(&ci->i_ceph_lock);
+1 -1
fs/cifs/cifsfs.c
··· 896 896 .link = cifs_hardlink, 897 897 .mkdir = cifs_mkdir, 898 898 .rmdir = cifs_rmdir, 899 - .rename2 = cifs_rename2, 899 + .rename = cifs_rename2, 900 900 .permission = cifs_permission, 901 901 .setattr = cifs_setattr, 902 902 .symlink = cifs_symlink,
+2 -2
fs/cifs/file.c
··· 1878 1878 write_data, to - from, &offset); 1879 1879 cifsFileInfo_put(open_file); 1880 1880 /* Does mm or vfs already set times? */ 1881 - inode->i_atime = inode->i_mtime = current_fs_time(inode->i_sb); 1881 + inode->i_atime = inode->i_mtime = current_time(inode); 1882 1882 if ((bytes_written > 0) && (offset)) 1883 1883 rc = 0; 1884 1884 else if (bytes_written < 0) ··· 3565 3565 cifs_dbg(FYI, "Bytes read %d\n", rc); 3566 3566 3567 3567 file_inode(file)->i_atime = 3568 - current_fs_time(file_inode(file)->i_sb); 3568 + current_time(file_inode(file)); 3569 3569 3570 3570 if (PAGE_SIZE > rc) 3571 3571 memset(read_data + rc, 0, PAGE_SIZE - rc);
+6 -2
fs/coda/dir.c
··· 109 109 /* optimistically we can also act as if our nose bleeds. The 110 110 * granularity of the mtime is coarse anyways so we might actually be 111 111 * right most of the time. Note: we only do this for directories. */ 112 - dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; 112 + dir->i_mtime = dir->i_ctime = current_time(dir); 113 113 #endif 114 114 } 115 115 ··· 291 291 292 292 /* rename */ 293 293 static int coda_rename(struct inode *old_dir, struct dentry *old_dentry, 294 - struct inode *new_dir, struct dentry *new_dentry) 294 + struct inode *new_dir, struct dentry *new_dentry, 295 + unsigned int flags) 295 296 { 296 297 const char *old_name = old_dentry->d_name.name; 297 298 const char *new_name = new_dentry->d_name.name; 298 299 int old_length = old_dentry->d_name.len; 299 300 int new_length = new_dentry->d_name.len; 300 301 int error; 302 + 303 + if (flags) 304 + return -EINVAL; 301 305 302 306 error = venus_rename(old_dir->i_sb, coda_i2f(old_dir), 303 307 coda_i2f(new_dir), old_length, new_length,
+1 -1
fs/coda/file.c
··· 54 54 ret = vfs_iter_write(cfi->cfi_container, to, &iocb->ki_pos); 55 55 coda_inode->i_size = file_inode(host_file)->i_size; 56 56 coda_inode->i_blocks = (coda_inode->i_size + 511) >> 9; 57 - coda_inode->i_mtime = coda_inode->i_ctime = CURRENT_TIME_SEC; 57 + coda_inode->i_mtime = coda_inode->i_ctime = current_time(coda_inode); 58 58 inode_unlock(coda_inode); 59 59 file_end_write(host_file); 60 60 return ret;
+1 -1
fs/coda/inode.c
··· 271 271 272 272 memset(&vattr, 0, sizeof(vattr)); 273 273 274 - inode->i_ctime = CURRENT_TIME_SEC; 274 + inode->i_ctime = current_time(inode); 275 275 coda_iattr_to_vattr(iattr, &vattr); 276 276 vattr.va_type = C_VNON; /* cannot set type */ 277 277
+3 -3
fs/configfs/inode.c
··· 76 76 sd_iattr->ia_uid = GLOBAL_ROOT_UID; 77 77 sd_iattr->ia_gid = GLOBAL_ROOT_GID; 78 78 sd_iattr->ia_atime = sd_iattr->ia_mtime = 79 - sd_iattr->ia_ctime = current_fs_time(inode->i_sb); 79 + sd_iattr->ia_ctime = current_time(inode); 80 80 sd->s_iattr = sd_iattr; 81 81 } 82 82 /* attributes were changed atleast once in past */ ··· 113 113 { 114 114 inode->i_mode = mode; 115 115 inode->i_atime = inode->i_mtime = 116 - inode->i_ctime = current_fs_time(inode->i_sb); 116 + inode->i_ctime = current_time(inode); 117 117 } 118 118 119 119 static inline void set_inode_attr(struct inode * inode, struct iattr * iattr) ··· 197 197 return -ENOMEM; 198 198 199 199 p_inode = d_inode(dentry->d_parent); 200 - p_inode->i_mtime = p_inode->i_ctime = current_fs_time(p_inode->i_sb); 200 + p_inode->i_mtime = p_inode->i_ctime = current_time(p_inode); 201 201 configfs_set_inode_lock_class(sd, inode); 202 202 203 203 init(inode);
+2 -2
fs/debugfs/inode.c
··· 45 45 if (inode) { 46 46 inode->i_ino = get_next_ino(); 47 47 inode->i_atime = inode->i_mtime = 48 - inode->i_ctime = current_fs_time(sb); 48 + inode->i_ctime = current_time(inode); 49 49 } 50 50 return inode; 51 51 } ··· 748 748 old_name = fsnotify_oldname_init(old_dentry->d_name.name); 749 749 750 750 error = simple_rename(d_inode(old_dir), old_dentry, d_inode(new_dir), 751 - dentry); 751 + dentry, 0); 752 752 if (error) { 753 753 fsnotify_oldname_free(old_name); 754 754 goto exit;
+3 -3
fs/devpts/inode.c
··· 300 300 } 301 301 302 302 inode->i_ino = 2; 303 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 303 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 304 304 305 305 mode = S_IFCHR|opts->ptmxmode; 306 306 init_special_inode(inode, mode, MKDEV(TTYAUX_MAJOR, 2)); ··· 412 412 if (!inode) 413 413 goto fail; 414 414 inode->i_ino = 1; 415 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 415 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 416 416 inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR; 417 417 inode->i_op = &simple_dir_inode_operations; 418 418 inode->i_fop = &simple_dir_operations; ··· 540 540 inode->i_ino = index + 3; 541 541 inode->i_uid = opts->setuid ? opts->uid : current_fsuid(); 542 542 inode->i_gid = opts->setgid ? opts->gid : current_fsgid(); 543 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 543 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 544 544 init_special_inode(inode, S_IFCHR|opts->mode, MKDEV(UNIX98_PTY_SLAVE_MAJOR, index)); 545 545 546 546 sprintf(s, "%d", index);
+5 -1
fs/ecryptfs/inode.c
··· 577 577 578 578 static int 579 579 ecryptfs_rename(struct inode *old_dir, struct dentry *old_dentry, 580 - struct inode *new_dir, struct dentry *new_dentry) 580 + struct inode *new_dir, struct dentry *new_dentry, 581 + unsigned int flags) 581 582 { 582 583 int rc; 583 584 struct dentry *lower_old_dentry; ··· 587 586 struct dentry *lower_new_dir_dentry; 588 587 struct dentry *trap = NULL; 589 588 struct inode *target_inode; 589 + 590 + if (flags) 591 + return -EINVAL; 590 592 591 593 lower_old_dentry = ecryptfs_dentry_to_lower(old_dentry); 592 594 lower_new_dentry = ecryptfs_dentry_to_lower(new_dentry);
+1 -1
fs/efivarfs/inode.c
··· 24 24 if (inode) { 25 25 inode->i_ino = get_next_ino(); 26 26 inode->i_mode = mode; 27 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 27 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 28 28 inode->i_flags = is_removable ? 0 : S_IMMUTABLE; 29 29 switch (mode & S_IFMT) { 30 30 case S_IFREG:
+3 -3
fs/exofs/dir.c
··· 416 416 if (likely(!err)) 417 417 err = exofs_commit_chunk(page, pos, len); 418 418 exofs_put_page(page); 419 - dir->i_mtime = dir->i_ctime = CURRENT_TIME; 419 + dir->i_mtime = dir->i_ctime = current_time(dir); 420 420 mark_inode_dirty(dir); 421 421 return err; 422 422 } ··· 503 503 de->inode_no = cpu_to_le64(inode->i_ino); 504 504 exofs_set_de_type(de, inode); 505 505 err = exofs_commit_chunk(page, pos, rec_len); 506 - dir->i_mtime = dir->i_ctime = CURRENT_TIME; 506 + dir->i_mtime = dir->i_ctime = current_time(dir); 507 507 mark_inode_dirty(dir); 508 508 sbi->s_numfiles++; 509 509 ··· 554 554 dir->inode_no = 0; 555 555 if (likely(!err)) 556 556 err = exofs_commit_chunk(page, pos, to - from); 557 - inode->i_ctime = inode->i_mtime = CURRENT_TIME; 557 + inode->i_ctime = inode->i_mtime = current_time(inode); 558 558 mark_inode_dirty(inode); 559 559 sbi->s_numfiles--; 560 560 out:
+2 -2
fs/exofs/inode.c
··· 1007 1007 struct exofs_sb_info *sbi = inode->i_sb->s_fs_info; 1008 1008 int ret; 1009 1009 1010 - inode->i_mtime = inode->i_ctime = CURRENT_TIME; 1010 + inode->i_mtime = inode->i_ctime = current_time(inode); 1011 1011 1012 1012 ret = ore_truncate(&sbi->layout, &oi->oc, (u64)newsize); 1013 1013 if (likely(!ret)) ··· 1313 1313 inode_init_owner(inode, dir, mode); 1314 1314 inode->i_ino = sbi->s_nextid++; 1315 1315 inode->i_blkbits = EXOFS_BLKSHIFT; 1316 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 1316 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 1317 1317 oi->i_commit_size = inode->i_size = 0; 1318 1318 spin_lock(&sbi->s_next_gen_lock); 1319 1319 inode->i_generation = sbi->s_next_generation++;
+9 -5
fs/exofs/namei.c
··· 142 142 { 143 143 struct inode *inode = d_inode(old_dentry); 144 144 145 - inode->i_ctime = CURRENT_TIME; 145 + inode->i_ctime = current_time(inode); 146 146 inode_inc_link_count(inode); 147 147 ihold(inode); 148 148 ··· 227 227 } 228 228 229 229 static int exofs_rename(struct inode *old_dir, struct dentry *old_dentry, 230 - struct inode *new_dir, struct dentry *new_dentry) 230 + struct inode *new_dir, struct dentry *new_dentry, 231 + unsigned int flags) 231 232 { 232 233 struct inode *old_inode = d_inode(old_dentry); 233 234 struct inode *new_inode = d_inode(new_dentry); ··· 237 236 struct page *old_page; 238 237 struct exofs_dir_entry *old_de; 239 238 int err = -ENOENT; 239 + 240 + if (flags & ~RENAME_NOREPLACE) 241 + return -EINVAL; 240 242 241 243 old_de = exofs_find_entry(old_dir, old_dentry, &old_page); 242 244 if (!old_de) ··· 265 261 if (!new_de) 266 262 goto out_dir; 267 263 err = exofs_set_link(new_dir, new_de, new_page, old_inode); 268 - new_inode->i_ctime = CURRENT_TIME; 264 + new_inode->i_ctime = current_time(new_inode); 269 265 if (dir_de) 270 266 drop_nlink(new_inode); 271 267 inode_dec_link_count(new_inode); ··· 279 275 inode_inc_link_count(new_dir); 280 276 } 281 277 282 - old_inode->i_ctime = CURRENT_TIME; 278 + old_inode->i_ctime = current_time(old_inode); 283 279 284 280 exofs_delete_entry(old_de, old_page); 285 281 mark_inode_dirty(old_inode); ··· 314 310 .mkdir = exofs_mkdir, 315 311 .rmdir = exofs_rmdir, 316 312 .mknod = exofs_mknod, 317 - .rename = exofs_rename, 313 + .rename = exofs_rename, 318 314 .setattr = exofs_setattr, 319 315 }; 320 316
+1 -1
fs/ext2/acl.c
··· 193 193 error = posix_acl_update_mode(inode, &inode->i_mode, &acl); 194 194 if (error) 195 195 return error; 196 - inode->i_ctime = CURRENT_TIME_SEC; 196 + inode->i_ctime = current_time(inode); 197 197 mark_inode_dirty(inode); 198 198 } 199 199 break;
+3 -3
fs/ext2/dir.c
··· 471 471 err = ext2_commit_chunk(page, pos, len); 472 472 ext2_put_page(page); 473 473 if (update_times) 474 - dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; 474 + dir->i_mtime = dir->i_ctime = current_time(dir); 475 475 EXT2_I(dir)->i_flags &= ~EXT2_BTREE_FL; 476 476 mark_inode_dirty(dir); 477 477 } ··· 561 561 de->inode = cpu_to_le32(inode->i_ino); 562 562 ext2_set_de_type (de, inode); 563 563 err = ext2_commit_chunk(page, pos, rec_len); 564 - dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; 564 + dir->i_mtime = dir->i_ctime = current_time(dir); 565 565 EXT2_I(dir)->i_flags &= ~EXT2_BTREE_FL; 566 566 mark_inode_dirty(dir); 567 567 /* OFFSET_CACHE */ ··· 610 610 pde->rec_len = ext2_rec_len_to_disk(to - from); 611 611 dir->inode = 0; 612 612 err = ext2_commit_chunk(page, pos, to - from); 613 - inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC; 613 + inode->i_ctime = inode->i_mtime = current_time(inode); 614 614 EXT2_I(inode)->i_flags &= ~EXT2_BTREE_FL; 615 615 mark_inode_dirty(inode); 616 616 out:
+1 -1
fs/ext2/ialloc.c
··· 556 556 557 557 inode->i_ino = ino; 558 558 inode->i_blocks = 0; 559 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC; 559 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 560 560 memset(ei->i_data, 0, sizeof(ei->i_data)); 561 561 ei->i_flags = 562 562 ext2_mask_flags(mode, EXT2_I(dir)->i_flags & EXT2_FL_INHERITED);
+2 -2
fs/ext2/inode.c
··· 595 595 if (where->bh) 596 596 mark_buffer_dirty_inode(where->bh, inode); 597 597 598 - inode->i_ctime = CURRENT_TIME_SEC; 598 + inode->i_ctime = current_time(inode); 599 599 mark_inode_dirty(inode); 600 600 } 601 601 ··· 1308 1308 __ext2_truncate_blocks(inode, newsize); 1309 1309 dax_sem_up_write(EXT2_I(inode)); 1310 1310 1311 - inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC; 1311 + inode->i_mtime = inode->i_ctime = current_time(inode); 1312 1312 if (inode_needs_sync(inode)) { 1313 1313 sync_mapping_buffers(inode->i_mapping); 1314 1314 sync_inode_metadata(inode, 1);
+2 -2
fs/ext2/ioctl.c
··· 79 79 ei->i_flags = flags; 80 80 81 81 ext2_set_inode_flags(inode); 82 - inode->i_ctime = CURRENT_TIME_SEC; 82 + inode->i_ctime = current_time(inode); 83 83 inode_unlock(inode); 84 84 85 85 mark_inode_dirty(inode); ··· 103 103 } 104 104 105 105 inode_lock(inode); 106 - inode->i_ctime = CURRENT_TIME_SEC; 106 + inode->i_ctime = current_time(inode); 107 107 inode->i_generation = generation; 108 108 inode_unlock(inode); 109 109
+8 -4
fs/ext2/namei.c
··· 221 221 if (err) 222 222 return err; 223 223 224 - inode->i_ctime = CURRENT_TIME_SEC; 224 + inode->i_ctime = current_time(inode); 225 225 inode_inc_link_count(inode); 226 226 ihold(inode); 227 227 ··· 328 328 } 329 329 330 330 static int ext2_rename (struct inode * old_dir, struct dentry * old_dentry, 331 - struct inode * new_dir, struct dentry * new_dentry ) 331 + struct inode * new_dir, struct dentry * new_dentry, 332 + unsigned int flags) 332 333 { 333 334 struct inode * old_inode = d_inode(old_dentry); 334 335 struct inode * new_inode = d_inode(new_dentry); ··· 338 337 struct page * old_page; 339 338 struct ext2_dir_entry_2 * old_de; 340 339 int err; 340 + 341 + if (flags & ~RENAME_NOREPLACE) 342 + return -EINVAL; 341 343 342 344 err = dquot_initialize(old_dir); 343 345 if (err) ··· 376 372 if (!new_de) 377 373 goto out_dir; 378 374 ext2_set_link(new_dir, new_de, new_page, old_inode, 1); 379 - new_inode->i_ctime = CURRENT_TIME_SEC; 375 + new_inode->i_ctime = current_time(new_inode); 380 376 if (dir_de) 381 377 drop_nlink(new_inode); 382 378 inode_dec_link_count(new_inode); ··· 392 388 * Like most other Unix systems, set the ctime for inodes on a 393 389 * rename. 394 390 */ 395 - old_inode->i_ctime = CURRENT_TIME_SEC; 391 + old_inode->i_ctime = current_time(old_inode); 396 392 mark_inode_dirty(old_inode); 397 393 398 394 ext2_delete_entry (old_de, old_page);
+1 -1
fs/ext2/super.c
··· 1543 1543 if (inode->i_size < off+len-towrite) 1544 1544 i_size_write(inode, off+len-towrite); 1545 1545 inode->i_version++; 1546 - inode->i_mtime = inode->i_ctime = CURRENT_TIME; 1546 + inode->i_mtime = inode->i_ctime = current_time(inode); 1547 1547 mark_inode_dirty(inode); 1548 1548 return len - towrite; 1549 1549 }
+1 -1
fs/ext2/xattr.c
··· 691 691 692 692 /* Update the inode. */ 693 693 EXT2_I(inode)->i_file_acl = new_bh ? new_bh->b_blocknr : 0; 694 - inode->i_ctime = CURRENT_TIME_SEC; 694 + inode->i_ctime = current_time(inode); 695 695 if (IS_SYNC(inode)) { 696 696 error = sync_inode_metadata(inode, 1); 697 697 /* In case sync failed due to ENOSPC the inode was actually
+1 -1
fs/ext4/namei.c
··· 3878 3878 .rmdir = ext4_rmdir, 3879 3879 .mknod = ext4_mknod, 3880 3880 .tmpfile = ext4_tmpfile, 3881 - .rename2 = ext4_rename2, 3881 + .rename = ext4_rename2, 3882 3882 .setattr = ext4_setattr, 3883 3883 .listxattr = ext4_listxattr, 3884 3884 .get_acl = ext4_get_acl,
+4 -4
fs/f2fs/dir.c
··· 312 312 f2fs_dentry_kunmap(dir, page); 313 313 set_page_dirty(page); 314 314 315 - dir->i_mtime = dir->i_ctime = CURRENT_TIME; 315 + dir->i_mtime = dir->i_ctime = current_time(dir); 316 316 f2fs_mark_inode_dirty_sync(dir); 317 317 f2fs_put_page(page, 1); 318 318 } ··· 465 465 f2fs_i_links_write(dir, true); 466 466 clear_inode_flag(inode, FI_NEW_INODE); 467 467 } 468 - dir->i_mtime = dir->i_ctime = CURRENT_TIME; 468 + dir->i_mtime = dir->i_ctime = current_time(dir); 469 469 f2fs_mark_inode_dirty_sync(dir); 470 470 471 471 if (F2FS_I(dir)->i_current_depth != current_depth) ··· 683 683 684 684 if (S_ISDIR(inode->i_mode)) 685 685 f2fs_i_links_write(dir, false); 686 - inode->i_ctime = CURRENT_TIME; 686 + inode->i_ctime = current_time(inode); 687 687 688 688 f2fs_i_links_write(inode, false); 689 689 if (S_ISDIR(inode->i_mode)) { ··· 730 730 kunmap(page); /* kunmap - pair of f2fs_find_entry */ 731 731 set_page_dirty(page); 732 732 733 - dir->i_ctime = dir->i_mtime = CURRENT_TIME; 733 + dir->i_ctime = dir->i_mtime = current_time(dir); 734 734 f2fs_mark_inode_dirty_sync(dir); 735 735 736 736 if (inode)
+4 -4
fs/f2fs/file.c
··· 631 631 if (err) 632 632 return err; 633 633 634 - inode->i_mtime = inode->i_ctime = CURRENT_TIME; 634 + inode->i_mtime = inode->i_ctime = current_time(inode); 635 635 f2fs_mark_inode_dirty_sync(inode); 636 636 return 0; 637 637 } ··· 708 708 if (err) 709 709 return err; 710 710 } 711 - inode->i_mtime = inode->i_ctime = CURRENT_TIME; 711 + inode->i_mtime = inode->i_ctime = current_time(inode); 712 712 } 713 713 } 714 714 ··· 1392 1392 } 1393 1393 1394 1394 if (!ret) { 1395 - inode->i_mtime = inode->i_ctime = CURRENT_TIME; 1395 + inode->i_mtime = inode->i_ctime = current_time(inode); 1396 1396 f2fs_mark_inode_dirty_sync(inode); 1397 1397 f2fs_update_time(F2FS_I_SB(inode), REQ_TIME); 1398 1398 } ··· 1484 1484 fi->i_flags = flags; 1485 1485 inode_unlock(inode); 1486 1486 1487 - inode->i_ctime = CURRENT_TIME; 1487 + inode->i_ctime = current_time(inode); 1488 1488 f2fs_set_inode_flags(inode); 1489 1489 out: 1490 1490 mnt_drop_write_file(filp);
+1 -1
fs/f2fs/inline.c
··· 572 572 set_page_dirty(page); 573 573 f2fs_put_page(page, 1); 574 574 575 - dir->i_ctime = dir->i_mtime = CURRENT_TIME; 575 + dir->i_ctime = dir->i_mtime = current_time(dir); 576 576 f2fs_mark_inode_dirty_sync(dir); 577 577 578 578 if (inode)
+7 -7
fs/f2fs/namei.c
··· 46 46 47 47 inode->i_ino = ino; 48 48 inode->i_blocks = 0; 49 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 49 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 50 50 inode->i_generation = sbi->s_next_generation++; 51 51 52 52 err = insert_inode_locked(inode); ··· 182 182 183 183 f2fs_balance_fs(sbi, true); 184 184 185 - inode->i_ctime = CURRENT_TIME; 185 + inode->i_ctime = current_time(inode); 186 186 ihold(inode); 187 187 188 188 set_inode_flag(inode, FI_INC_LINK); ··· 723 723 724 724 f2fs_set_link(new_dir, new_entry, new_page, old_inode); 725 725 726 - new_inode->i_ctime = CURRENT_TIME; 726 + new_inode->i_ctime = current_time(new_inode); 727 727 down_write(&F2FS_I(new_inode)->i_sem); 728 728 if (old_dir_entry) 729 729 f2fs_i_links_write(new_inode, false); ··· 777 777 file_set_enc_name(old_inode); 778 778 up_write(&F2FS_I(old_inode)->i_sem); 779 779 780 - old_inode->i_ctime = CURRENT_TIME; 780 + old_inode->i_ctime = current_time(old_inode); 781 781 f2fs_mark_inode_dirty_sync(old_inode); 782 782 783 783 f2fs_delete_entry(old_entry, old_page, old_dir, NULL); ··· 932 932 file_lost_pino(old_inode); 933 933 up_write(&F2FS_I(old_inode)->i_sem); 934 934 935 - old_dir->i_ctime = CURRENT_TIME; 935 + old_dir->i_ctime = current_time(old_dir); 936 936 if (old_nlink) { 937 937 down_write(&F2FS_I(old_dir)->i_sem); 938 938 f2fs_i_links_write(old_dir, old_nlink > 0); ··· 947 947 file_lost_pino(new_inode); 948 948 up_write(&F2FS_I(new_inode)->i_sem); 949 949 950 - new_dir->i_ctime = CURRENT_TIME; 950 + new_dir->i_ctime = current_time(new_dir); 951 951 if (new_nlink) { 952 952 down_write(&F2FS_I(new_dir)->i_sem); 953 953 f2fs_i_links_write(new_dir, new_nlink > 0); ··· 1093 1093 .mkdir = f2fs_mkdir, 1094 1094 .rmdir = f2fs_rmdir, 1095 1095 .mknod = f2fs_mknod, 1096 - .rename2 = f2fs_rename2, 1096 + .rename = f2fs_rename2, 1097 1097 .tmpfile = f2fs_tmpfile, 1098 1098 .getattr = f2fs_getattr, 1099 1099 .setattr = f2fs_setattr,
+1 -1
fs/f2fs/xattr.c
··· 548 548 549 549 if (is_inode_flag_set(inode, FI_ACL_MODE)) { 550 550 inode->i_mode = F2FS_I(inode)->i_acl_mode; 551 - inode->i_ctime = CURRENT_TIME; 551 + inode->i_ctime = current_time(inode); 552 552 clear_inode_flag(inode, FI_ACL_MODE); 553 553 } 554 554 if (index == F2FS_XATTR_INDEX_ENCRYPTION &&
+1 -1
fs/fat/dir.c
··· 1071 1071 } 1072 1072 } 1073 1073 1074 - dir->i_mtime = dir->i_atime = CURRENT_TIME_SEC; 1074 + dir->i_mtime = dir->i_atime = current_time(dir); 1075 1075 if (IS_DIRSYNC(dir)) 1076 1076 (void)fat_sync_inode(dir); 1077 1077 else
+3 -3
fs/fat/file.c
··· 63 63 64 64 /* Equivalent to a chmod() */ 65 65 ia.ia_valid = ATTR_MODE | ATTR_CTIME; 66 - ia.ia_ctime = current_fs_time(inode->i_sb); 66 + ia.ia_ctime = current_time(inode); 67 67 if (is_dir) 68 68 ia.ia_mode = fat_make_mode(sbi, attr, S_IRWXUGO); 69 69 else { ··· 194 194 if (err) 195 195 goto out; 196 196 197 - inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC; 197 + inode->i_ctime = inode->i_mtime = current_time(inode); 198 198 mark_inode_dirty(inode); 199 199 if (IS_SYNC(inode)) { 200 200 int err2; ··· 297 297 MSDOS_I(inode)->i_logstart = 0; 298 298 } 299 299 MSDOS_I(inode)->i_attrs |= ATTR_ARCH; 300 - inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC; 300 + inode->i_ctime = inode->i_mtime = current_time(inode); 301 301 if (wait) { 302 302 err = fat_sync_inode(inode); 303 303 if (err) {
+1 -1
fs/fat/inode.c
··· 237 237 if (err < len) 238 238 fat_write_failed(mapping, pos + len); 239 239 if (!(err < 0) && !(MSDOS_I(inode)->i_attrs & ATTR_ARCH)) { 240 - inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC; 240 + inode->i_mtime = inode->i_ctime = current_time(inode); 241 241 MSDOS_I(inode)->i_attrs |= ATTR_ARCH; 242 242 mark_inode_dirty(inode); 243 243 }
+11 -7
fs/fat/namei_msdos.c
··· 283 283 goto out; 284 284 } 285 285 286 - ts = CURRENT_TIME_SEC; 286 + ts = current_time(dir); 287 287 err = msdos_add_entry(dir, msdos_name, 0, is_hid, 0, &ts, &sinfo); 288 288 if (err) 289 289 goto out; ··· 330 330 drop_nlink(dir); 331 331 332 332 clear_nlink(inode); 333 - inode->i_ctime = CURRENT_TIME_SEC; 333 + inode->i_ctime = current_time(inode); 334 334 fat_detach(inode); 335 335 out: 336 336 mutex_unlock(&MSDOS_SB(sb)->s_lock); ··· 364 364 goto out; 365 365 } 366 366 367 - ts = CURRENT_TIME_SEC; 367 + ts = current_time(dir); 368 368 cluster = fat_alloc_new_dir(dir, &ts); 369 369 if (cluster < 0) { 370 370 err = cluster; ··· 416 416 if (err) 417 417 goto out; 418 418 clear_nlink(inode); 419 - inode->i_ctime = CURRENT_TIME_SEC; 419 + inode->i_ctime = current_time(inode); 420 420 fat_detach(inode); 421 421 out: 422 422 mutex_unlock(&MSDOS_SB(sb)->s_lock); ··· 481 481 mark_inode_dirty(old_inode); 482 482 483 483 old_dir->i_version++; 484 - old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME_SEC; 484 + old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); 485 485 if (IS_DIRSYNC(old_dir)) 486 486 (void)fat_sync_inode(old_dir); 487 487 else ··· 490 490 } 491 491 } 492 492 493 - ts = CURRENT_TIME_SEC; 493 + ts = current_time(old_inode); 494 494 if (new_inode) { 495 495 if (err) 496 496 goto out; ··· 596 596 597 597 /***** Rename, a wrapper for rename_same_dir & rename_diff_dir */ 598 598 static int msdos_rename(struct inode *old_dir, struct dentry *old_dentry, 599 - struct inode *new_dir, struct dentry *new_dentry) 599 + struct inode *new_dir, struct dentry *new_dentry, 600 + unsigned int flags) 600 601 { 601 602 struct super_block *sb = old_dir->i_sb; 602 603 unsigned char old_msdos_name[MSDOS_NAME], new_msdos_name[MSDOS_NAME]; 603 604 int err, is_hid; 605 + 606 + if (flags & ~RENAME_NOREPLACE) 607 + return -EINVAL; 604 608 605 609 mutex_lock(&MSDOS_SB(sb)->s_lock); 606 610
+10 -6
fs/fat/namei_vfat.c
··· 788 788 789 789 mutex_lock(&MSDOS_SB(sb)->s_lock); 790 790 791 - ts = CURRENT_TIME_SEC; 791 + ts = current_time(dir); 792 792 err = vfat_add_entry(dir, &dentry->d_name, 0, 0, &ts, &sinfo); 793 793 if (err) 794 794 goto out; ··· 832 832 drop_nlink(dir); 833 833 834 834 clear_nlink(inode); 835 - inode->i_mtime = inode->i_atime = CURRENT_TIME_SEC; 835 + inode->i_mtime = inode->i_atime = current_time(inode); 836 836 fat_detach(inode); 837 837 vfat_d_version_set(dentry, dir->i_version); 838 838 out: ··· 858 858 if (err) 859 859 goto out; 860 860 clear_nlink(inode); 861 - inode->i_mtime = inode->i_atime = CURRENT_TIME_SEC; 861 + inode->i_mtime = inode->i_atime = current_time(inode); 862 862 fat_detach(inode); 863 863 vfat_d_version_set(dentry, dir->i_version); 864 864 out: ··· 877 877 878 878 mutex_lock(&MSDOS_SB(sb)->s_lock); 879 879 880 - ts = CURRENT_TIME_SEC; 880 + ts = current_time(dir); 881 881 cluster = fat_alloc_new_dir(dir, &ts); 882 882 if (cluster < 0) { 883 883 err = cluster; ··· 914 914 } 915 915 916 916 static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry, 917 - struct inode *new_dir, struct dentry *new_dentry) 917 + struct inode *new_dir, struct dentry *new_dentry, 918 + unsigned int flags) 918 919 { 919 920 struct buffer_head *dotdot_bh; 920 921 struct msdos_dir_entry *dotdot_de; ··· 925 924 loff_t new_i_pos; 926 925 int err, is_dir, update_dotdot, corrupt = 0; 927 926 struct super_block *sb = old_dir->i_sb; 927 + 928 + if (flags & ~RENAME_NOREPLACE) 929 + return -EINVAL; 928 930 929 931 old_sinfo.bh = sinfo.bh = dotdot_bh = NULL; 930 932 old_inode = d_inode(old_dentry); ··· 946 942 } 947 943 } 948 944 949 - ts = CURRENT_TIME_SEC; 945 + ts = current_time(old_dir); 950 946 if (new_inode) { 951 947 if (is_dir) { 952 948 err = fat_dir_empty(new_inode);
+1 -1
fs/fuse/control.c
··· 220 220 inode->i_mode = mode; 221 221 inode->i_uid = fc->user_id; 222 222 inode->i_gid = fc->group_id; 223 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 223 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 224 224 /* setting ->i_op to NULL is not allowed */ 225 225 if (iop) 226 226 inode->i_op = iop;
+2 -2
fs/fuse/dir.c
··· 647 647 void fuse_update_ctime(struct inode *inode) 648 648 { 649 649 if (!IS_NOCMTIME(inode)) { 650 - inode->i_ctime = current_fs_time(inode->i_sb); 650 + inode->i_ctime = current_time(inode); 651 651 mark_inode_dirty_sync(inode); 652 652 } 653 653 } ··· 1793 1793 .symlink = fuse_symlink, 1794 1794 .unlink = fuse_unlink, 1795 1795 .rmdir = fuse_rmdir, 1796 - .rename2 = fuse_rename2, 1796 + .rename = fuse_rename2, 1797 1797 .link = fuse_link, 1798 1798 .setattr = fuse_setattr, 1799 1799 .create = fuse_create,
+4 -4
fs/gfs2/bmap.c
··· 836 836 gfs2_quota_change(ip, -(s64)btotal, ip->i_inode.i_uid, 837 837 ip->i_inode.i_gid); 838 838 839 - ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; 839 + ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); 840 840 841 841 gfs2_dinode_out(ip, dibh->b_data); 842 842 ··· 1063 1063 } 1064 1064 1065 1065 i_size_write(inode, newsize); 1066 - ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; 1066 + ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); 1067 1067 gfs2_dinode_out(ip, dibh->b_data); 1068 1068 1069 1069 if (journaled) ··· 1142 1142 gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); 1143 1143 gfs2_ordered_del_inode(ip); 1144 1144 } 1145 - ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; 1145 + ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); 1146 1146 ip->i_diskflags &= ~GFS2_DIF_TRUNC_IN_PROG; 1147 1147 1148 1148 gfs2_trans_add_meta(ip->i_gl, dibh); ··· 1252 1252 goto do_end_trans; 1253 1253 1254 1254 i_size_write(inode, size); 1255 - ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; 1255 + ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); 1256 1256 gfs2_trans_add_meta(ip->i_gl, dibh); 1257 1257 gfs2_dinode_out(ip, dibh->b_data); 1258 1258 brelse(dibh);
+6 -6
fs/gfs2/dir.c
··· 135 135 memcpy(dibh->b_data + offset + sizeof(struct gfs2_dinode), buf, size); 136 136 if (ip->i_inode.i_size < offset + size) 137 137 i_size_write(&ip->i_inode, offset + size); 138 - ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; 138 + ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); 139 139 gfs2_dinode_out(ip, dibh->b_data); 140 140 141 141 brelse(dibh); ··· 233 233 234 234 if (ip->i_inode.i_size < offset + copied) 235 235 i_size_write(&ip->i_inode, offset + copied); 236 - ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; 236 + ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); 237 237 238 238 gfs2_trans_add_meta(ip->i_gl, dibh); 239 239 gfs2_dinode_out(ip, dibh->b_data); ··· 872 872 struct gfs2_leaf *leaf; 873 873 struct gfs2_dirent *dent; 874 874 struct qstr name = { .name = "" }; 875 - struct timespec tv = CURRENT_TIME; 875 + struct timespec tv = current_time(inode); 876 876 877 877 error = gfs2_alloc_blocks(ip, &bn, &n, 0, NULL); 878 878 if (error) ··· 1816 1816 gfs2_inum_out(nip, dent); 1817 1817 dent->de_type = cpu_to_be16(IF2DT(nip->i_inode.i_mode)); 1818 1818 dent->de_rahead = cpu_to_be16(gfs2_inode_ra_len(nip)); 1819 - tv = CURRENT_TIME; 1819 + tv = current_time(&ip->i_inode); 1820 1820 if (ip->i_diskflags & GFS2_DIF_EXHASH) { 1821 1821 leaf = (struct gfs2_leaf *)bh->b_data; 1822 1822 be16_add_cpu(&leaf->lf_entries, 1); ··· 1878 1878 const struct qstr *name = &dentry->d_name; 1879 1879 struct gfs2_dirent *dent, *prev = NULL; 1880 1880 struct buffer_head *bh; 1881 - struct timespec tv = CURRENT_TIME; 1881 + struct timespec tv = current_time(&dip->i_inode); 1882 1882 1883 1883 /* Returns _either_ the entry (if its first in block) or the 1884 1884 previous entry otherwise */ ··· 1960 1960 gfs2_trans_add_meta(dip->i_gl, bh); 1961 1961 } 1962 1962 1963 - dip->i_inode.i_mtime = dip->i_inode.i_ctime = CURRENT_TIME; 1963 + dip->i_inode.i_mtime = dip->i_inode.i_ctime = current_time(&dip->i_inode); 1964 1964 gfs2_dinode_out(dip, bh->b_data); 1965 1965 brelse(bh); 1966 1966 return 0;
+5 -5
fs/gfs2/inode.c
··· 656 656 set_nlink(inode, S_ISDIR(mode) ? 2 : 1); 657 657 inode->i_rdev = dev; 658 658 inode->i_size = size; 659 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 659 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 660 660 gfs2_set_inode_blocks(inode, 1); 661 661 munge_mode_uid_gid(dip, inode); 662 662 check_and_update_goal(dip); ··· 983 983 984 984 gfs2_trans_add_meta(ip->i_gl, dibh); 985 985 inc_nlink(&ip->i_inode); 986 - ip->i_inode.i_ctime = CURRENT_TIME; 986 + ip->i_inode.i_ctime = current_time(&ip->i_inode); 987 987 ihold(inode); 988 988 d_instantiate(dentry, inode); 989 989 mark_inode_dirty(inode); ··· 1067 1067 return error; 1068 1068 1069 1069 ip->i_entries = 0; 1070 - inode->i_ctime = CURRENT_TIME; 1070 + inode->i_ctime = current_time(inode); 1071 1071 if (S_ISDIR(inode->i_mode)) 1072 1072 clear_nlink(inode); 1073 1073 else ··· 1330 1330 error = gfs2_meta_inode_buffer(ip, &dibh); 1331 1331 if (error) 1332 1332 return error; 1333 - ip->i_inode.i_ctime = CURRENT_TIME; 1333 + ip->i_inode.i_ctime = current_time(&ip->i_inode); 1334 1334 gfs2_trans_add_meta(ip->i_gl, dibh); 1335 1335 gfs2_dinode_out(ip, dibh->b_data); 1336 1336 brelse(dibh); ··· 2055 2055 .mkdir = gfs2_mkdir, 2056 2056 .rmdir = gfs2_unlink, 2057 2057 .mknod = gfs2_mknod, 2058 - .rename2 = gfs2_rename2, 2058 + .rename = gfs2_rename2, 2059 2059 .permission = gfs2_permission, 2060 2060 .setattr = gfs2_setattr, 2061 2061 .getattr = gfs2_getattr,
+1 -1
fs/gfs2/quota.c
··· 854 854 size = loc + sizeof(struct gfs2_quota); 855 855 if (size > inode->i_size) 856 856 i_size_write(inode, size); 857 - inode->i_mtime = inode->i_atime = CURRENT_TIME; 857 + inode->i_mtime = inode->i_atime = current_time(inode); 858 858 mark_inode_dirty(inode); 859 859 set_bit(QDF_REFRESH, &qd->qd_flags); 860 860 }
+4 -4
fs/gfs2/xattr.c
··· 309 309 310 310 error = gfs2_meta_inode_buffer(ip, &dibh); 311 311 if (!error) { 312 - ip->i_inode.i_ctime = CURRENT_TIME; 312 + ip->i_inode.i_ctime = current_time(&ip->i_inode); 313 313 gfs2_trans_add_meta(ip->i_gl, dibh); 314 314 gfs2_dinode_out(ip, dibh->b_data); 315 315 brelse(dibh); ··· 775 775 776 776 error = gfs2_meta_inode_buffer(ip, &dibh); 777 777 if (!error) { 778 - ip->i_inode.i_ctime = CURRENT_TIME; 778 + ip->i_inode.i_ctime = current_time(&ip->i_inode); 779 779 gfs2_trans_add_meta(ip->i_gl, dibh); 780 780 gfs2_dinode_out(ip, dibh->b_data); 781 781 brelse(dibh); ··· 910 910 error = gfs2_meta_inode_buffer(ip, &dibh); 911 911 if (error) 912 912 goto out; 913 - ip->i_inode.i_ctime = CURRENT_TIME; 913 + ip->i_inode.i_ctime = current_time(&ip->i_inode); 914 914 gfs2_trans_add_meta(ip->i_gl, dibh); 915 915 gfs2_dinode_out(ip, dibh->b_data); 916 916 brelse(dibh); ··· 1133 1133 1134 1134 error = gfs2_meta_inode_buffer(ip, &dibh); 1135 1135 if (!error) { 1136 - ip->i_inode.i_ctime = CURRENT_TIME; 1136 + ip->i_inode.i_ctime = current_time(&ip->i_inode); 1137 1137 gfs2_trans_add_meta(ip->i_gl, dibh); 1138 1138 gfs2_dinode_out(ip, dibh->b_data); 1139 1139 brelse(dibh);
+4 -4
fs/hfs/catalog.c
··· 125 125 goto err1; 126 126 127 127 dir->i_size++; 128 - dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; 128 + dir->i_mtime = dir->i_ctime = current_time(dir); 129 129 mark_inode_dirty(dir); 130 130 hfs_find_exit(&fd); 131 131 return 0; ··· 261 261 } 262 262 263 263 dir->i_size--; 264 - dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; 264 + dir->i_mtime = dir->i_ctime = current_time(dir); 265 265 mark_inode_dirty(dir); 266 266 res = 0; 267 267 out: ··· 321 321 if (err) 322 322 goto out; 323 323 dst_dir->i_size++; 324 - dst_dir->i_mtime = dst_dir->i_ctime = CURRENT_TIME_SEC; 324 + dst_dir->i_mtime = dst_dir->i_ctime = current_time(dst_dir); 325 325 mark_inode_dirty(dst_dir); 326 326 327 327 /* finally remove the old entry */ ··· 333 333 if (err) 334 334 goto out; 335 335 src_dir->i_size--; 336 - src_dir->i_mtime = src_dir->i_ctime = CURRENT_TIME_SEC; 336 + src_dir->i_mtime = src_dir->i_ctime = current_time(src_dir); 337 337 mark_inode_dirty(src_dir); 338 338 339 339 type = entry.type;
+6 -2
fs/hfs/dir.c
··· 268 268 if (res) 269 269 return res; 270 270 clear_nlink(inode); 271 - inode->i_ctime = CURRENT_TIME_SEC; 271 + inode->i_ctime = current_time(inode); 272 272 hfs_delete_inode(inode); 273 273 mark_inode_dirty(inode); 274 274 return 0; ··· 286 286 * XXX: how do you handle must_be dir? 287 287 */ 288 288 static int hfs_rename(struct inode *old_dir, struct dentry *old_dentry, 289 - struct inode *new_dir, struct dentry *new_dentry) 289 + struct inode *new_dir, struct dentry *new_dentry, 290 + unsigned int flags) 290 291 { 291 292 int res; 293 + 294 + if (flags & ~RENAME_NOREPLACE) 295 + return -EINVAL; 292 296 293 297 /* Unlink destination if it already exists */ 294 298 if (d_really_is_positive(new_dentry)) {
+1 -1
fs/hfs/inode.c
··· 194 194 inode->i_uid = current_fsuid(); 195 195 inode->i_gid = current_fsgid(); 196 196 set_nlink(inode, 1); 197 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC; 197 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 198 198 HFS_I(inode)->flags = 0; 199 199 HFS_I(inode)->rsrc_inode = NULL; 200 200 HFS_I(inode)->fs_blocks = 0;
+4 -4
fs/hfsplus/catalog.c
··· 303 303 dir->i_size++; 304 304 if (S_ISDIR(inode->i_mode)) 305 305 hfsplus_subfolders_inc(dir); 306 - dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; 306 + dir->i_mtime = dir->i_ctime = current_time(dir); 307 307 hfsplus_mark_inode_dirty(dir, HFSPLUS_I_CAT_DIRTY); 308 308 309 309 hfs_find_exit(&fd); ··· 400 400 dir->i_size--; 401 401 if (type == HFSPLUS_FOLDER) 402 402 hfsplus_subfolders_dec(dir); 403 - dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; 403 + dir->i_mtime = dir->i_ctime = current_time(dir); 404 404 hfsplus_mark_inode_dirty(dir, HFSPLUS_I_CAT_DIRTY); 405 405 406 406 if (type == HFSPLUS_FILE || type == HFSPLUS_FOLDER) { ··· 469 469 dst_dir->i_size++; 470 470 if (type == HFSPLUS_FOLDER) 471 471 hfsplus_subfolders_inc(dst_dir); 472 - dst_dir->i_mtime = dst_dir->i_ctime = CURRENT_TIME_SEC; 472 + dst_dir->i_mtime = dst_dir->i_ctime = current_time(dst_dir); 473 473 474 474 /* finally remove the old entry */ 475 475 err = hfsplus_cat_build_key(sb, src_fd.search_key, ··· 486 486 src_dir->i_size--; 487 487 if (type == HFSPLUS_FOLDER) 488 488 hfsplus_subfolders_dec(src_dir); 489 - src_dir->i_mtime = src_dir->i_ctime = CURRENT_TIME_SEC; 489 + src_dir->i_mtime = src_dir->i_ctime = current_time(src_dir); 490 490 491 491 /* remove old thread entry */ 492 492 hfsplus_cat_build_key_with_cnid(sb, src_fd.search_key, cnid);
+8 -4
fs/hfsplus/dir.c
··· 347 347 inc_nlink(inode); 348 348 hfsplus_instantiate(dst_dentry, inode, cnid); 349 349 ihold(inode); 350 - inode->i_ctime = CURRENT_TIME_SEC; 350 + inode->i_ctime = current_time(inode); 351 351 mark_inode_dirty(inode); 352 352 sbi->file_count++; 353 353 hfsplus_mark_mdb_dirty(dst_dir->i_sb); ··· 406 406 hfsplus_delete_inode(inode); 407 407 } else 408 408 sbi->file_count--; 409 - inode->i_ctime = CURRENT_TIME_SEC; 409 + inode->i_ctime = current_time(inode); 410 410 mark_inode_dirty(inode); 411 411 out: 412 412 mutex_unlock(&sbi->vh_mutex); ··· 427 427 if (res) 428 428 goto out; 429 429 clear_nlink(inode); 430 - inode->i_ctime = CURRENT_TIME_SEC; 430 + inode->i_ctime = current_time(inode); 431 431 hfsplus_delete_inode(inode); 432 432 mark_inode_dirty(inode); 433 433 out: ··· 530 530 } 531 531 532 532 static int hfsplus_rename(struct inode *old_dir, struct dentry *old_dentry, 533 - struct inode *new_dir, struct dentry *new_dentry) 533 + struct inode *new_dir, struct dentry *new_dentry, 534 + unsigned int flags) 534 535 { 535 536 int res; 537 + 538 + if (flags & ~RENAME_NOREPLACE) 539 + return -EINVAL; 536 540 537 541 /* Unlink destination if it already exists */ 538 542 if (d_really_is_positive(new_dentry)) {
+1 -1
fs/hfsplus/inode.c
··· 366 366 inode->i_uid = current_fsuid(); 367 367 inode->i_gid = current_fsgid(); 368 368 set_nlink(inode, 1); 369 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC; 369 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 370 370 371 371 hip = HFSPLUS_I(inode); 372 372 INIT_LIST_HEAD(&hip->open_dir_list);
+1 -1
fs/hfsplus/ioctl.c
··· 122 122 else 123 123 hip->userflags &= ~HFSPLUS_FLG_NODUMP; 124 124 125 - inode->i_ctime = CURRENT_TIME_SEC; 125 + inode->i_ctime = current_time(inode); 126 126 mark_inode_dirty(inode); 127 127 128 128 out_unlock_inode:
+1 -1
fs/hostfs/hostfs_kern.c
··· 885 885 .mkdir = hostfs_mkdir, 886 886 .rmdir = hostfs_rmdir, 887 887 .mknod = hostfs_mknod, 888 - .rename2 = hostfs_rename2, 888 + .rename = hostfs_rename2, 889 889 .permission = hostfs_permission, 890 890 .setattr = hostfs_setattr, 891 891 };
+5 -1
fs/hpfs/namei.c
··· 507 507 }; 508 508 509 509 static int hpfs_rename(struct inode *old_dir, struct dentry *old_dentry, 510 - struct inode *new_dir, struct dentry *new_dentry) 510 + struct inode *new_dir, struct dentry *new_dentry, 511 + unsigned int flags) 511 512 { 512 513 const unsigned char *old_name = old_dentry->d_name.name; 513 514 unsigned old_len = old_dentry->d_name.len; ··· 524 523 struct buffer_head *bh; 525 524 struct fnode *fnode; 526 525 int err; 526 + 527 + if (flags & ~RENAME_NOREPLACE) 528 + return -EINVAL; 527 529 528 530 if ((err = hpfs_chk_name(new_name, &new_len))) return err; 529 531 err = 0;
+5 -5
fs/hugetlbfs/inode.c
··· 655 655 656 656 if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + len > inode->i_size) 657 657 i_size_write(inode, offset + len); 658 - inode->i_ctime = CURRENT_TIME; 658 + inode->i_ctime = current_time(inode); 659 659 out: 660 660 inode_unlock(inode); 661 661 return error; ··· 700 700 inode->i_mode = S_IFDIR | config->mode; 701 701 inode->i_uid = config->uid; 702 702 inode->i_gid = config->gid; 703 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 703 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 704 704 info = HUGETLBFS_I(inode); 705 705 mpol_shared_policy_init(&info->policy, NULL); 706 706 inode->i_op = &hugetlbfs_dir_inode_operations; ··· 739 739 lockdep_set_class(&inode->i_mapping->i_mmap_rwsem, 740 740 &hugetlbfs_i_mmap_rwsem_key); 741 741 inode->i_mapping->a_ops = &hugetlbfs_aops; 742 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 742 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 743 743 inode->i_mapping->private_data = resv_map; 744 744 info = HUGETLBFS_I(inode); 745 745 /* ··· 788 788 789 789 inode = hugetlbfs_get_inode(dir->i_sb, dir, mode, dev); 790 790 if (inode) { 791 - dir->i_ctime = dir->i_mtime = CURRENT_TIME; 791 + dir->i_ctime = dir->i_mtime = current_time(dir); 792 792 d_instantiate(dentry, inode); 793 793 dget(dentry); /* Extra count - pin the dentry in core */ 794 794 error = 0; ··· 825 825 } else 826 826 iput(inode); 827 827 } 828 - dir->i_ctime = dir->i_mtime = CURRENT_TIME; 828 + dir->i_ctime = dir->i_mtime = current_time(dir); 829 829 830 830 return error; 831 831 }
+26 -3
fs/inode.c
··· 1686 1686 if ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode)) 1687 1687 return false; 1688 1688 1689 - now = current_fs_time(inode->i_sb); 1689 + now = current_time(inode); 1690 1690 1691 1691 if (!relatime_need_update(path, inode, now, rcu)) 1692 1692 return false; ··· 1720 1720 * We may also fail on filesystems that have the ability to make parts 1721 1721 * of the fs read only, e.g. subvolumes in Btrfs. 1722 1722 */ 1723 - now = current_fs_time(inode->i_sb); 1723 + now = current_time(inode); 1724 1724 update_time(inode, &now, S_ATIME); 1725 1725 __mnt_drop_write(mnt); 1726 1726 skip_update: ··· 1843 1843 if (IS_NOCMTIME(inode)) 1844 1844 return 0; 1845 1845 1846 - now = current_fs_time(inode->i_sb); 1846 + now = current_time(inode); 1847 1847 if (!timespec_equal(&inode->i_mtime, &now)) 1848 1848 sync_it = S_MTIME; 1849 1849 ··· 2099 2099 mapping_set_gfp_mask(inode->i_mapping, GFP_USER); 2100 2100 } 2101 2101 EXPORT_SYMBOL(inode_nohighmem); 2102 + 2103 + /** 2104 + * current_time - Return FS time 2105 + * @inode: inode. 2106 + * 2107 + * Return the current time truncated to the time granularity supported by 2108 + * the fs. 2109 + * 2110 + * Note that inode and inode->sb cannot be NULL. 2111 + * Otherwise, the function warns and returns time without truncation. 2112 + */ 2113 + struct timespec current_time(struct inode *inode) 2114 + { 2115 + struct timespec now = current_kernel_time(); 2116 + 2117 + if (unlikely(!inode->i_sb)) { 2118 + WARN(1, "current_time() called with uninitialized super_block in the inode"); 2119 + return now; 2120 + } 2121 + 2122 + return timespec_trunc(now, inode->i_sb->s_time_gran); 2123 + } 2124 + EXPORT_SYMBOL(current_time);
+1 -1
fs/jffs2/acl.c
··· 243 243 244 244 attr.ia_valid = ATTR_MODE | ATTR_CTIME; 245 245 attr.ia_mode = mode; 246 - attr.ia_ctime = CURRENT_TIME_SEC; 246 + attr.ia_ctime = current_time(inode); 247 247 rc = jffs2_do_setattr(inode, &attr); 248 248 if (rc < 0) 249 249 return rc;
+7 -2
fs/jffs2/dir.c
··· 35 35 static int jffs2_rmdir (struct inode *,struct dentry *); 36 36 static int jffs2_mknod (struct inode *,struct dentry *,umode_t,dev_t); 37 37 static int jffs2_rename (struct inode *, struct dentry *, 38 - struct inode *, struct dentry *); 38 + struct inode *, struct dentry *, 39 + unsigned int); 39 40 40 41 const struct file_operations jffs2_dir_operations = 41 42 { ··· 757 756 } 758 757 759 758 static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry, 760 - struct inode *new_dir_i, struct dentry *new_dentry) 759 + struct inode *new_dir_i, struct dentry *new_dentry, 760 + unsigned int flags) 761 761 { 762 762 int ret; 763 763 struct jffs2_sb_info *c = JFFS2_SB_INFO(old_dir_i->i_sb); 764 764 struct jffs2_inode_info *victim_f = NULL; 765 765 uint8_t type; 766 766 uint32_t now; 767 + 768 + if (flags & ~RENAME_NOREPLACE) 769 + return -EINVAL; 767 770 768 771 /* The VFS will check for us and prevent trying to rename a 769 772 * file over a directory and vice versa, but if it's a directory,
+1 -1
fs/jffs2/fs.c
··· 472 472 inode->i_mode = jemode_to_cpu(ri->mode); 473 473 i_gid_write(inode, je16_to_cpu(ri->gid)); 474 474 i_uid_write(inode, je16_to_cpu(ri->uid)); 475 - inode->i_atime = inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC; 475 + inode->i_atime = inode->i_ctime = inode->i_mtime = current_time(inode); 476 476 ri->atime = ri->mtime = ri->ctime = cpu_to_je32(I_SEC(inode->i_mtime)); 477 477 478 478 inode->i_blocks = 0;
+1 -1
fs/jfs/acl.c
··· 81 81 rc = posix_acl_update_mode(inode, &inode->i_mode, &acl); 82 82 if (rc) 83 83 return rc; 84 - inode->i_ctime = CURRENT_TIME; 84 + inode->i_ctime = current_time(inode); 85 85 mark_inode_dirty(inode); 86 86 } 87 87 break;
+1 -1
fs/jfs/inode.c
··· 403 403 break; 404 404 } 405 405 406 - ip->i_mtime = ip->i_ctime = CURRENT_TIME; 406 + ip->i_mtime = ip->i_ctime = current_time(ip); 407 407 mark_inode_dirty(ip); 408 408 409 409 txCommit(tid, 1, &ip, 0);
+1 -1
fs/jfs/jfs_inode.c
··· 131 131 jfs_inode->mode2 |= inode->i_mode; 132 132 133 133 inode->i_blocks = 0; 134 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 134 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 135 135 jfs_inode->otime = inode->i_ctime.tv_sec; 136 136 inode->i_generation = JFS_SBI(sb)->gengen++; 137 137
+16 -13
fs/jfs/namei.c
··· 162 162 163 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 167 mark_inode_dirty(dip); 168 168 ··· 298 298 299 299 /* update parent directory inode */ 300 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 302 mark_inode_dirty(dip); 303 303 304 304 rc = txCommit(tid, 2, &iplist[0], 0); ··· 406 406 /* update parent directory's link count corresponding 407 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 410 inode_dec_link_count(dip); 411 411 412 412 /* ··· 528 528 529 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 532 mark_inode_dirty(dip); 533 533 534 534 /* update target's inode */ ··· 838 838 839 839 /* update object inode */ 840 840 inc_nlink(ip); /* for new link */ 841 - ip->i_ctime = CURRENT_TIME; 842 - dir->i_ctime = dir->i_mtime = CURRENT_TIME; 841 + ip->i_ctime = current_time(ip); 842 + dir->i_ctime = dir->i_mtime = current_time(dir); 843 843 mark_inode_dirty(dir); 844 844 ihold(ip); 845 845 ··· 1039 1039 1040 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 1043 mark_inode_dirty(dip); 1044 1044 /* 1045 1045 * commit update of parent directory and link object ··· 1078 1078 * FUNCTION: rename a file or directory 1079 1079 */ 1080 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 1084 struct btstack btstack; 1084 1085 ino_t ino; ··· 1098 1097 s64 new_size = 0; 1099 1098 int commit_flag; 1100 1099 1100 + if (flags & ~RENAME_NOREPLACE) 1101 + return -EINVAL; 1101 1102 1102 1103 jfs_info("jfs_rename: %pd %pd", old_dentry, new_dentry); 1103 1104 ··· 1218 1215 tblk->xflag |= COMMIT_DELETE; 1219 1216 tblk->u.ip = new_ip; 1220 1217 } else { 1221 - new_ip->i_ctime = CURRENT_TIME; 1218 + new_ip->i_ctime = current_time(new_ip); 1222 1219 mark_inode_dirty(new_ip); 1223 1220 } 1224 1221 } else { ··· 1281 1278 /* 1282 1279 * Update ctime on changed/moved inodes & mark dirty 1283 1280 */ 1284 - old_ip->i_ctime = CURRENT_TIME; 1281 + old_ip->i_ctime = current_time(old_ip); 1285 1282 mark_inode_dirty(old_ip); 1286 1283 1287 - new_dir->i_ctime = new_dir->i_mtime = current_fs_time(new_dir->i_sb); 1284 + new_dir->i_ctime = new_dir->i_mtime = current_time(new_dir); 1288 1285 mark_inode_dirty(new_dir); 1289 1286 1290 1287 /* Build list of inodes modified by this transaction */ ··· 1296 1293 1297 1294 if (old_dir != new_dir) { 1298 1295 iplist[ipcount++] = new_dir; 1299 - old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME; 1296 + old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); 1300 1297 mark_inode_dirty(old_dir); 1301 1298 } 1302 1299 ··· 1429 1426 1430 1427 mark_inode_dirty(ip); 1431 1428 1432 - dir->i_ctime = dir->i_mtime = CURRENT_TIME; 1429 + dir->i_ctime = dir->i_mtime = current_time(dir); 1433 1430 1434 1431 mark_inode_dirty(dir); 1435 1432
+1 -1
fs/jfs/super.c
··· 830 830 if (inode->i_size < off+len-towrite) 831 831 i_size_write(inode, off+len-towrite); 832 832 inode->i_version++; 833 - inode->i_mtime = inode->i_ctime = CURRENT_TIME; 833 + inode->i_mtime = inode->i_ctime = current_time(inode); 834 834 mark_inode_dirty(inode); 835 835 inode_unlock(inode); 836 836 return len - towrite;
+1 -1
fs/jfs/xattr.c
··· 658 658 if (old_blocks) 659 659 dquot_free_block(inode, old_blocks); 660 660 661 - inode->i_ctime = CURRENT_TIME; 661 + inode->i_ctime = current_time(inode); 662 662 663 663 return 0; 664 664 }
+5 -1
fs/kernfs/dir.c
··· 1096 1096 } 1097 1097 1098 1098 static int kernfs_iop_rename(struct inode *old_dir, struct dentry *old_dentry, 1099 - struct inode *new_dir, struct dentry *new_dentry) 1099 + struct inode *new_dir, struct dentry *new_dentry, 1100 + unsigned int flags) 1100 1101 { 1101 1102 struct kernfs_node *kn = old_dentry->d_fsdata; 1102 1103 struct kernfs_node *new_parent = new_dir->i_private; 1103 1104 struct kernfs_syscall_ops *scops = kernfs_root(kn)->syscall_ops; 1104 1105 int ret; 1106 + 1107 + if (flags) 1108 + return -EINVAL; 1105 1109 1106 1110 if (!scops || !scops->rename) 1107 1111 return -EPERM;
+1 -1
fs/kernfs/inode.c
··· 168 168 { 169 169 inode->i_mode = mode; 170 170 inode->i_atime = inode->i_mtime = 171 - inode->i_ctime = current_fs_time(inode->i_sb); 171 + inode->i_ctime = current_time(inode); 172 172 } 173 173 174 174 static inline void set_inode_attr(struct inode *inode, struct iattr *iattr)
+12 -8
fs/libfs.c
··· 266 266 */ 267 267 root->i_ino = 1; 268 268 root->i_mode = S_IFDIR | S_IRUSR | S_IWUSR; 269 - root->i_atime = root->i_mtime = root->i_ctime = CURRENT_TIME; 269 + root->i_atime = root->i_mtime = root->i_ctime = current_time(root); 270 270 dentry = __d_alloc(s, &d_name); 271 271 if (!dentry) { 272 272 iput(root); ··· 296 296 { 297 297 struct inode *inode = d_inode(old_dentry); 298 298 299 - inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME; 299 + inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); 300 300 inc_nlink(inode); 301 301 ihold(inode); 302 302 dget(dentry); ··· 330 330 { 331 331 struct inode *inode = d_inode(dentry); 332 332 333 - inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME; 333 + inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); 334 334 drop_nlink(inode); 335 335 dput(dentry); 336 336 return 0; ··· 350 350 EXPORT_SYMBOL(simple_rmdir); 351 351 352 352 int simple_rename(struct inode *old_dir, struct dentry *old_dentry, 353 - struct inode *new_dir, struct dentry *new_dentry) 353 + struct inode *new_dir, struct dentry *new_dentry, 354 + unsigned int flags) 354 355 { 355 356 struct inode *inode = d_inode(old_dentry); 356 357 int they_are_dirs = d_is_dir(old_dentry); 358 + 359 + if (flags & ~RENAME_NOREPLACE) 360 + return -EINVAL; 357 361 358 362 if (!simple_empty(new_dentry)) 359 363 return -ENOTEMPTY; ··· 374 370 } 375 371 376 372 old_dir->i_ctime = old_dir->i_mtime = new_dir->i_ctime = 377 - new_dir->i_mtime = inode->i_ctime = CURRENT_TIME; 373 + new_dir->i_mtime = inode->i_ctime = current_time(old_dir); 378 374 379 375 return 0; 380 376 } ··· 525 521 */ 526 522 inode->i_ino = 1; 527 523 inode->i_mode = S_IFDIR | 0755; 528 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 524 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 529 525 inode->i_op = &simple_dir_inode_operations; 530 526 inode->i_fop = &simple_dir_operations; 531 527 set_nlink(inode, 2); ··· 551 547 goto out; 552 548 } 553 549 inode->i_mode = S_IFREG | files->mode; 554 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 550 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 555 551 inode->i_fop = files->ops; 556 552 inode->i_ino = i; 557 553 d_add(dentry, inode); ··· 1097 1093 inode->i_uid = current_fsuid(); 1098 1094 inode->i_gid = current_fsgid(); 1099 1095 inode->i_flags |= S_PRIVATE; 1100 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 1096 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 1101 1097 return inode; 1102 1098 } 1103 1099 EXPORT_SYMBOL(alloc_anon_inode);
+1 -1
fs/locks.c
··· 1569 1569 } 1570 1570 1571 1571 if (has_lease) 1572 - *time = current_fs_time(inode->i_sb); 1572 + *time = current_time(inode); 1573 1573 else 1574 1574 *time = inode->i_mtime; 1575 1575 }
+8 -4
fs/logfs/dir.c
··· 226 226 ta->state = UNLINK_1; 227 227 ta->ino = inode->i_ino; 228 228 229 - inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME; 229 + inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); 230 230 231 231 page = logfs_get_dd_page(dir, dentry); 232 232 if (!page) { ··· 540 540 { 541 541 struct inode *inode = d_inode(old_dentry); 542 542 543 - inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME; 543 + inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); 544 544 ihold(inode); 545 545 inc_nlink(inode); 546 546 mark_inode_dirty_sync(inode); ··· 573 573 * (crc-protected) journal. 574 574 */ 575 575 BUG_ON(beyond_eof(dir, pos)); 576 - dir->i_ctime = dir->i_mtime = CURRENT_TIME; 576 + dir->i_ctime = dir->i_mtime = current_time(dir); 577 577 log_dir(" Delete dentry (%lx, %llx)\n", dir->i_ino, pos); 578 578 return logfs_delete(dir, pos, NULL); 579 579 } ··· 718 718 } 719 719 720 720 static int logfs_rename(struct inode *old_dir, struct dentry *old_dentry, 721 - struct inode *new_dir, struct dentry *new_dentry) 721 + struct inode *new_dir, struct dentry *new_dentry, 722 + unsigned int flags) 722 723 { 724 + if (flags & ~RENAME_NOREPLACE) 725 + return -EINVAL; 726 + 723 727 if (d_really_is_positive(new_dentry)) 724 728 return logfs_rename_target(old_dir, old_dentry, 725 729 new_dir, new_dentry);
+1 -1
fs/logfs/file.c
··· 211 211 li->li_flags = flags; 212 212 inode_unlock(inode); 213 213 214 - inode->i_ctime = CURRENT_TIME; 214 + inode->i_ctime = current_time(inode); 215 215 mark_inode_dirty_sync(inode); 216 216 return 0; 217 217
+2 -2
fs/logfs/inode.c
··· 213 213 i_gid_write(inode, 0); 214 214 inode->i_size = 0; 215 215 inode->i_blocks = 0; 216 - inode->i_ctime = CURRENT_TIME; 217 - inode->i_mtime = CURRENT_TIME; 216 + inode->i_ctime = current_time(inode); 217 + inode->i_mtime = current_time(inode); 218 218 li->li_refcount = 1; 219 219 INIT_LIST_HEAD(&li->li_freeing_list); 220 220
+2 -2
fs/logfs/readwrite.c
··· 1546 1546 int err; 1547 1547 1548 1548 flags |= WF_WRITE | WF_DELETE; 1549 - inode->i_ctime = inode->i_mtime = CURRENT_TIME; 1549 + inode->i_ctime = inode->i_mtime = current_time(inode); 1550 1550 1551 1551 logfs_unpack_index(index, &bix, &level); 1552 1552 if (logfs_block(page) && logfs_block(page)->reserved_bytes) ··· 1578 1578 long flags = WF_DELETE; 1579 1579 int err; 1580 1580 1581 - inode->i_ctime = inode->i_mtime = CURRENT_TIME; 1581 + inode->i_ctime = inode->i_mtime = current_time(inode); 1582 1582 1583 1583 if (page->index < I0_BLOCKS) 1584 1584 return logfs_write_direct(inode, page, flags);
+1 -1
fs/minix/bitmap.c
··· 253 253 } 254 254 inode_init_owner(inode, dir, mode); 255 255 inode->i_ino = j; 256 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC; 256 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 257 257 inode->i_blocks = 0; 258 258 memset(&minix_i(inode)->u, 0, sizeof(minix_i(inode)->u)); 259 259 insert_inode_hash(inode);
+3 -3
fs/minix/dir.c
··· 274 274 de->inode = inode->i_ino; 275 275 } 276 276 err = dir_commit_chunk(page, pos, sbi->s_dirsize); 277 - dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; 277 + dir->i_mtime = dir->i_ctime = current_time(dir); 278 278 mark_inode_dirty(dir); 279 279 out_put: 280 280 dir_put_page(page); ··· 306 306 unlock_page(page); 307 307 } 308 308 dir_put_page(page); 309 - inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC; 309 + inode->i_ctime = inode->i_mtime = current_time(inode); 310 310 mark_inode_dirty(inode); 311 311 return err; 312 312 } ··· 430 430 unlock_page(page); 431 431 } 432 432 dir_put_page(page); 433 - dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; 433 + dir->i_mtime = dir->i_ctime = current_time(dir); 434 434 mark_inode_dirty(dir); 435 435 } 436 436
+2 -2
fs/minix/itree_common.c
··· 124 124 125 125 /* We are done with atomic stuff, now do the rest of housekeeping */ 126 126 127 - inode->i_ctime = CURRENT_TIME_SEC; 127 + inode->i_ctime = current_time(inode); 128 128 129 129 /* had we spliced it onto indirect block? */ 130 130 if (where->bh) ··· 343 343 } 344 344 first_whole++; 345 345 } 346 - inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC; 346 + inode->i_mtime = inode->i_ctime = current_time(inode); 347 347 mark_inode_dirty(inode); 348 348 } 349 349
+7 -3
fs/minix/namei.c
··· 106 106 { 107 107 struct inode *inode = d_inode(old_dentry); 108 108 109 - inode->i_ctime = CURRENT_TIME_SEC; 109 + inode->i_ctime = current_time(inode); 110 110 inode_inc_link_count(inode); 111 111 ihold(inode); 112 112 return add_nondir(dentry, inode); ··· 185 185 } 186 186 187 187 static int minix_rename(struct inode * old_dir, struct dentry *old_dentry, 188 - struct inode * new_dir, struct dentry *new_dentry) 188 + struct inode * new_dir, struct dentry *new_dentry, 189 + unsigned int flags) 189 190 { 190 191 struct inode * old_inode = d_inode(old_dentry); 191 192 struct inode * new_inode = d_inode(new_dentry); ··· 195 194 struct page * old_page; 196 195 struct minix_dir_entry * old_de; 197 196 int err = -ENOENT; 197 + 198 + if (flags & ~RENAME_NOREPLACE) 199 + return -EINVAL; 198 200 199 201 old_de = minix_find_entry(old_dentry, &old_page); 200 202 if (!old_de) ··· 223 219 if (!new_de) 224 220 goto out_dir; 225 221 minix_set_link(new_de, new_page, old_inode); 226 - new_inode->i_ctime = CURRENT_TIME_SEC; 222 + new_inode->i_ctime = current_time(new_inode); 227 223 if (dir_de) 228 224 drop_nlink(new_inode); 229 225 inode_dec_link_count(new_inode);
+3 -12
fs/namei.c
··· 4369 4369 if (error) 4370 4370 return error; 4371 4371 4372 - if (!old_dir->i_op->rename && !old_dir->i_op->rename2) 4372 + if (!old_dir->i_op->rename) 4373 4373 return -EPERM; 4374 - 4375 - if (flags && !old_dir->i_op->rename2) 4376 - return -EINVAL; 4377 4374 4378 4375 /* 4379 4376 * If we are going to change the parent - check write permissions, ··· 4425 4428 if (error) 4426 4429 goto out; 4427 4430 } 4428 - if (!old_dir->i_op->rename2) { 4429 - error = old_dir->i_op->rename(old_dir, old_dentry, 4430 - new_dir, new_dentry); 4431 - } else { 4432 - WARN_ON(old_dir->i_op->rename != NULL); 4433 - error = old_dir->i_op->rename2(old_dir, old_dentry, 4434 - new_dir, new_dentry, flags); 4435 - } 4431 + error = old_dir->i_op->rename(old_dir, old_dentry, 4432 + new_dir, new_dentry, flags); 4436 4433 if (error) 4437 4434 goto out; 4438 4435
+7 -4
fs/ncpfs/dir.c
··· 36 36 static int ncp_mkdir(struct inode *, struct dentry *, umode_t); 37 37 static int ncp_rmdir(struct inode *, struct dentry *); 38 38 static int ncp_rename(struct inode *, struct dentry *, 39 - struct inode *, struct dentry *); 39 + struct inode *, struct dentry *, unsigned int); 40 40 static int ncp_mknod(struct inode * dir, struct dentry *dentry, 41 41 umode_t mode, dev_t rdev); 42 42 #if defined(CONFIG_NCPFS_EXTRAS) || defined(CONFIG_NCPFS_NFS_NS) ··· 133 133 return 0; 134 134 135 135 if (!ncp_case_sensitive(inode)) { 136 - struct super_block *sb = dentry->d_sb; 137 136 struct nls_table *t; 138 137 unsigned long hash; 139 138 int i; 140 139 141 - t = NCP_IO_TABLE(sb); 140 + t = NCP_IO_TABLE(dentry->d_sb); 142 141 hash = init_name_hash(dentry); 143 142 for (i=0; i<this->len ; i++) 144 143 hash = partial_name_hash(ncp_tolower(t, this->name[i]), ··· 1105 1106 } 1106 1107 1107 1108 static int ncp_rename(struct inode *old_dir, struct dentry *old_dentry, 1108 - struct inode *new_dir, struct dentry *new_dentry) 1109 + struct inode *new_dir, struct dentry *new_dentry, 1110 + unsigned int flags) 1109 1111 { 1110 1112 struct ncp_server *server = NCP_SERVER(old_dir); 1111 1113 int error; 1112 1114 int old_len, new_len; 1113 1115 __u8 __old_name[NCP_MAXPATHLEN + 1], __new_name[NCP_MAXPATHLEN + 1]; 1116 + 1117 + if (flags) 1118 + return -EINVAL; 1114 1119 1115 1120 ncp_dbg(1, "%pd2 to %pd2\n", old_dentry, new_dentry); 1116 1121
+5 -1
fs/nfs/dir.c
··· 2013 2013 * the rename. 2014 2014 */ 2015 2015 int nfs_rename(struct inode *old_dir, struct dentry *old_dentry, 2016 - struct inode *new_dir, struct dentry *new_dentry) 2016 + struct inode *new_dir, struct dentry *new_dentry, 2017 + unsigned int flags) 2017 2018 { 2018 2019 struct inode *old_inode = d_inode(old_dentry); 2019 2020 struct inode *new_inode = d_inode(new_dentry); 2020 2021 struct dentry *dentry = NULL, *rehash = NULL; 2021 2022 struct rpc_task *task; 2022 2023 int error = -EBUSY; 2024 + 2025 + if (flags) 2026 + return -EINVAL; 2023 2027 2024 2028 dfprintk(VFS, "NFS: rename(%pd2 -> %pd2, ct=%d)\n", 2025 2029 old_dentry, new_dentry,
+2 -1
fs/nfs/internal.h
··· 359 359 int nfs_symlink(struct inode *, struct dentry *, const char *); 360 360 int nfs_link(struct dentry *, struct inode *, struct dentry *); 361 361 int nfs_mknod(struct inode *, struct dentry *, umode_t, dev_t); 362 - int nfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); 362 + int nfs_rename(struct inode *, struct dentry *, 363 + struct inode *, struct dentry *, unsigned int); 363 364 364 365 /* file.c */ 365 366 int nfs_file_fsync(struct file *file, loff_t start, loff_t end, int datasync);
+1 -1
fs/nfsd/blocklayout.c
··· 123 123 124 124 if (lcp->lc_mtime.tv_nsec == UTIME_NOW || 125 125 timespec_compare(&lcp->lc_mtime, &inode->i_mtime) < 0) 126 - lcp->lc_mtime = current_fs_time(inode->i_sb); 126 + lcp->lc_mtime = current_time(inode); 127 127 iattr.ia_valid |= ATTR_ATIME | ATTR_CTIME | ATTR_MTIME; 128 128 iattr.ia_atime = iattr.ia_ctime = iattr.ia_mtime = lcp->lc_mtime; 129 129
+3 -3
fs/nilfs2/dir.c
··· 438 438 nilfs_set_de_type(de, inode); 439 439 nilfs_commit_chunk(page, mapping, from, to); 440 440 nilfs_put_page(page); 441 - dir->i_mtime = dir->i_ctime = CURRENT_TIME; 441 + dir->i_mtime = dir->i_ctime = current_time(dir); 442 442 } 443 443 444 444 /* ··· 528 528 de->inode = cpu_to_le64(inode->i_ino); 529 529 nilfs_set_de_type(de, inode); 530 530 nilfs_commit_chunk(page, page->mapping, from, to); 531 - dir->i_mtime = dir->i_ctime = CURRENT_TIME; 531 + dir->i_mtime = dir->i_ctime = current_time(dir); 532 532 nilfs_mark_inode_dirty(dir); 533 533 /* OFFSET_CACHE */ 534 534 out_put: ··· 576 576 pde->rec_len = nilfs_rec_len_to_disk(to - from); 577 577 dir->inode = 0; 578 578 nilfs_commit_chunk(page, mapping, from, to); 579 - inode->i_ctime = inode->i_mtime = CURRENT_TIME; 579 + inode->i_ctime = inode->i_mtime = current_time(inode); 580 580 out: 581 581 nilfs_put_page(page); 582 582 return err;
+2 -2
fs/nilfs2/inode.c
··· 367 367 atomic64_inc(&root->inodes_count); 368 368 inode_init_owner(inode, dir, mode); 369 369 inode->i_ino = ino; 370 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 370 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 371 371 372 372 if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) { 373 373 err = nilfs_bmap_read(ii->i_bmap, NULL); ··· 749 749 750 750 nilfs_truncate_bmap(ii, blkoff); 751 751 752 - inode->i_mtime = inode->i_ctime = CURRENT_TIME; 752 + inode->i_mtime = inode->i_ctime = current_time(inode); 753 753 if (IS_SYNC(inode)) 754 754 nilfs_set_transaction_flag(NILFS_TI_SYNC); 755 755
+1 -1
fs/nilfs2/ioctl.c
··· 174 174 (flags & FS_FL_USER_MODIFIABLE); 175 175 176 176 nilfs_set_inode_flags(inode); 177 - inode->i_ctime = CURRENT_TIME; 177 + inode->i_ctime = current_time(inode); 178 178 if (IS_SYNC(inode)) 179 179 nilfs_set_transaction_flag(NILFS_TI_SYNC); 180 180
+8 -4
fs/nilfs2/namei.c
··· 194 194 if (err) 195 195 return err; 196 196 197 - inode->i_ctime = CURRENT_TIME; 197 + inode->i_ctime = current_time(inode); 198 198 inode_inc_link_count(inode); 199 199 ihold(inode); 200 200 ··· 350 350 } 351 351 352 352 static int nilfs_rename(struct inode *old_dir, struct dentry *old_dentry, 353 - struct inode *new_dir, struct dentry *new_dentry) 353 + struct inode *new_dir, struct dentry *new_dentry, 354 + unsigned int flags) 354 355 { 355 356 struct inode *old_inode = d_inode(old_dentry); 356 357 struct inode *new_inode = d_inode(new_dentry); ··· 361 360 struct nilfs_dir_entry *old_de; 362 361 struct nilfs_transaction_info ti; 363 362 int err; 363 + 364 + if (flags & ~RENAME_NOREPLACE) 365 + return -EINVAL; 364 366 365 367 err = nilfs_transaction_begin(old_dir->i_sb, &ti, 1); 366 368 if (unlikely(err)) ··· 395 391 goto out_dir; 396 392 nilfs_set_link(new_dir, new_de, new_page, old_inode); 397 393 nilfs_mark_inode_dirty(new_dir); 398 - new_inode->i_ctime = CURRENT_TIME; 394 + new_inode->i_ctime = current_time(new_inode); 399 395 if (dir_de) 400 396 drop_nlink(new_inode); 401 397 drop_nlink(new_inode); ··· 414 410 * Like most other Unix systems, set the ctime for inodes on a 415 411 * rename. 416 412 */ 417 - old_inode->i_ctime = CURRENT_TIME; 413 + old_inode->i_ctime = current_time(old_inode); 418 414 419 415 nilfs_delete_entry(old_de, old_page); 420 416
+1 -1
fs/nsfs.c
··· 78 78 return ERR_PTR(-ENOMEM); 79 79 } 80 80 inode->i_ino = ns->inum; 81 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 81 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 82 82 inode->i_flags |= S_IMMUTABLE; 83 83 inode->i_mode = S_IFREG | S_IRUGO; 84 84 inode->i_fop = &ns_file_operations;
+1 -1
fs/ntfs/inode.c
··· 2813 2813 * for real. 2814 2814 */ 2815 2815 if (!IS_NOCMTIME(VFS_I(base_ni)) && !IS_RDONLY(VFS_I(base_ni))) { 2816 - struct timespec now = current_fs_time(VFS_I(base_ni)->i_sb); 2816 + struct timespec now = current_time(VFS_I(base_ni)); 2817 2817 int sync_it = 0; 2818 2818 2819 2819 if (!timespec_equal(&VFS_I(base_ni)->i_mtime, &now) ||
+1 -1
fs/ntfs/mft.c
··· 2692 2692 2693 2693 /* Set the inode times to the current time. */ 2694 2694 vi->i_atime = vi->i_mtime = vi->i_ctime = 2695 - current_fs_time(vi->i_sb); 2695 + current_time(vi); 2696 2696 /* 2697 2697 * Set the file size to 0, the ntfs inode sizes are set to 0 by 2698 2698 * the call to ntfs_init_big_inode() below.
+1 -1
fs/ocfs2/acl.c
··· 201 201 } 202 202 203 203 inode->i_mode = new_mode; 204 - inode->i_ctime = CURRENT_TIME; 204 + inode->i_ctime = current_time(inode); 205 205 di->i_mode = cpu_to_le16(inode->i_mode); 206 206 di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); 207 207 di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec);
+1 -1
fs/ocfs2/alloc.c
··· 7293 7293 } 7294 7294 7295 7295 inode->i_blocks = ocfs2_inode_sector_count(inode); 7296 - inode->i_ctime = inode->i_mtime = CURRENT_TIME; 7296 + inode->i_ctime = inode->i_mtime = current_time(inode); 7297 7297 7298 7298 di->i_ctime = di->i_mtime = cpu_to_le64(inode->i_ctime.tv_sec); 7299 7299 di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec);
+1 -1
fs/ocfs2/aops.c
··· 2030 2030 } 2031 2031 inode->i_blocks = ocfs2_inode_sector_count(inode); 2032 2032 di->i_size = cpu_to_le64((u64)i_size_read(inode)); 2033 - inode->i_mtime = inode->i_ctime = CURRENT_TIME; 2033 + inode->i_mtime = inode->i_ctime = current_time(inode); 2034 2034 di->i_mtime = di->i_ctime = cpu_to_le64(inode->i_mtime.tv_sec); 2035 2035 di->i_mtime_nsec = di->i_ctime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); 2036 2036 ocfs2_update_inode_fsync_trans(handle, inode, 1);
+2 -2
fs/ocfs2/dir.c
··· 1677 1677 offset, ocfs2_dir_trailer_blk_off(dir->i_sb)); 1678 1678 1679 1679 if (ocfs2_dirent_would_fit(de, rec_len)) { 1680 - dir->i_mtime = dir->i_ctime = CURRENT_TIME; 1680 + dir->i_mtime = dir->i_ctime = current_time(dir); 1681 1681 retval = ocfs2_mark_inode_dirty(handle, dir, parent_fe_bh); 1682 1682 if (retval < 0) { 1683 1683 mlog_errno(retval); ··· 2990 2990 ocfs2_dinode_new_extent_list(dir, di); 2991 2991 2992 2992 i_size_write(dir, sb->s_blocksize); 2993 - dir->i_mtime = dir->i_ctime = CURRENT_TIME; 2993 + dir->i_mtime = dir->i_ctime = current_time(dir); 2994 2994 2995 2995 di->i_size = cpu_to_le64(sb->s_blocksize); 2996 2996 di->i_ctime = di->i_mtime = cpu_to_le64(dir->i_ctime.tv_sec);
+2 -2
fs/ocfs2/dlmfs/dlmfs.c
··· 398 398 if (inode) { 399 399 inode->i_ino = get_next_ino(); 400 400 inode_init_owner(inode, NULL, mode); 401 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 401 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 402 402 inc_nlink(inode); 403 403 404 404 inode->i_fop = &simple_dir_operations; ··· 421 421 422 422 inode->i_ino = get_next_ino(); 423 423 inode_init_owner(inode, parent, mode); 424 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 424 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 425 425 426 426 ip = DLMFS_I(inode); 427 427 ip->ip_conn = DLMFS_I(parent)->ip_conn;
+6 -6
fs/ocfs2/file.c
··· 253 253 return 0; 254 254 } 255 255 256 - now = CURRENT_TIME; 256 + now = current_time(inode); 257 257 if ((now.tv_sec - inode->i_atime.tv_sec <= osb->s_atime_quantum)) 258 258 return 0; 259 259 else ··· 287 287 * have i_mutex to guard against concurrent changes to other 288 288 * inode fields. 289 289 */ 290 - inode->i_atime = CURRENT_TIME; 290 + inode->i_atime = current_time(inode); 291 291 di->i_atime = cpu_to_le64(inode->i_atime.tv_sec); 292 292 di->i_atime_nsec = cpu_to_le32(inode->i_atime.tv_nsec); 293 293 ocfs2_update_inode_fsync_trans(handle, inode, 0); ··· 308 308 309 309 i_size_write(inode, new_i_size); 310 310 inode->i_blocks = ocfs2_inode_sector_count(inode); 311 - inode->i_ctime = inode->i_mtime = CURRENT_TIME; 311 + inode->i_ctime = inode->i_mtime = current_time(inode); 312 312 313 313 status = ocfs2_mark_inode_dirty(handle, inode, fe_bh); 314 314 if (status < 0) { ··· 429 429 } 430 430 431 431 i_size_write(inode, new_i_size); 432 - inode->i_ctime = inode->i_mtime = CURRENT_TIME; 432 + inode->i_ctime = inode->i_mtime = current_time(inode); 433 433 434 434 di = (struct ocfs2_dinode *) fe_bh->b_data; 435 435 di->i_size = cpu_to_le64(new_i_size); ··· 840 840 i_size_write(inode, abs_to); 841 841 inode->i_blocks = ocfs2_inode_sector_count(inode); 842 842 di->i_size = cpu_to_le64((u64)i_size_read(inode)); 843 - inode->i_mtime = inode->i_ctime = CURRENT_TIME; 843 + inode->i_mtime = inode->i_ctime = current_time(inode); 844 844 di->i_mtime = di->i_ctime = cpu_to_le64(inode->i_mtime.tv_sec); 845 845 di->i_ctime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); 846 846 di->i_mtime_nsec = di->i_ctime_nsec; ··· 1950 1950 if (change_size && i_size_read(inode) < size) 1951 1951 i_size_write(inode, size); 1952 1952 1953 - inode->i_ctime = inode->i_mtime = CURRENT_TIME; 1953 + inode->i_ctime = inode->i_mtime = current_time(inode); 1954 1954 ret = ocfs2_mark_inode_dirty(handle, inode, di_bh); 1955 1955 if (ret < 0) 1956 1956 mlog_errno(ret);
+1 -1
fs/ocfs2/move_extents.c
··· 953 953 } 954 954 955 955 di = (struct ocfs2_dinode *)di_bh->b_data; 956 - inode->i_ctime = CURRENT_TIME; 956 + inode->i_ctime = current_time(inode); 957 957 di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); 958 958 di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); 959 959 ocfs2_update_inode_fsync_trans(handle, inode, 0);
+10 -6
fs/ocfs2/namei.c
··· 798 798 } 799 799 800 800 inc_nlink(inode); 801 - inode->i_ctime = CURRENT_TIME; 801 + inode->i_ctime = current_time(inode); 802 802 ocfs2_set_links_count(fe, inode->i_nlink); 803 803 fe->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); 804 804 fe->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); ··· 1000 1000 ocfs2_set_links_count(fe, inode->i_nlink); 1001 1001 ocfs2_journal_dirty(handle, fe_bh); 1002 1002 1003 - dir->i_ctime = dir->i_mtime = CURRENT_TIME; 1003 + dir->i_ctime = dir->i_mtime = current_time(dir); 1004 1004 if (S_ISDIR(inode->i_mode)) 1005 1005 drop_nlink(dir); 1006 1006 ··· 1203 1203 static int ocfs2_rename(struct inode *old_dir, 1204 1204 struct dentry *old_dentry, 1205 1205 struct inode *new_dir, 1206 - struct dentry *new_dentry) 1206 + struct dentry *new_dentry, 1207 + unsigned int flags) 1207 1208 { 1208 1209 int status = 0, rename_lock = 0, parents_locked = 0, target_exists = 0; 1209 1210 int old_child_locked = 0, new_child_locked = 0, update_dot_dot = 0; ··· 1228 1227 struct ocfs2_dir_lookup_result orphan_insert = { NULL, }; 1229 1228 struct ocfs2_dir_lookup_result target_insert = { NULL, }; 1230 1229 bool should_add_orphan = false; 1230 + 1231 + if (flags) 1232 + return -EINVAL; 1231 1233 1232 1234 /* At some point it might be nice to break this function up a 1233 1235 * bit. */ ··· 1541 1537 new_dir_bh, &target_insert); 1542 1538 } 1543 1539 1544 - old_inode->i_ctime = CURRENT_TIME; 1540 + old_inode->i_ctime = current_time(old_inode); 1545 1541 mark_inode_dirty(old_inode); 1546 1542 1547 1543 status = ocfs2_journal_access_di(handle, INODE_CACHE(old_inode), ··· 1590 1586 1591 1587 if (new_inode) { 1592 1588 drop_nlink(new_inode); 1593 - new_inode->i_ctime = CURRENT_TIME; 1589 + new_inode->i_ctime = current_time(new_inode); 1594 1590 } 1595 - old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME; 1591 + old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); 1596 1592 1597 1593 if (update_dot_dot) { 1598 1594 status = ocfs2_update_entry(old_inode, handle,
+2 -2
fs/ocfs2/refcounttree.c
··· 3778 3778 goto out_commit; 3779 3779 } 3780 3780 3781 - inode->i_ctime = CURRENT_TIME; 3781 + inode->i_ctime = current_time(inode); 3782 3782 di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); 3783 3783 di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); 3784 3784 ··· 4094 4094 * we want mtime to appear identical to the source and 4095 4095 * update ctime. 4096 4096 */ 4097 - t_inode->i_ctime = CURRENT_TIME; 4097 + t_inode->i_ctime = current_time(t_inode); 4098 4098 4099 4099 di->i_ctime = cpu_to_le64(t_inode->i_ctime.tv_sec); 4100 4100 di->i_ctime_nsec = cpu_to_le32(t_inode->i_ctime.tv_nsec);
+1 -1
fs/ocfs2/xattr.c
··· 3431 3431 goto out; 3432 3432 } 3433 3433 3434 - inode->i_ctime = CURRENT_TIME; 3434 + inode->i_ctime = current_time(inode); 3435 3435 di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); 3436 3436 di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); 3437 3437 ocfs2_journal_dirty(ctxt->handle, xis->inode_bh);
+7 -3
fs/omfs/dir.c
··· 143 143 mark_buffer_dirty(bh); 144 144 brelse(bh); 145 145 146 - dir->i_ctime = CURRENT_TIME_SEC; 146 + dir->i_ctime = current_time(dir); 147 147 148 148 /* mark affected inodes dirty to rebuild checksums */ 149 149 mark_inode_dirty(dir); ··· 371 371 } 372 372 373 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 377 struct inode *new_inode = d_inode(new_dentry); 377 378 struct inode *old_inode = d_inode(old_dentry); 378 379 int err; 380 + 381 + if (flags & ~RENAME_NOREPLACE) 382 + return -EINVAL; 379 383 380 384 if (new_inode) { 381 385 /* overwriting existing file/dir */ ··· 399 395 if (err) 400 396 goto out; 401 397 402 - old_inode->i_ctime = CURRENT_TIME_SEC; 398 + old_inode->i_ctime = current_time(old_inode); 403 399 mark_inode_dirty(old_inode); 404 400 out: 405 401 return err;
+1 -1
fs/omfs/inode.c
··· 49 49 inode_init_owner(inode, NULL, mode); 50 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 53 switch (mode & S_IFMT) { 54 54 case S_IFDIR: 55 55 inode->i_op = &omfs_dir_inops;
+1 -1
fs/openpromfs/inode.c
··· 355 355 if (!inode) 356 356 return ERR_PTR(-ENOMEM); 357 357 if (inode->i_state & I_NEW) { 358 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 358 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 359 359 if (inode->i_ino == OPENPROM_ROOT_INO) { 360 360 inode->i_op = &openprom_inode_operations; 361 361 inode->i_fop = &openprom_operations;
+1 -1
fs/orangefs/file.c
··· 384 384 file_accessed(file); 385 385 } else { 386 386 SetMtimeFlag(orangefs_inode); 387 - inode->i_mtime = CURRENT_TIME; 387 + inode->i_mtime = current_time(inode); 388 388 mark_inode_dirty_sync(inode); 389 389 } 390 390 }
+1 -1
fs/orangefs/inode.c
··· 435 435 inode->i_mode = mode; 436 436 inode->i_uid = current_fsuid(); 437 437 inode->i_gid = current_fsgid(); 438 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 438 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 439 439 inode->i_size = PAGE_SIZE; 440 440 inode->i_rdev = dev; 441 441
+10 -6
fs/orangefs/namei.c
··· 81 81 dentry); 82 82 83 83 SetMtimeFlag(parent); 84 - dir->i_mtime = dir->i_ctime = current_fs_time(dir->i_sb); 84 + dir->i_mtime = dir->i_ctime = current_time(dir); 85 85 mark_inode_dirty_sync(dir); 86 86 ret = 0; 87 87 out: ··· 254 254 drop_nlink(inode); 255 255 256 256 SetMtimeFlag(parent); 257 - dir->i_mtime = dir->i_ctime = current_fs_time(dir->i_sb); 257 + dir->i_mtime = dir->i_ctime = current_time(dir); 258 258 mark_inode_dirty_sync(dir); 259 259 } 260 260 return ret; ··· 331 331 dentry); 332 332 333 333 SetMtimeFlag(parent); 334 - dir->i_mtime = dir->i_ctime = current_fs_time(dir->i_sb); 334 + dir->i_mtime = dir->i_ctime = current_time(dir); 335 335 mark_inode_dirty_sync(dir); 336 336 ret = 0; 337 337 out: ··· 399 399 * across clients; keep constant at 1. 400 400 */ 401 401 SetMtimeFlag(parent); 402 - dir->i_mtime = dir->i_ctime = current_fs_time(dir->i_sb); 402 + dir->i_mtime = dir->i_ctime = current_time(dir); 403 403 mark_inode_dirty_sync(dir); 404 404 out: 405 405 op_release(new_op); ··· 409 409 static int orangefs_rename(struct inode *old_dir, 410 410 struct dentry *old_dentry, 411 411 struct inode *new_dir, 412 - struct dentry *new_dentry) 412 + struct dentry *new_dentry, 413 + unsigned int flags) 413 414 { 414 415 struct orangefs_kernel_op_s *new_op; 415 416 int ret; 417 + 418 + if (flags) 419 + return -EINVAL; 416 420 417 421 gossip_debug(GOSSIP_NAME_DEBUG, 418 422 "orangefs_rename: called (%pd2 => %pd2) ct=%d\n", ··· 447 443 ret); 448 444 449 445 if (new_dentry->d_inode) 450 - new_dentry->d_inode->i_ctime = CURRENT_TIME; 446 + new_dentry->d_inode->i_ctime = current_time(new_dentry->d_inode); 451 447 452 448 op_release(new_op); 453 449 return ret;
+1 -1
fs/overlayfs/dir.c
··· 1006 1006 .symlink = ovl_symlink, 1007 1007 .unlink = ovl_unlink, 1008 1008 .rmdir = ovl_rmdir, 1009 - .rename2 = ovl_rename2, 1009 + .rename = ovl_rename2, 1010 1010 .link = ovl_link, 1011 1011 .setattr = ovl_setattr, 1012 1012 .create = ovl_create,
+2 -2
fs/overlayfs/overlayfs.h
··· 114 114 { 115 115 int err; 116 116 117 - pr_debug("rename2(%pd2, %pd2, 0x%x)\n", 117 + pr_debug("rename(%pd2, %pd2, 0x%x)\n", 118 118 olddentry, newdentry, flags); 119 119 120 120 err = vfs_rename(olddir, olddentry, newdir, newdentry, NULL, flags); 121 121 122 122 if (err) { 123 - pr_debug("...rename2(%pd2, %pd2, ...) = %i\n", 123 + pr_debug("...rename(%pd2, %pd2, ...) = %i\n", 124 124 olddentry, newdentry, err); 125 125 } 126 126 return err;
+1 -1
fs/pipe.c
··· 713 713 inode->i_mode = S_IFIFO | S_IRUSR | S_IWUSR; 714 714 inode->i_uid = current_fsuid(); 715 715 inode->i_gid = current_fsgid(); 716 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 716 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 717 717 718 718 return inode; 719 719
+1 -1
fs/posix_acl.c
··· 929 929 acl = NULL; 930 930 } 931 931 932 - inode->i_ctime = CURRENT_TIME; 932 + inode->i_ctime = current_time(inode); 933 933 set_cached_acl(inode, type, acl); 934 934 return 0; 935 935 }
+1 -1
fs/proc/base.c
··· 1671 1671 /* Common stuff */ 1672 1672 ei = PROC_I(inode); 1673 1673 inode->i_ino = get_next_ino(); 1674 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 1674 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 1675 1675 inode->i_op = &proc_def_inode_operations; 1676 1676 1677 1677 /*
+1 -2
fs/proc/inode.c
··· 68 68 ei->sysctl_entry = NULL; 69 69 ei->ns_ops = NULL; 70 70 inode = &ei->vfs_inode; 71 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 72 71 return inode; 73 72 } 74 73 ··· 420 421 421 422 if (inode) { 422 423 inode->i_ino = de->low_ino; 423 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 424 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 424 425 PROC_I(inode)->pde = de; 425 426 426 427 if (is_empty_pde(de)) {
+1 -1
fs/proc/proc_sysctl.c
··· 445 445 ei->sysctl = head; 446 446 ei->sysctl_entry = table; 447 447 448 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 448 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 449 449 inode->i_mode = table->mode; 450 450 if (!S_ISDIR(table->mode)) { 451 451 inode->i_mode |= S_IFREG;
+1 -1
fs/proc/self.c
··· 56 56 struct inode *inode = new_inode_pseudo(s); 57 57 if (inode) { 58 58 inode->i_ino = self_inum; 59 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 59 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 60 60 inode->i_mode = S_IFLNK | S_IRWXUGO; 61 61 inode->i_uid = GLOBAL_ROOT_UID; 62 62 inode->i_gid = GLOBAL_ROOT_GID;
+1 -1
fs/proc/thread_self.c
··· 58 58 struct inode *inode = new_inode_pseudo(s); 59 59 if (inode) { 60 60 inode->i_ino = thread_self_inum; 61 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 61 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 62 62 inode->i_mode = S_IFLNK | S_IRWXUGO; 63 63 inode->i_uid = GLOBAL_ROOT_UID; 64 64 inode->i_gid = GLOBAL_ROOT_GID;
+1 -1
fs/pstore/inode.c
··· 230 230 struct inode *inode = new_inode(sb); 231 231 if (inode) { 232 232 inode->i_ino = get_next_ino(); 233 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 233 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 234 234 } 235 235 return inode; 236 236 }
+3 -3
fs/ramfs/inode.c
··· 61 61 inode->i_mapping->a_ops = &ramfs_aops; 62 62 mapping_set_gfp_mask(inode->i_mapping, GFP_HIGHUSER); 63 63 mapping_set_unevictable(inode->i_mapping); 64 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 64 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 65 65 switch (mode & S_IFMT) { 66 66 default: 67 67 init_special_inode(inode, mode, dev); ··· 100 100 d_instantiate(dentry, inode); 101 101 dget(dentry); /* Extra count - pin the dentry in core */ 102 102 error = 0; 103 - dir->i_mtime = dir->i_ctime = CURRENT_TIME; 103 + dir->i_mtime = dir->i_ctime = current_time(dir); 104 104 } 105 105 return error; 106 106 } ··· 130 130 if (!error) { 131 131 d_instantiate(dentry, inode); 132 132 dget(dentry); 133 - dir->i_mtime = dir->i_ctime = CURRENT_TIME; 133 + dir->i_mtime = dir->i_ctime = current_time(dir); 134 134 } else 135 135 iput(inode); 136 136 }
+1 -1
fs/reiserfs/inode.c
··· 2005 2005 if (S_ISLNK(inode->i_mode)) 2006 2006 inode->i_flags &= ~(S_IMMUTABLE | S_APPEND); 2007 2007 2008 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC; 2008 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 2009 2009 inode->i_size = i_size; 2010 2010 inode->i_blocks = 0; 2011 2011 inode->i_bytes = 0;
+2 -2
fs/reiserfs/ioctl.c
··· 94 94 } 95 95 sd_attrs_to_i_attrs(flags, inode); 96 96 REISERFS_I(inode)->i_attrs = flags; 97 - inode->i_ctime = CURRENT_TIME_SEC; 97 + inode->i_ctime = current_time(inode); 98 98 mark_inode_dirty(inode); 99 99 setflags_out: 100 100 mnt_drop_write_file(filp); ··· 115 115 err = -EFAULT; 116 116 goto setversion_out; 117 117 } 118 - inode->i_ctime = CURRENT_TIME_SEC; 118 + inode->i_ctime = current_time(inode); 119 119 mark_inode_dirty(inode); 120 120 setversion_out: 121 121 mnt_drop_write_file(filp);
+11 -7
fs/reiserfs/namei.c
··· 570 570 } 571 571 572 572 dir->i_size += paste_size; 573 - dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; 573 + dir->i_mtime = dir->i_ctime = current_time(dir); 574 574 if (!S_ISDIR(inode->i_mode) && visible) 575 575 /* reiserfs_mkdir or reiserfs_rename will do that by itself */ 576 576 reiserfs_update_sd(th, dir); ··· 963 963 inode->i_nlink); 964 964 965 965 clear_nlink(inode); 966 - inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; 966 + inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(dir); 967 967 reiserfs_update_sd(&th, inode); 968 968 969 969 DEC_DIR_INODE_NLINK(dir) ··· 1067 1067 inc_nlink(inode); 1068 1068 goto end_unlink; 1069 1069 } 1070 - inode->i_ctime = CURRENT_TIME_SEC; 1070 + inode->i_ctime = current_time(inode); 1071 1071 reiserfs_update_sd(&th, inode); 1072 1072 1073 1073 dir->i_size -= (de.de_entrylen + DEH_SIZE); 1074 - dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; 1074 + dir->i_ctime = dir->i_mtime = current_time(dir); 1075 1075 reiserfs_update_sd(&th, dir); 1076 1076 1077 1077 if (!savelink) ··· 1246 1246 return err ? err : retval; 1247 1247 } 1248 1248 1249 - inode->i_ctime = CURRENT_TIME_SEC; 1249 + inode->i_ctime = current_time(inode); 1250 1250 reiserfs_update_sd(&th, inode); 1251 1251 1252 1252 ihold(inode); ··· 1306 1306 * get_empty_nodes or its clones 1307 1307 */ 1308 1308 static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry, 1309 - struct inode *new_dir, struct dentry *new_dentry) 1309 + struct inode *new_dir, struct dentry *new_dentry, 1310 + unsigned int flags) 1310 1311 { 1311 1312 int retval; 1312 1313 INITIALIZE_PATH(old_entry_path); ··· 1321 1320 umode_t old_inode_mode; 1322 1321 unsigned long savelink = 1; 1323 1322 struct timespec ctime; 1323 + 1324 + if (flags & ~RENAME_NOREPLACE) 1325 + return -EINVAL; 1324 1326 1325 1327 /* 1326 1328 * three balancings: (1) old name removal, (2) new name insertion ··· 1571 1567 1572 1568 mark_de_hidden(old_de.de_deh + old_de.de_entry_num); 1573 1569 journal_mark_dirty(&th, old_de.de_bh); 1574 - ctime = CURRENT_TIME_SEC; 1570 + ctime = current_time(old_dir); 1575 1571 old_dir->i_ctime = old_dir->i_mtime = ctime; 1576 1572 new_dir->i_ctime = new_dir->i_mtime = ctime; 1577 1573 /*
+4 -4
fs/reiserfs/stree.c
··· 1987 1987 pathrelse(&s_search_path); 1988 1988 1989 1989 if (update_timestamps) { 1990 - inode->i_mtime = CURRENT_TIME_SEC; 1991 - inode->i_ctime = CURRENT_TIME_SEC; 1990 + inode->i_mtime = current_time(inode); 1991 + inode->i_ctime = current_time(inode); 1992 1992 } 1993 1993 reiserfs_update_sd(th, inode); 1994 1994 ··· 2012 2012 update_and_out: 2013 2013 if (update_timestamps) { 2014 2014 /* this is truncate, not file closing */ 2015 - inode->i_mtime = CURRENT_TIME_SEC; 2016 - inode->i_ctime = CURRENT_TIME_SEC; 2015 + inode->i_mtime = current_time(inode); 2016 + inode->i_ctime = current_time(inode); 2017 2017 } 2018 2018 reiserfs_update_sd(th, inode); 2019 2019
+1 -1
fs/reiserfs/super.c
··· 2522 2522 if (inode->i_size < off + len - towrite) 2523 2523 i_size_write(inode, off + len - towrite); 2524 2524 inode->i_version++; 2525 - inode->i_mtime = inode->i_ctime = CURRENT_TIME; 2525 + inode->i_mtime = inode->i_ctime = current_time(inode); 2526 2526 mark_inode_dirty(inode); 2527 2527 return len - towrite; 2528 2528 }
+3 -3
fs/reiserfs/xattr.c
··· 450 450 451 451 static void update_ctime(struct inode *inode) 452 452 { 453 - struct timespec now = current_fs_time(inode->i_sb); 453 + struct timespec now = current_time(inode); 454 454 455 455 if (inode_unhashed(inode) || !inode->i_nlink || 456 456 timespec_equal(&inode->i_ctime, &now)) 457 457 return; 458 458 459 - inode->i_ctime = CURRENT_TIME_SEC; 459 + inode->i_ctime = current_time(inode); 460 460 mark_inode_dirty(inode); 461 461 } 462 462 ··· 575 575 new_size = buffer_size + sizeof(struct reiserfs_xattr_header); 576 576 if (!err && new_size < i_size_read(d_inode(dentry))) { 577 577 struct iattr newattrs = { 578 - .ia_ctime = current_fs_time(inode->i_sb), 578 + .ia_ctime = current_time(inode), 579 579 .ia_size = new_size, 580 580 .ia_valid = ATTR_SIZE | ATTR_CTIME, 581 581 };
+1 -1
fs/reiserfs/xattr_acl.c
··· 273 273 if (error == -ENODATA) { 274 274 error = 0; 275 275 if (type == ACL_TYPE_ACCESS) { 276 - inode->i_ctime = CURRENT_TIME_SEC; 276 + inode->i_ctime = current_time(inode); 277 277 mark_inode_dirty(inode); 278 278 } 279 279 }
+3 -3
fs/sysv/dir.c
··· 215 215 memset (de->name + namelen, 0, SYSV_DIRSIZE - namelen - 2); 216 216 de->inode = cpu_to_fs16(SYSV_SB(inode->i_sb), inode->i_ino); 217 217 err = dir_commit_chunk(page, pos, SYSV_DIRSIZE); 218 - dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; 218 + dir->i_mtime = dir->i_ctime = current_time(dir); 219 219 mark_inode_dirty(dir); 220 220 out_page: 221 221 dir_put_page(page); ··· 239 239 de->inode = 0; 240 240 err = dir_commit_chunk(page, pos, SYSV_DIRSIZE); 241 241 dir_put_page(page); 242 - inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC; 242 + inode->i_ctime = inode->i_mtime = current_time(inode); 243 243 mark_inode_dirty(inode); 244 244 return err; 245 245 } ··· 337 337 de->inode = cpu_to_fs16(SYSV_SB(inode->i_sb), inode->i_ino); 338 338 err = dir_commit_chunk(page, pos, SYSV_DIRSIZE); 339 339 dir_put_page(page); 340 - dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; 340 + dir->i_mtime = dir->i_ctime = current_time(dir); 341 341 mark_inode_dirty(dir); 342 342 } 343 343
+1 -1
fs/sysv/ialloc.c
··· 164 164 dirty_sb(sb); 165 165 inode_init_owner(inode, dir, mode); 166 166 inode->i_ino = fs16_to_cpu(sbi, ino); 167 - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC; 167 + inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); 168 168 inode->i_blocks = 0; 169 169 memset(SYSV_I(inode)->i_data, 0, sizeof(SYSV_I(inode)->i_data)); 170 170 SYSV_I(inode)->i_dir_start_lookup = 0;
+2 -2
fs/sysv/itree.c
··· 178 178 *where->p = where->key; 179 179 write_unlock(&pointers_lock); 180 180 181 - inode->i_ctime = CURRENT_TIME_SEC; 181 + inode->i_ctime = current_time(inode); 182 182 183 183 /* had we spliced it onto indirect block? */ 184 184 if (where->bh) ··· 418 418 } 419 419 n++; 420 420 } 421 - inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC; 421 + inode->i_mtime = inode->i_ctime = current_time(inode); 422 422 if (IS_SYNC(inode)) 423 423 sysv_sync_inode (inode); 424 424 else
+7 -3
fs/sysv/namei.c
··· 120 120 { 121 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 124 inode_inc_link_count(inode); 125 125 ihold(inode); 126 126 ··· 206 206 * higher-level routines. 207 207 */ 208 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 212 struct inode * old_inode = d_inode(old_dentry); 212 213 struct inode * new_inode = d_inode(new_dentry); ··· 216 215 struct page * old_page; 217 216 struct sysv_dir_entry * old_de; 218 217 int err = -ENOENT; 218 + 219 + if (flags & ~RENAME_NOREPLACE) 220 + return -EINVAL; 219 221 220 222 old_de = sysv_find_entry(old_dentry, &old_page); 221 223 if (!old_de) ··· 244 240 if (!new_de) 245 241 goto out_dir; 246 242 sysv_set_link(new_de, new_page, old_inode); 247 - new_inode->i_ctime = CURRENT_TIME_SEC; 243 + new_inode->i_ctime = current_time(new_inode); 248 244 if (dir_de) 249 245 drop_nlink(new_inode); 250 246 inode_dec_link_count(new_inode);
+1 -1
fs/tracefs/inode.c
··· 133 133 struct inode *inode = new_inode(sb); 134 134 if (inode) { 135 135 inode->i_ino = get_next_ino(); 136 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 136 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 137 137 } 138 138 return inode; 139 139 }
+6 -2
fs/ubifs/dir.c
··· 966 966 } 967 967 968 968 static int ubifs_rename(struct inode *old_dir, struct dentry *old_dentry, 969 - struct inode *new_dir, struct dentry *new_dentry) 969 + struct inode *new_dir, struct dentry *new_dentry, 970 + unsigned int flags) 970 971 { 971 972 struct ubifs_info *c = old_dir->i_sb->s_fs_info; 972 973 struct inode *old_inode = d_inode(old_dentry); ··· 984 983 .dirtied_ino_d = ALIGN(old_inode_ui->data_len, 8) }; 985 984 struct timespec time; 986 985 unsigned int uninitialized_var(saved_nlink); 986 + 987 + if (flags & ~RENAME_NOREPLACE) 988 + return -EINVAL; 987 989 988 990 /* 989 991 * Budget request settings: deletion direntry, new direntry, removing ··· 1183 1179 .mkdir = ubifs_mkdir, 1184 1180 .rmdir = ubifs_rmdir, 1185 1181 .mknod = ubifs_mknod, 1186 - .rename = ubifs_rename, 1182 + .rename = ubifs_rename, 1187 1183 .setattr = ubifs_setattr, 1188 1184 .getattr = ubifs_getattr, 1189 1185 .listxattr = ubifs_listxattr,
+1 -1
fs/udf/ialloc.c
··· 121 121 else 122 122 iinfo->i_alloc_type = ICBTAG_FLAG_AD_LONG; 123 123 inode->i_mtime = inode->i_atime = inode->i_ctime = 124 - iinfo->i_crtime = current_fs_time(inode->i_sb); 124 + iinfo->i_crtime = current_time(inode); 125 125 if (unlikely(insert_inode_locked(inode) < 0)) { 126 126 make_bad_inode(inode); 127 127 iput(inode);
+2 -2
fs/udf/inode.c
··· 886 886 *new = 1; 887 887 iinfo->i_next_alloc_block = block; 888 888 iinfo->i_next_alloc_goal = newblocknum; 889 - inode->i_ctime = current_fs_time(inode->i_sb); 889 + inode->i_ctime = current_time(inode); 890 890 891 891 if (IS_SYNC(inode)) 892 892 udf_sync_inode(inode); ··· 1268 1268 up_write(&iinfo->i_data_sem); 1269 1269 } 1270 1270 update_time: 1271 - inode->i_mtime = inode->i_ctime = current_fs_time(inode->i_sb); 1271 + inode->i_mtime = inode->i_ctime = current_time(inode); 1272 1272 if (IS_SYNC(inode)) 1273 1273 udf_sync_inode(inode); 1274 1274 else
+15 -11
fs/udf/namei.c
··· 616 616 *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse = 617 617 cpu_to_le32(iinfo->i_unique & 0x00000000FFFFFFFFUL); 618 618 udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); 619 - dir->i_ctime = dir->i_mtime = current_fs_time(dir->i_sb); 619 + dir->i_ctime = dir->i_mtime = current_time(dir); 620 620 mark_inode_dirty(dir); 621 621 if (fibh.sbh != fibh.ebh) 622 622 brelse(fibh.ebh); ··· 730 730 cfi.fileCharacteristics |= FID_FILE_CHAR_DIRECTORY; 731 731 udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); 732 732 inc_nlink(dir); 733 - dir->i_ctime = dir->i_mtime = current_fs_time(dir->i_sb); 733 + dir->i_ctime = dir->i_mtime = current_time(dir); 734 734 mark_inode_dirty(dir); 735 735 unlock_new_inode(inode); 736 736 d_instantiate(dentry, inode); ··· 845 845 inode->i_size = 0; 846 846 inode_dec_link_count(dir); 847 847 inode->i_ctime = dir->i_ctime = dir->i_mtime = 848 - current_fs_time(dir->i_sb); 848 + current_time(inode); 849 849 mark_inode_dirty(dir); 850 850 851 851 end_rmdir: ··· 888 888 retval = udf_delete_entry(dir, fi, &fibh, &cfi); 889 889 if (retval) 890 890 goto end_unlink; 891 - dir->i_ctime = dir->i_mtime = current_fs_time(dir->i_sb); 891 + dir->i_ctime = dir->i_mtime = current_time(dir); 892 892 mark_inode_dirty(dir); 893 893 inode_dec_link_count(inode); 894 894 inode->i_ctime = dir->i_ctime; ··· 1079 1079 brelse(fibh.ebh); 1080 1080 brelse(fibh.sbh); 1081 1081 inc_nlink(inode); 1082 - inode->i_ctime = current_fs_time(inode->i_sb); 1082 + inode->i_ctime = current_time(inode); 1083 1083 mark_inode_dirty(inode); 1084 - dir->i_ctime = dir->i_mtime = current_fs_time(dir->i_sb); 1084 + dir->i_ctime = dir->i_mtime = current_time(dir); 1085 1085 mark_inode_dirty(dir); 1086 1086 ihold(inode); 1087 1087 d_instantiate(dentry, inode); ··· 1093 1093 * higher-level routines. 1094 1094 */ 1095 1095 static int udf_rename(struct inode *old_dir, struct dentry *old_dentry, 1096 - struct inode *new_dir, struct dentry *new_dentry) 1096 + struct inode *new_dir, struct dentry *new_dentry, 1097 + unsigned int flags) 1097 1098 { 1098 1099 struct inode *old_inode = d_inode(old_dentry); 1099 1100 struct inode *new_inode = d_inode(new_dentry); ··· 1105 1104 int retval = -ENOENT; 1106 1105 struct kernel_lb_addr tloc; 1107 1106 struct udf_inode_info *old_iinfo = UDF_I(old_inode); 1107 + 1108 + if (flags & ~RENAME_NOREPLACE) 1109 + return -EINVAL; 1108 1110 1109 1111 ofi = udf_find_entry(old_dir, &old_dentry->d_name, &ofibh, &ocfi); 1110 1112 if (IS_ERR(ofi)) { ··· 1176 1172 * Like most other Unix systems, set the ctime for inodes on a 1177 1173 * rename. 1178 1174 */ 1179 - old_inode->i_ctime = current_fs_time(old_inode->i_sb); 1175 + old_inode->i_ctime = current_time(old_inode); 1180 1176 mark_inode_dirty(old_inode); 1181 1177 1182 1178 /* ··· 1192 1188 udf_delete_entry(old_dir, ofi, &ofibh, &ocfi); 1193 1189 1194 1190 if (new_inode) { 1195 - new_inode->i_ctime = current_fs_time(new_inode->i_sb); 1191 + new_inode->i_ctime = current_time(new_inode); 1196 1192 inode_dec_link_count(new_inode); 1197 1193 } 1198 - old_dir->i_ctime = old_dir->i_mtime = current_fs_time(old_dir->i_sb); 1199 - new_dir->i_ctime = new_dir->i_mtime = current_fs_time(new_dir->i_sb); 1194 + old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); 1195 + new_dir->i_ctime = new_dir->i_mtime = current_time(new_dir); 1200 1196 mark_inode_dirty(old_dir); 1201 1197 mark_inode_dirty(new_dir); 1202 1198
+3 -3
fs/ufs/dir.c
··· 100 100 err = ufs_commit_chunk(page, pos, len); 101 101 ufs_put_page(page); 102 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 104 mark_inode_dirty(dir); 105 105 } 106 106 ··· 389 389 ufs_set_de_type(sb, de, inode->i_mode); 390 390 391 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 394 mark_inode_dirty(dir); 395 395 /* OFFSET_CACHE */ ··· 530 530 pde->d_reclen = cpu_to_fs16(sb, to - from); 531 531 dir->d_ino = 0; 532 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 534 mark_inode_dirty(inode); 535 535 out: 536 536 ufs_put_page(page);
+1 -1
fs/ufs/ialloc.c
··· 290 290 inode_init_owner(inode, dir, mode); 291 291 inode->i_blocks = 0; 292 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 294 ufsi->i_flags = UFS_I(dir)->i_flags; 295 295 ufsi->i_lastfrag = 0; 296 296 ufsi->i_shadow = 0;
+3 -3
fs/ufs/inode.c
··· 293 293 294 294 if (new) 295 295 *new = 1; 296 - inode->i_ctime = CURRENT_TIME_SEC; 296 + inode->i_ctime = current_time(inode); 297 297 if (IS_SYNC(inode)) 298 298 ufs_sync_inode (inode); 299 299 mark_inode_dirty(inode); ··· 375 375 mark_buffer_dirty(bh); 376 376 if (IS_SYNC(inode)) 377 377 sync_dirty_buffer(bh); 378 - inode->i_ctime = CURRENT_TIME_SEC; 378 + inode->i_ctime = current_time(inode); 379 379 mark_inode_dirty(inode); 380 380 out: 381 381 brelse (bh); ··· 1185 1185 truncate_setsize(inode, size); 1186 1186 1187 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 1189 mark_inode_dirty(inode); 1190 1190 out: 1191 1191 UFSD("EXIT: err %d\n", err);
+8 -4
fs/ufs/namei.c
··· 153 153 struct inode *inode = d_inode(old_dentry); 154 154 int error; 155 155 156 - inode->i_ctime = CURRENT_TIME_SEC; 156 + inode->i_ctime = current_time(inode); 157 157 inode_inc_link_count(inode); 158 158 ihold(inode); 159 159 ··· 245 245 } 246 246 247 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 251 struct inode *old_inode = d_inode(old_dentry); 251 252 struct inode *new_inode = d_inode(new_dentry); ··· 255 254 struct page *old_page; 256 255 struct ufs_dir_entry *old_de; 257 256 int err = -ENOENT; 257 + 258 + if (flags & ~RENAME_NOREPLACE) 259 + return -EINVAL; 258 260 259 261 old_de = ufs_find_entry(old_dir, &old_dentry->d_name, &old_page); 260 262 if (!old_de) ··· 283 279 if (!new_de) 284 280 goto out_dir; 285 281 ufs_set_link(new_dir, new_de, new_page, old_inode, 1); 286 - new_inode->i_ctime = CURRENT_TIME_SEC; 282 + new_inode->i_ctime = current_time(new_inode); 287 283 if (dir_de) 288 284 drop_nlink(new_inode); 289 285 inode_dec_link_count(new_inode); ··· 299 295 * Like most other Unix systems, set the ctime for inodes on a 300 296 * rename. 301 297 */ 302 - old_inode->i_ctime = CURRENT_TIME_SEC; 298 + old_inode->i_ctime = current_time(old_inode); 303 299 304 300 ufs_delete_entry(old_dir, old_de, old_page); 305 301 mark_inode_dirty(old_inode);
+1 -1
fs/xfs/xfs_acl.c
··· 236 236 237 237 iattr.ia_valid = ATTR_MODE | ATTR_CTIME; 238 238 iattr.ia_mode = mode; 239 - iattr.ia_ctime = current_fs_time(inode->i_sb); 239 + iattr.ia_ctime = current_time(inode); 240 240 241 241 error = xfs_setattr_nonsize(XFS_I(inode), &iattr, XFS_ATTR_NOACL); 242 242 }
+1 -1
fs/xfs/xfs_inode.c
··· 821 821 ip->i_d.di_nextents = 0; 822 822 ASSERT(ip->i_d.di_nblocks == 0); 823 823 824 - tv = current_fs_time(mp->m_super); 824 + tv = current_time(inode); 825 825 inode->i_mtime = tv; 826 826 inode->i_atime = tv; 827 827 inode->i_ctime = tv;
+3 -3
fs/xfs/xfs_iops.c
··· 896 896 if (newsize != oldsize && 897 897 !(iattr->ia_valid & (ATTR_CTIME | ATTR_MTIME))) { 898 898 iattr->ia_ctime = iattr->ia_mtime = 899 - current_fs_time(inode->i_sb); 899 + current_time(inode); 900 900 iattr->ia_valid |= ATTR_CTIME | ATTR_MTIME; 901 901 } 902 902 ··· 1086 1086 */ 1087 1087 .rmdir = xfs_vn_unlink, 1088 1088 .mknod = xfs_vn_mknod, 1089 - .rename2 = xfs_vn_rename, 1089 + .rename = xfs_vn_rename, 1090 1090 .get_acl = xfs_get_acl, 1091 1091 .set_acl = xfs_set_acl, 1092 1092 .getattr = xfs_vn_getattr, ··· 1111 1111 */ 1112 1112 .rmdir = xfs_vn_unlink, 1113 1113 .mknod = xfs_vn_mknod, 1114 - .rename2 = xfs_vn_rename, 1114 + .rename = xfs_vn_rename, 1115 1115 .get_acl = xfs_get_acl, 1116 1116 .set_acl = xfs_set_acl, 1117 1117 .getattr = xfs_vn_getattr,
+1 -1
fs/xfs/xfs_trans_inode.c
··· 73 73 ASSERT(tp); 74 74 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); 75 75 76 - tv = current_fs_time(inode->i_sb); 76 + tv = current_time(inode); 77 77 78 78 if (flags & XFS_ICHGTIME_MOD) 79 79 inode->i_mtime = tv;
+3 -3
include/linux/fs.h
··· 1473 1473 } 1474 1474 1475 1475 extern struct timespec current_fs_time(struct super_block *sb); 1476 + extern struct timespec current_time(struct inode *inode); 1476 1477 1477 1478 /* 1478 1479 * Snapshotting support. ··· 1748 1747 int (*rmdir) (struct inode *,struct dentry *); 1749 1748 int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t); 1750 1749 int (*rename) (struct inode *, struct dentry *, 1751 - struct inode *, struct dentry *); 1752 - int (*rename2) (struct inode *, struct dentry *, 1753 1750 struct inode *, struct dentry *, unsigned int); 1754 1751 int (*setattr) (struct dentry *, struct iattr *); 1755 1752 int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); ··· 2964 2965 extern int simple_link(struct dentry *, struct inode *, struct dentry *); 2965 2966 extern int simple_unlink(struct inode *, struct dentry *); 2966 2967 extern int simple_rmdir(struct inode *, struct dentry *); 2967 - extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); 2968 + extern int simple_rename(struct inode *, struct dentry *, 2969 + struct inode *, struct dentry *, unsigned int); 2968 2970 extern int noop_fsync(struct file *, loff_t, loff_t, int); 2969 2971 extern int simple_empty(struct dentry *); 2970 2972 extern int simple_readpage(struct file *file, struct page *page);
+9 -9
ipc/mqueue.c
··· 225 225 inode->i_mode = mode; 226 226 inode->i_uid = current_fsuid(); 227 227 inode->i_gid = current_fsgid(); 228 - inode->i_mtime = inode->i_ctime = inode->i_atime = CURRENT_TIME; 228 + inode->i_mtime = inode->i_ctime = inode->i_atime = current_time(inode); 229 229 230 230 if (S_ISREG(mode)) { 231 231 struct mqueue_inode_info *info; ··· 446 446 447 447 put_ipc_ns(ipc_ns); 448 448 dir->i_size += DIRENT_SIZE; 449 - dir->i_ctime = dir->i_mtime = dir->i_atime = CURRENT_TIME; 449 + dir->i_ctime = dir->i_mtime = dir->i_atime = current_time(dir); 450 450 451 451 d_instantiate(dentry, inode); 452 452 dget(dentry); ··· 462 462 { 463 463 struct inode *inode = d_inode(dentry); 464 464 465 - dir->i_ctime = dir->i_mtime = dir->i_atime = CURRENT_TIME; 465 + dir->i_ctime = dir->i_mtime = dir->i_atime = current_time(dir); 466 466 dir->i_size -= DIRENT_SIZE; 467 467 drop_nlink(inode); 468 468 dput(dentry); ··· 500 500 if (ret <= 0) 501 501 return ret; 502 502 503 - file_inode(filp)->i_atime = file_inode(filp)->i_ctime = CURRENT_TIME; 503 + file_inode(filp)->i_atime = file_inode(filp)->i_ctime = current_time(file_inode(filp)); 504 504 return ret; 505 505 } 506 506 ··· 1060 1060 __do_notify(info); 1061 1061 } 1062 1062 inode->i_atime = inode->i_mtime = inode->i_ctime = 1063 - CURRENT_TIME; 1063 + current_time(inode); 1064 1064 } 1065 1065 out_unlock: 1066 1066 spin_unlock(&info->lock); ··· 1156 1156 msg_ptr = msg_get(info); 1157 1157 1158 1158 inode->i_atime = inode->i_mtime = inode->i_ctime = 1159 - CURRENT_TIME; 1159 + current_time(inode); 1160 1160 1161 1161 /* There is now free space in queue. */ 1162 1162 pipelined_receive(&wake_q, info); ··· 1277 1277 if (u_notification == NULL) { 1278 1278 if (info->notify_owner == task_tgid(current)) { 1279 1279 remove_notification(info); 1280 - inode->i_atime = inode->i_ctime = CURRENT_TIME; 1280 + inode->i_atime = inode->i_ctime = current_time(inode); 1281 1281 } 1282 1282 } else if (info->notify_owner != NULL) { 1283 1283 ret = -EBUSY; ··· 1302 1302 1303 1303 info->notify_owner = get_pid(task_tgid(current)); 1304 1304 info->notify_user_ns = get_user_ns(current_user_ns()); 1305 - inode->i_atime = inode->i_ctime = CURRENT_TIME; 1305 + inode->i_atime = inode->i_ctime = current_time(inode); 1306 1306 } 1307 1307 spin_unlock(&info->lock); 1308 1308 out_fput: ··· 1359 1359 f.file->f_flags &= ~O_NONBLOCK; 1360 1360 spin_unlock(&f.file->f_lock); 1361 1361 1362 - inode->i_atime = inode->i_ctime = CURRENT_TIME; 1362 + inode->i_atime = inode->i_ctime = current_time(inode); 1363 1363 } 1364 1364 1365 1365 spin_unlock(&info->lock);
+1 -1
kernel/bpf/inode.c
··· 97 97 return ERR_PTR(-ENOSPC); 98 98 99 99 inode->i_ino = get_next_ino(); 100 - inode->i_atime = CURRENT_TIME; 100 + inode->i_atime = current_time(inode); 101 101 inode->i_mtime = inode->i_atime; 102 102 inode->i_ctime = inode->i_atime; 103 103
+11 -11
mm/shmem.c
··· 934 934 void shmem_truncate_range(struct inode *inode, loff_t lstart, loff_t lend) 935 935 { 936 936 shmem_undo_range(inode, lstart, lend, false); 937 - inode->i_ctime = inode->i_mtime = CURRENT_TIME; 937 + inode->i_ctime = inode->i_mtime = current_time(inode); 938 938 } 939 939 EXPORT_SYMBOL_GPL(shmem_truncate_range); 940 940 ··· 979 979 if (error) 980 980 return error; 981 981 i_size_write(inode, newsize); 982 - inode->i_ctime = inode->i_mtime = CURRENT_TIME; 982 + inode->i_ctime = inode->i_mtime = current_time(inode); 983 983 } 984 984 if (newsize <= oldsize) { 985 985 loff_t holebegin = round_up(newsize, PAGE_SIZE); ··· 2083 2083 inode->i_ino = get_next_ino(); 2084 2084 inode_init_owner(inode, dir, mode); 2085 2085 inode->i_blocks = 0; 2086 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 2086 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 2087 2087 inode->i_generation = get_seconds(); 2088 2088 info = SHMEM_I(inode); 2089 2089 memset(info, 0, (char *)inode - (char *)info); ··· 2741 2741 2742 2742 if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + len > inode->i_size) 2743 2743 i_size_write(inode, offset + len); 2744 - inode->i_ctime = CURRENT_TIME; 2744 + inode->i_ctime = current_time(inode); 2745 2745 undone: 2746 2746 spin_lock(&inode->i_lock); 2747 2747 inode->i_private = NULL; ··· 2794 2794 2795 2795 error = 0; 2796 2796 dir->i_size += BOGO_DIRENT_SIZE; 2797 - dir->i_ctime = dir->i_mtime = CURRENT_TIME; 2797 + dir->i_ctime = dir->i_mtime = current_time(dir); 2798 2798 d_instantiate(dentry, inode); 2799 2799 dget(dentry); /* Extra count - pin the dentry in core */ 2800 2800 } ··· 2862 2862 goto out; 2863 2863 2864 2864 dir->i_size += BOGO_DIRENT_SIZE; 2865 - inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME; 2865 + inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); 2866 2866 inc_nlink(inode); 2867 2867 ihold(inode); /* New dentry reference */ 2868 2868 dget(dentry); /* Extra pinning count for the created dentry */ ··· 2879 2879 shmem_free_inode(inode->i_sb); 2880 2880 2881 2881 dir->i_size -= BOGO_DIRENT_SIZE; 2882 - inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME; 2882 + inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); 2883 2883 drop_nlink(inode); 2884 2884 dput(dentry); /* Undo the count from "create" - this does all the work */ 2885 2885 return 0; ··· 2912 2912 old_dir->i_ctime = old_dir->i_mtime = 2913 2913 new_dir->i_ctime = new_dir->i_mtime = 2914 2914 d_inode(old_dentry)->i_ctime = 2915 - d_inode(new_dentry)->i_ctime = CURRENT_TIME; 2915 + d_inode(new_dentry)->i_ctime = current_time(old_dir); 2916 2916 2917 2917 return 0; 2918 2918 } ··· 2986 2986 new_dir->i_size += BOGO_DIRENT_SIZE; 2987 2987 old_dir->i_ctime = old_dir->i_mtime = 2988 2988 new_dir->i_ctime = new_dir->i_mtime = 2989 - inode->i_ctime = CURRENT_TIME; 2989 + inode->i_ctime = current_time(old_dir); 2990 2990 return 0; 2991 2991 } 2992 2992 ··· 3041 3041 put_page(page); 3042 3042 } 3043 3043 dir->i_size += BOGO_DIRENT_SIZE; 3044 - dir->i_ctime = dir->i_mtime = CURRENT_TIME; 3044 + dir->i_ctime = dir->i_mtime = current_time(dir); 3045 3045 d_instantiate(dentry, inode); 3046 3046 dget(dentry); 3047 3047 return 0; ··· 3692 3692 .mkdir = shmem_mkdir, 3693 3693 .rmdir = shmem_rmdir, 3694 3694 .mknod = shmem_mknod, 3695 - .rename2 = shmem_rename2, 3695 + .rename = shmem_rename2, 3696 3696 .tmpfile = shmem_tmpfile, 3697 3697 #endif 3698 3698 #ifdef CONFIG_TMPFS_XATTR
+1 -1
net/sunrpc/rpc_pipe.c
··· 477 477 return NULL; 478 478 inode->i_ino = get_next_ino(); 479 479 inode->i_mode = mode; 480 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 480 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 481 481 switch (mode & S_IFMT) { 482 482 case S_IFDIR: 483 483 inode->i_fop = &simple_dir_operations;
+1 -1
security/apparmor/apparmorfs.c
··· 381 381 for (i = 0; i < AAFS_PROF_SIZEOF; i++) { 382 382 new->dents[i] = old->dents[i]; 383 383 if (new->dents[i]) 384 - new->dents[i]->d_inode->i_mtime = CURRENT_TIME; 384 + new->dents[i]->d_inode->i_mtime = current_time(new->dents[i]->d_inode); 385 385 old->dents[i] = NULL; 386 386 } 387 387 }
+1 -1
security/inode.c
··· 117 117 118 118 inode->i_ino = get_next_ino(); 119 119 inode->i_mode = mode; 120 - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 120 + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 121 121 inode->i_private = data; 122 122 if (is_dir) { 123 123 inode->i_op = &simple_dir_inode_operations;
+1 -1
security/selinux/selinuxfs.c
··· 1089 1089 1090 1090 if (ret) { 1091 1091 ret->i_mode = mode; 1092 - ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME; 1092 + ret->i_atime = ret->i_mtime = ret->i_ctime = current_time(ret); 1093 1093 } 1094 1094 return ret; 1095 1095 }
+2 -2
security/tomoyo/realpath.c
··· 173 173 * Use filesystem name if filesystem does not support rename() 174 174 * operation. 175 175 */ 176 - if (!inode->i_op->rename && !inode->i_op->rename2) 176 + if (!inode->i_op->rename) 177 177 goto prepend_filesystem_name; 178 178 } 179 179 /* Prepend device name. */ ··· 283 283 * or dentry without vfsmount. 284 284 */ 285 285 if (!path->mnt || 286 - (!inode->i_op->rename && !inode->i_op->rename2)) 286 + (!inode->i_op->rename)) 287 287 pos = tomoyo_get_local_path(path->dentry, buf, 288 288 buf_len - 1); 289 289 /* Get absolute name for the rest. */