mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 17:25:38 +00:00
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
This commit is contained in:
commit
101105b171
@ -51,8 +51,6 @@ prototypes:
|
||||
int (*rmdir) (struct inode *,struct dentry *);
|
||||
int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t);
|
||||
int (*rename) (struct inode *, struct dentry *,
|
||||
struct inode *, struct dentry *);
|
||||
int (*rename2) (struct inode *, struct dentry *,
|
||||
struct inode *, struct dentry *, unsigned int);
|
||||
int (*readlink) (struct dentry *, char __user *,int);
|
||||
const char *(*get_link) (struct dentry *, struct inode *, void **);
|
||||
@ -80,8 +78,7 @@ symlink: yes
|
||||
mkdir: yes
|
||||
unlink: yes (both)
|
||||
rmdir: yes (both) (see below)
|
||||
rename: yes (all) (see below)
|
||||
rename2: yes (all) (see below)
|
||||
rename: yes (all) (see below)
|
||||
readlink: no
|
||||
get_link: no
|
||||
setattr: yes
|
||||
@ -97,8 +94,7 @@ tmpfile: no
|
||||
|
||||
Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on
|
||||
victim.
|
||||
cross-directory ->rename() and rename2() has (per-superblock)
|
||||
->s_vfs_rename_sem.
|
||||
cross-directory ->rename() has (per-superblock) ->s_vfs_rename_sem.
|
||||
|
||||
See Documentation/filesystems/directory-locking for more detailed discussion
|
||||
of the locking scheme for directory operations.
|
||||
|
@ -19,7 +19,7 @@ locks victim and calls the method. Locks are exclusive.
|
||||
|
||||
4) rename() that is _not_ cross-directory. Locking rules: caller locks
|
||||
the parent and finds source and target. In case of exchange (with
|
||||
RENAME_EXCHANGE in rename2() flags argument) lock both. In any case,
|
||||
RENAME_EXCHANGE in flags argument) lock both. In any case,
|
||||
if the target already exists, lock it. If the source is a non-directory,
|
||||
lock it. If we need to lock both, lock them in inode pointer order.
|
||||
Then call the method. All locks are exclusive.
|
||||
|
@ -592,3 +592,7 @@ in your dentry operations instead.
|
||||
work just as well; if it's something more complicated, use dentry->d_parent.
|
||||
Just be careful not to assume that fetching it more than once will yield
|
||||
the same value - in RCU mode it could change under you.
|
||||
--
|
||||
[mandatory]
|
||||
->rename() has an added flags argument. Any flags not handled by the
|
||||
filesystem should result in EINVAL being returned.
|
||||
|
@ -375,8 +375,6 @@ struct inode_operations {
|
||||
int (*rmdir) (struct inode *,struct dentry *);
|
||||
int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t);
|
||||
int (*rename) (struct inode *, struct dentry *,
|
||||
struct inode *, struct dentry *);
|
||||
int (*rename2) (struct inode *, struct dentry *,
|
||||
struct inode *, struct dentry *, unsigned int);
|
||||
int (*readlink) (struct dentry *, char __user *,int);
|
||||
const char *(*get_link) (struct dentry *, struct inode *,
|
||||
@ -442,11 +440,8 @@ otherwise noted.
|
||||
rename: called by the rename(2) system call to rename the object to
|
||||
have the parent and name given by the second inode and dentry.
|
||||
|
||||
rename2: this has an additional flags argument compared to rename.
|
||||
If no flags are supported by the filesystem then this method
|
||||
need not be implemented. If some flags are supported then the
|
||||
filesystem must return -EINVAL for any unsupported or unknown
|
||||
flags. Currently the following flags are implemented:
|
||||
The filesystem must return -EINVAL for any unsupported or
|
||||
unknown flags. Currently the following flags are implemented:
|
||||
(1) RENAME_NOREPLACE: this flag indicates that if the target
|
||||
of the rename exists the rename should fail with -EEXIST
|
||||
instead of replacing the target. The VFS already checks for
|
||||
|
@ -103,7 +103,7 @@ spufs_new_inode(struct super_block *sb, umode_t mode)
|
||||
inode->i_mode = mode;
|
||||
inode->i_uid = current_fsuid();
|
||||
inode->i_gid = current_fsgid();
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
out:
|
||||
return inode;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ static void hypfs_update_update(struct super_block *sb)
|
||||
struct inode *inode = d_inode(sb_info->update_file);
|
||||
|
||||
sb_info->last_update = get_seconds();
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
}
|
||||
|
||||
/* directory tree removal functions */
|
||||
@ -99,7 +99,7 @@ static struct inode *hypfs_make_inode(struct super_block *sb, umode_t mode)
|
||||
ret->i_mode = mode;
|
||||
ret->i_uid = hypfs_info->uid;
|
||||
ret->i_gid = hypfs_info->gid;
|
||||
ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME;
|
||||
ret->i_atime = ret->i_mtime = ret->i_ctime = current_time(ret);
|
||||
if (S_ISDIR(mode))
|
||||
set_nlink(ret, 2);
|
||||
}
|
||||
|
@ -934,7 +934,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf,
|
||||
|
||||
if (ret > 0) {
|
||||
struct inode *inode = file_inode(file);
|
||||
inode->i_atime = current_fs_time(inode->i_sb);
|
||||
inode->i_atime = current_time(inode);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -64,7 +64,7 @@ static int qibfs_mknod(struct inode *dir, struct dentry *dentry,
|
||||
inode->i_uid = GLOBAL_ROOT_UID;
|
||||
inode->i_gid = GLOBAL_ROOT_GID;
|
||||
inode->i_blocks = 0;
|
||||
inode->i_atime = CURRENT_TIME;
|
||||
inode->i_atime = current_time(inode);
|
||||
inode->i_mtime = inode->i_atime;
|
||||
inode->i_ctime = inode->i_atime;
|
||||
inode->i_private = data;
|
||||
|
@ -144,7 +144,7 @@ static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode)
|
||||
if (ret) {
|
||||
ret->i_ino = get_next_ino();
|
||||
ret->i_mode = mode;
|
||||
ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME;
|
||||
ret->i_atime = ret->i_mtime = ret->i_ctime = current_time(ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ static struct inode *oprofilefs_get_inode(struct super_block *sb, int mode)
|
||||
if (inode) {
|
||||
inode->i_ino = get_next_ino();
|
||||
inode->i_mode = mode;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
}
|
||||
return inode;
|
||||
}
|
||||
|
@ -4116,7 +4116,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf,
|
||||
|
||||
if (ret > 0) {
|
||||
struct inode *inode = file_inode(file);
|
||||
inode->i_atime = current_fs_time(inode->i_sb);
|
||||
inode->i_atime = current_time(inode);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -1097,13 +1097,17 @@ static int ll_link(struct dentry *old_dentry, struct inode *dir,
|
||||
}
|
||||
|
||||
static int ll_rename(struct inode *src, struct dentry *src_dchild,
|
||||
struct inode *tgt, struct dentry *tgt_dchild)
|
||||
struct inode *tgt, struct dentry *tgt_dchild,
|
||||
unsigned int flags)
|
||||
{
|
||||
struct ptlrpc_request *request = NULL;
|
||||
struct ll_sb_info *sbi = ll_i2sbi(src);
|
||||
struct md_op_data *op_data;
|
||||
int err;
|
||||
|
||||
if (flags)
|
||||
return -EINVAL;
|
||||
|
||||
CDEBUG(D_VFSTRACE,
|
||||
"VFS Op:oldname=%pd, src_dir="DFID"(%p), newname=%pd, tgt_dir="DFID"(%p)\n",
|
||||
src_dchild, PFID(ll_inode2fid(src)), src,
|
||||
@ -1148,7 +1152,7 @@ const struct inode_operations ll_dir_inode_operations = {
|
||||
.rmdir = ll_rmdir,
|
||||
.symlink = ll_symlink,
|
||||
.link = ll_link,
|
||||
.rename = ll_rename,
|
||||
.rename = ll_rename,
|
||||
.setattr = ll_setattr,
|
||||
.getattr = ll_getattr,
|
||||
.permission = ll_inode_permission,
|
||||
|
@ -2409,21 +2409,21 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,
|
||||
snoop(&dev->dev, "%s: CONTROL\n", __func__);
|
||||
ret = proc_control(ps, p);
|
||||
if (ret >= 0)
|
||||
inode->i_mtime = CURRENT_TIME;
|
||||
inode->i_mtime = current_time(inode);
|
||||
break;
|
||||
|
||||
case USBDEVFS_BULK:
|
||||
snoop(&dev->dev, "%s: BULK\n", __func__);
|
||||
ret = proc_bulk(ps, p);
|
||||
if (ret >= 0)
|
||||
inode->i_mtime = CURRENT_TIME;
|
||||
inode->i_mtime = current_time(inode);
|
||||
break;
|
||||
|
||||
case USBDEVFS_RESETEP:
|
||||
snoop(&dev->dev, "%s: RESETEP\n", __func__);
|
||||
ret = proc_resetep(ps, p);
|
||||
if (ret >= 0)
|
||||
inode->i_mtime = CURRENT_TIME;
|
||||
inode->i_mtime = current_time(inode);
|
||||
break;
|
||||
|
||||
case USBDEVFS_RESET:
|
||||
@ -2435,7 +2435,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,
|
||||
snoop(&dev->dev, "%s: CLEAR_HALT\n", __func__);
|
||||
ret = proc_clearhalt(ps, p);
|
||||
if (ret >= 0)
|
||||
inode->i_mtime = CURRENT_TIME;
|
||||
inode->i_mtime = current_time(inode);
|
||||
break;
|
||||
|
||||
case USBDEVFS_GETDRIVER:
|
||||
@ -2462,7 +2462,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,
|
||||
snoop(&dev->dev, "%s: SUBMITURB\n", __func__);
|
||||
ret = proc_submiturb(ps, p);
|
||||
if (ret >= 0)
|
||||
inode->i_mtime = CURRENT_TIME;
|
||||
inode->i_mtime = current_time(inode);
|
||||
break;
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
@ -2470,14 +2470,14 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,
|
||||
snoop(&dev->dev, "%s: CONTROL32\n", __func__);
|
||||
ret = proc_control_compat(ps, p);
|
||||
if (ret >= 0)
|
||||
inode->i_mtime = CURRENT_TIME;
|
||||
inode->i_mtime = current_time(inode);
|
||||
break;
|
||||
|
||||
case USBDEVFS_BULK32:
|
||||
snoop(&dev->dev, "%s: BULK32\n", __func__);
|
||||
ret = proc_bulk_compat(ps, p);
|
||||
if (ret >= 0)
|
||||
inode->i_mtime = CURRENT_TIME;
|
||||
inode->i_mtime = current_time(inode);
|
||||
break;
|
||||
|
||||
case USBDEVFS_DISCSIGNAL32:
|
||||
@ -2489,7 +2489,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,
|
||||
snoop(&dev->dev, "%s: SUBMITURB32\n", __func__);
|
||||
ret = proc_submiturb_compat(ps, p);
|
||||
if (ret >= 0)
|
||||
inode->i_mtime = CURRENT_TIME;
|
||||
inode->i_mtime = current_time(inode);
|
||||
break;
|
||||
|
||||
case USBDEVFS_IOCTL32:
|
||||
@ -2552,7 +2552,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,
|
||||
done:
|
||||
usb_unlock_device(dev);
|
||||
if (ret >= 0)
|
||||
inode->i_atime = CURRENT_TIME;
|
||||
inode->i_atime = current_time(inode);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1196,15 +1196,15 @@ ffs_sb_make_inode(struct super_block *sb, void *data,
|
||||
inode = new_inode(sb);
|
||||
|
||||
if (likely(inode)) {
|
||||
struct timespec current_time = CURRENT_TIME;
|
||||
struct timespec ts = current_time(inode);
|
||||
|
||||
inode->i_ino = get_next_ino();
|
||||
inode->i_mode = perms->mode;
|
||||
inode->i_uid = perms->uid;
|
||||
inode->i_gid = perms->gid;
|
||||
inode->i_atime = current_time;
|
||||
inode->i_mtime = current_time;
|
||||
inode->i_ctime = current_time;
|
||||
inode->i_atime = ts;
|
||||
inode->i_mtime = ts;
|
||||
inode->i_ctime = ts;
|
||||
inode->i_private = data;
|
||||
if (fops)
|
||||
inode->i_fop = fops;
|
||||
|
@ -1913,7 +1913,7 @@ gadgetfs_make_inode (struct super_block *sb,
|
||||
inode->i_uid = make_kuid(&init_user_ns, default_uid);
|
||||
inode->i_gid = make_kgid(&init_user_ns, default_gid);
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime
|
||||
= CURRENT_TIME;
|
||||
= current_time(inode);
|
||||
inode->i_private = data;
|
||||
inode->i_fop = fops;
|
||||
}
|
||||
|
@ -148,7 +148,8 @@ extern struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
|
||||
extern int v9fs_vfs_unlink(struct inode *i, struct dentry *d);
|
||||
extern int v9fs_vfs_rmdir(struct inode *i, struct dentry *d);
|
||||
extern int v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry);
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags);
|
||||
extern struct inode *v9fs_inode_from_fid(struct v9fs_session_info *v9ses,
|
||||
struct p9_fid *fid,
|
||||
struct super_block *sb, int new);
|
||||
|
@ -276,7 +276,7 @@ int v9fs_init_inode(struct v9fs_session_info *v9ses,
|
||||
inode_init_owner(inode, NULL, mode);
|
||||
inode->i_blocks = 0;
|
||||
inode->i_rdev = rdev;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
inode->i_mapping->a_ops = &v9fs_addr_operations;
|
||||
|
||||
switch (mode & S_IFMT) {
|
||||
@ -955,7 +955,8 @@ int v9fs_vfs_rmdir(struct inode *i, struct dentry *d)
|
||||
|
||||
int
|
||||
v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry)
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags)
|
||||
{
|
||||
int retval;
|
||||
struct inode *old_inode;
|
||||
@ -966,6 +967,9 @@ v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct p9_fid *newdirfid;
|
||||
struct p9_wstat wstat;
|
||||
|
||||
if (flags)
|
||||
return -EINVAL;
|
||||
|
||||
p9_debug(P9_DEBUG_VFS, "\n");
|
||||
retval = 0;
|
||||
old_inode = d_inode(old_dentry);
|
||||
|
@ -199,7 +199,7 @@ adfs_adfs2unix_time(struct timespec *tv, struct inode *inode)
|
||||
return;
|
||||
|
||||
cur_time:
|
||||
*tv = CURRENT_TIME;
|
||||
*tv = current_time(inode);
|
||||
return;
|
||||
|
||||
too_early:
|
||||
|
@ -173,7 +173,8 @@ extern int affs_link(struct dentry *olddentry, struct inode *dir,
|
||||
extern int affs_symlink(struct inode *dir, struct dentry *dentry,
|
||||
const char *symname);
|
||||
extern int affs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry);
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags);
|
||||
|
||||
/* inode.c */
|
||||
|
||||
|
@ -58,7 +58,7 @@ affs_insert_hash(struct inode *dir, struct buffer_head *bh)
|
||||
mark_buffer_dirty_inode(dir_bh, dir);
|
||||
affs_brelse(dir_bh);
|
||||
|
||||
dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC;
|
||||
dir->i_mtime = dir->i_ctime = current_time(dir);
|
||||
dir->i_version++;
|
||||
mark_inode_dirty(dir);
|
||||
|
||||
@ -112,7 +112,7 @@ affs_remove_hash(struct inode *dir, struct buffer_head *rem_bh)
|
||||
|
||||
affs_brelse(bh);
|
||||
|
||||
dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC;
|
||||
dir->i_mtime = dir->i_ctime = current_time(dir);
|
||||
dir->i_version++;
|
||||
mark_inode_dirty(dir);
|
||||
|
||||
@ -313,7 +313,7 @@ affs_remove_header(struct dentry *dentry)
|
||||
else
|
||||
clear_nlink(inode);
|
||||
affs_unlock_link(inode);
|
||||
inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_ctime = current_time(inode);
|
||||
mark_inode_dirty(inode);
|
||||
|
||||
done:
|
||||
|
@ -309,7 +309,7 @@ affs_new_inode(struct inode *dir)
|
||||
inode->i_gid = current_fsgid();
|
||||
inode->i_ino = block;
|
||||
set_nlink(inode, 1);
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
|
||||
atomic_set(&AFFS_I(inode)->i_opencnt, 0);
|
||||
AFFS_I(inode)->i_blkcnt = 0;
|
||||
AFFS_I(inode)->i_lc = NULL;
|
||||
|
@ -414,12 +414,16 @@ affs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
|
||||
|
||||
int
|
||||
affs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry)
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags)
|
||||
{
|
||||
struct super_block *sb = old_dir->i_sb;
|
||||
struct buffer_head *bh = NULL;
|
||||
int retval;
|
||||
|
||||
if (flags & ~RENAME_NOREPLACE)
|
||||
return -EINVAL;
|
||||
|
||||
pr_debug("%s(old=%lu,\"%pd\" to new=%lu,\"%pd\")\n", __func__,
|
||||
old_dir->i_ino, old_dentry, new_dir->i_ino, new_dentry);
|
||||
|
||||
|
@ -38,7 +38,8 @@ static int afs_link(struct dentry *from, struct inode *dir,
|
||||
static int afs_symlink(struct inode *dir, struct dentry *dentry,
|
||||
const char *content);
|
||||
static int afs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry);
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags);
|
||||
|
||||
const struct file_operations afs_dir_file_operations = {
|
||||
.open = afs_dir_open,
|
||||
@ -1083,12 +1084,16 @@ static int afs_symlink(struct inode *dir, struct dentry *dentry,
|
||||
* rename a file in an AFS filesystem and/or move it between directories
|
||||
*/
|
||||
static int afs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry)
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags)
|
||||
{
|
||||
struct afs_vnode *orig_dvnode, *new_dvnode, *vnode;
|
||||
struct key *key;
|
||||
int ret;
|
||||
|
||||
if (flags)
|
||||
return -EINVAL;
|
||||
|
||||
vnode = AFS_FS_I(d_inode(old_dentry));
|
||||
orig_dvnode = AFS_FS_I(old_dir);
|
||||
new_dvnode = AFS_FS_I(new_dir);
|
||||
|
@ -237,7 +237,7 @@ int notify_change(struct dentry * dentry, struct iattr * attr, struct inode **de
|
||||
inode->i_flags &= ~S_NOSEC;
|
||||
}
|
||||
|
||||
now = current_fs_time(inode->i_sb);
|
||||
now = current_time(inode);
|
||||
|
||||
attr->ia_ctime = now;
|
||||
if (!(ia_valid & ATTR_ATIME_SET))
|
||||
|
@ -359,7 +359,7 @@ struct inode *autofs4_get_inode(struct super_block *sb, umode_t mode)
|
||||
inode->i_uid = d_inode(sb->s_root)->i_uid;
|
||||
inode->i_gid = d_inode(sb->s_root)->i_gid;
|
||||
}
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
inode->i_ino = get_next_ino();
|
||||
|
||||
if (S_ISDIR(mode)) {
|
||||
|
@ -591,7 +591,7 @@ static int autofs4_dir_symlink(struct inode *dir,
|
||||
if (p_ino && !IS_ROOT(dentry))
|
||||
atomic_inc(&p_ino->count);
|
||||
|
||||
dir->i_mtime = CURRENT_TIME;
|
||||
dir->i_mtime = current_time(dir);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -631,7 +631,7 @@ static int autofs4_dir_unlink(struct inode *dir, struct dentry *dentry)
|
||||
d_inode(dentry)->i_size = 0;
|
||||
clear_nlink(d_inode(dentry));
|
||||
|
||||
dir->i_mtime = CURRENT_TIME;
|
||||
dir->i_mtime = current_time(dir);
|
||||
|
||||
spin_lock(&sbi->lookup_lock);
|
||||
__autofs4_add_expiring(dentry);
|
||||
@ -762,7 +762,7 @@ static int autofs4_dir_mkdir(struct inode *dir,
|
||||
if (p_ino && !IS_ROOT(dentry))
|
||||
atomic_inc(&p_ino->count);
|
||||
inc_nlink(dir);
|
||||
dir->i_mtime = CURRENT_TIME;
|
||||
dir->i_mtime = current_time(dir);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ static const struct inode_operations bad_inode_ops =
|
||||
.mkdir = bad_inode_mkdir,
|
||||
.rmdir = bad_inode_rmdir,
|
||||
.mknod = bad_inode_mknod,
|
||||
.rename2 = bad_inode_rename2,
|
||||
.rename = bad_inode_rename2,
|
||||
.readlink = bad_inode_readlink,
|
||||
/* follow_link must be no-op, otherwise unmounting this inode
|
||||
won't work */
|
||||
@ -153,7 +153,7 @@ void make_bad_inode(struct inode *inode)
|
||||
|
||||
inode->i_mode = S_IFREG;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime =
|
||||
current_fs_time(inode->i_sb);
|
||||
current_time(inode);
|
||||
inode->i_op = &bad_inode_ops;
|
||||
inode->i_opflags &= ~IOP_XATTR;
|
||||
inode->i_fop = &bad_file_ops;
|
||||
|
20
fs/bfs/dir.c
20
fs/bfs/dir.c
@ -97,7 +97,7 @@ static int bfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||
set_bit(ino, info->si_imap);
|
||||
info->si_freei--;
|
||||
inode_init_owner(inode, dir, mode);
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
|
||||
inode->i_blocks = 0;
|
||||
inode->i_op = &bfs_file_inops;
|
||||
inode->i_fop = &bfs_file_operations;
|
||||
@ -165,7 +165,7 @@ static int bfs_link(struct dentry *old, struct inode *dir,
|
||||
return err;
|
||||
}
|
||||
inc_nlink(inode);
|
||||
inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_ctime = current_time(inode);
|
||||
mark_inode_dirty(inode);
|
||||
ihold(inode);
|
||||
d_instantiate(new, inode);
|
||||
@ -194,7 +194,7 @@ static int bfs_unlink(struct inode *dir, struct dentry *dentry)
|
||||
}
|
||||
de->ino = 0;
|
||||
mark_buffer_dirty_inode(bh, dir);
|
||||
dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC;
|
||||
dir->i_ctime = dir->i_mtime = current_time(dir);
|
||||
mark_inode_dirty(dir);
|
||||
inode->i_ctime = dir->i_ctime;
|
||||
inode_dec_link_count(inode);
|
||||
@ -207,7 +207,8 @@ static int bfs_unlink(struct inode *dir, struct dentry *dentry)
|
||||
}
|
||||
|
||||
static int bfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry)
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags)
|
||||
{
|
||||
struct inode *old_inode, *new_inode;
|
||||
struct buffer_head *old_bh, *new_bh;
|
||||
@ -215,6 +216,9 @@ static int bfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct bfs_sb_info *info;
|
||||
int error = -ENOENT;
|
||||
|
||||
if (flags & ~RENAME_NOREPLACE)
|
||||
return -EINVAL;
|
||||
|
||||
old_bh = new_bh = NULL;
|
||||
old_inode = d_inode(old_dentry);
|
||||
if (S_ISDIR(old_inode->i_mode))
|
||||
@ -249,10 +253,10 @@ static int bfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
goto end_rename;
|
||||
}
|
||||
old_de->ino = 0;
|
||||
old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME_SEC;
|
||||
old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir);
|
||||
mark_inode_dirty(old_dir);
|
||||
if (new_inode) {
|
||||
new_inode->i_ctime = CURRENT_TIME_SEC;
|
||||
new_inode->i_ctime = current_time(new_inode);
|
||||
inode_dec_link_count(new_inode);
|
||||
}
|
||||
mark_buffer_dirty_inode(old_bh, old_dir);
|
||||
@ -300,9 +304,9 @@ static int bfs_add_entry(struct inode *dir, const unsigned char *name,
|
||||
pos = (block - sblock) * BFS_BSIZE + off;
|
||||
if (pos >= dir->i_size) {
|
||||
dir->i_size += BFS_DIRENT_SIZE;
|
||||
dir->i_ctime = CURRENT_TIME_SEC;
|
||||
dir->i_ctime = current_time(dir);
|
||||
}
|
||||
dir->i_mtime = CURRENT_TIME_SEC;
|
||||
dir->i_mtime = current_time(dir);
|
||||
mark_inode_dirty(dir);
|
||||
de->ino = cpu_to_le16((u16)ino);
|
||||
for (i = 0; i < BFS_NAMELEN; i++)
|
||||
|
@ -584,7 +584,7 @@ static struct inode *bm_get_inode(struct super_block *sb, int mode)
|
||||
inode->i_ino = get_next_ino();
|
||||
inode->i_mode = mode;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime =
|
||||
current_fs_time(inode->i_sb);
|
||||
current_time(inode);
|
||||
}
|
||||
return inode;
|
||||
}
|
||||
|
@ -1757,7 +1757,7 @@ static void update_time_for_write(struct inode *inode)
|
||||
if (IS_NOCMTIME(inode))
|
||||
return;
|
||||
|
||||
now = current_fs_time(inode->i_sb);
|
||||
now = current_time(inode);
|
||||
if (!timespec_equal(&inode->i_mtime, &now))
|
||||
inode->i_mtime = now;
|
||||
|
||||
@ -2578,7 +2578,7 @@ static int btrfs_punch_hole(struct inode *inode, loff_t offset, loff_t len)
|
||||
goto out_free;
|
||||
|
||||
inode_inc_iversion(inode);
|
||||
inode->i_mtime = inode->i_ctime = current_fs_time(inode->i_sb);
|
||||
inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
|
||||
trans->block_rsv = &root->fs_info->trans_block_rsv;
|
||||
ret = btrfs_update_inode(trans, root, inode);
|
||||
@ -2842,7 +2842,7 @@ static long btrfs_fallocate(struct file *file, int mode,
|
||||
if (IS_ERR(trans)) {
|
||||
ret = PTR_ERR(trans);
|
||||
} else {
|
||||
inode->i_ctime = current_fs_time(inode->i_sb);
|
||||
inode->i_ctime = current_time(inode);
|
||||
i_size_write(inode, actual_end);
|
||||
btrfs_ordered_update_i_size(inode, actual_end, NULL);
|
||||
ret = btrfs_update_inode(trans, root, inode);
|
||||
|
@ -4059,7 +4059,7 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans,
|
||||
inode_inc_iversion(inode);
|
||||
inode_inc_iversion(dir);
|
||||
inode->i_ctime = dir->i_mtime =
|
||||
dir->i_ctime = current_fs_time(inode->i_sb);
|
||||
dir->i_ctime = current_time(inode);
|
||||
ret = btrfs_update_inode(trans, root, dir);
|
||||
out:
|
||||
return ret;
|
||||
@ -4202,7 +4202,7 @@ int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,
|
||||
|
||||
btrfs_i_size_write(dir, dir->i_size - name_len * 2);
|
||||
inode_inc_iversion(dir);
|
||||
dir->i_mtime = dir->i_ctime = current_fs_time(dir->i_sb);
|
||||
dir->i_mtime = dir->i_ctime = current_time(dir);
|
||||
ret = btrfs_update_inode_fallback(trans, root, dir);
|
||||
if (ret)
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
@ -4965,7 +4965,7 @@ static int btrfs_setsize(struct inode *inode, struct iattr *attr)
|
||||
inode_inc_iversion(inode);
|
||||
if (!(mask & (ATTR_CTIME | ATTR_MTIME)))
|
||||
inode->i_ctime = inode->i_mtime =
|
||||
current_fs_time(inode->i_sb);
|
||||
current_time(inode);
|
||||
}
|
||||
|
||||
if (newsize > oldsize) {
|
||||
@ -5672,7 +5672,7 @@ static struct inode *new_simple_dir(struct super_block *s,
|
||||
inode->i_op = &btrfs_dir_ro_inode_operations;
|
||||
inode->i_fop = &simple_dir_operations;
|
||||
inode->i_mode = S_IFDIR | S_IRUGO | S_IWUSR | S_IXUGO;
|
||||
inode->i_mtime = current_fs_time(inode->i_sb);
|
||||
inode->i_mtime = current_time(inode);
|
||||
inode->i_atime = inode->i_mtime;
|
||||
inode->i_ctime = inode->i_mtime;
|
||||
BTRFS_I(inode)->i_otime = inode->i_mtime;
|
||||
@ -6258,7 +6258,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
|
||||
inode_init_owner(inode, dir, mode);
|
||||
inode_set_bytes(inode, 0);
|
||||
|
||||
inode->i_mtime = current_fs_time(inode->i_sb);
|
||||
inode->i_mtime = current_time(inode);
|
||||
inode->i_atime = inode->i_mtime;
|
||||
inode->i_ctime = inode->i_mtime;
|
||||
BTRFS_I(inode)->i_otime = inode->i_mtime;
|
||||
@ -6372,7 +6372,7 @@ int btrfs_add_link(struct btrfs_trans_handle *trans,
|
||||
name_len * 2);
|
||||
inode_inc_iversion(parent_inode);
|
||||
parent_inode->i_mtime = parent_inode->i_ctime =
|
||||
current_fs_time(parent_inode->i_sb);
|
||||
current_time(parent_inode);
|
||||
ret = btrfs_update_inode(trans, root, parent_inode);
|
||||
if (ret)
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
@ -6590,7 +6590,7 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir,
|
||||
BTRFS_I(inode)->dir_index = 0ULL;
|
||||
inc_nlink(inode);
|
||||
inode_inc_iversion(inode);
|
||||
inode->i_ctime = current_fs_time(inode->i_sb);
|
||||
inode->i_ctime = current_time(inode);
|
||||
ihold(inode);
|
||||
set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags);
|
||||
|
||||
@ -9493,7 +9493,7 @@ static int btrfs_rename_exchange(struct inode *old_dir,
|
||||
struct btrfs_root *dest = BTRFS_I(new_dir)->root;
|
||||
struct inode *new_inode = new_dentry->d_inode;
|
||||
struct inode *old_inode = old_dentry->d_inode;
|
||||
struct timespec ctime = CURRENT_TIME;
|
||||
struct timespec ctime = current_time(old_inode);
|
||||
struct dentry *parent;
|
||||
u64 old_ino = btrfs_ino(old_inode);
|
||||
u64 new_ino = btrfs_ino(new_inode);
|
||||
@ -9861,7 +9861,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
inode_inc_iversion(old_inode);
|
||||
old_dir->i_ctime = old_dir->i_mtime =
|
||||
new_dir->i_ctime = new_dir->i_mtime =
|
||||
old_inode->i_ctime = current_fs_time(old_dir->i_sb);
|
||||
old_inode->i_ctime = current_time(old_dir);
|
||||
|
||||
if (old_dentry->d_parent != new_dentry->d_parent)
|
||||
btrfs_record_unlink_dir(trans, old_dir, old_inode, 1);
|
||||
@ -9886,7 +9886,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
|
||||
if (new_inode) {
|
||||
inode_inc_iversion(new_inode);
|
||||
new_inode->i_ctime = current_fs_time(new_inode->i_sb);
|
||||
new_inode->i_ctime = current_time(new_inode);
|
||||
if (unlikely(btrfs_ino(new_inode) ==
|
||||
BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) {
|
||||
root_objectid = BTRFS_I(new_inode)->location.objectid;
|
||||
@ -10404,7 +10404,7 @@ static int __btrfs_prealloc_file_range(struct inode *inode, int mode,
|
||||
*alloc_hint = ins.objectid + ins.offset;
|
||||
|
||||
inode_inc_iversion(inode);
|
||||
inode->i_ctime = current_fs_time(inode->i_sb);
|
||||
inode->i_ctime = current_time(inode);
|
||||
BTRFS_I(inode)->flags |= BTRFS_INODE_PREALLOC;
|
||||
if (!(mode & FALLOC_FL_KEEP_SIZE) &&
|
||||
(actual_len > inode->i_size) &&
|
||||
@ -10552,7 +10552,7 @@ static const struct inode_operations btrfs_dir_inode_operations = {
|
||||
.link = btrfs_link,
|
||||
.mkdir = btrfs_mkdir,
|
||||
.rmdir = btrfs_rmdir,
|
||||
.rename2 = btrfs_rename2,
|
||||
.rename = btrfs_rename2,
|
||||
.symlink = btrfs_symlink,
|
||||
.setattr = btrfs_setattr,
|
||||
.mknod = btrfs_mknod,
|
||||
|
@ -349,7 +349,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg)
|
||||
|
||||
btrfs_update_iflags(inode);
|
||||
inode_inc_iversion(inode);
|
||||
inode->i_ctime = current_fs_time(inode->i_sb);
|
||||
inode->i_ctime = current_time(inode);
|
||||
ret = btrfs_update_inode(trans, root, inode);
|
||||
|
||||
btrfs_end_transaction(trans, root);
|
||||
@ -445,7 +445,7 @@ static noinline int create_subvol(struct inode *dir,
|
||||
struct btrfs_root *root = BTRFS_I(dir)->root;
|
||||
struct btrfs_root *new_root;
|
||||
struct btrfs_block_rsv block_rsv;
|
||||
struct timespec cur_time = current_fs_time(dir->i_sb);
|
||||
struct timespec cur_time = current_time(dir);
|
||||
struct inode *inode;
|
||||
int ret;
|
||||
int err;
|
||||
@ -3291,7 +3291,7 @@ static int clone_finish_inode_update(struct btrfs_trans_handle *trans,
|
||||
|
||||
inode_inc_iversion(inode);
|
||||
if (!no_time_update)
|
||||
inode->i_mtime = inode->i_ctime = current_fs_time(inode->i_sb);
|
||||
inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
/*
|
||||
* We round up to the block size at eof when determining which
|
||||
* extents to clone above, but shouldn't round up the file size.
|
||||
@ -5106,7 +5106,7 @@ static long _btrfs_ioctl_set_received_subvol(struct file *file,
|
||||
struct btrfs_root *root = BTRFS_I(inode)->root;
|
||||
struct btrfs_root_item *root_item = &root->root_item;
|
||||
struct btrfs_trans_handle *trans;
|
||||
struct timespec ct = current_fs_time(inode->i_sb);
|
||||
struct timespec ct = current_time(inode);
|
||||
int ret = 0;
|
||||
int received_uuid_changed;
|
||||
|
||||
|
@ -1474,7 +1474,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
|
||||
parent_root = BTRFS_I(parent_inode)->root;
|
||||
record_root_in_trans(trans, parent_root, 0);
|
||||
|
||||
cur_time = current_fs_time(parent_inode->i_sb);
|
||||
cur_time = current_time(parent_inode);
|
||||
|
||||
/*
|
||||
* insert the directory item
|
||||
@ -1630,7 +1630,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
|
||||
btrfs_i_size_write(parent_inode, parent_inode->i_size +
|
||||
dentry->d_name.len * 2);
|
||||
parent_inode->i_mtime = parent_inode->i_ctime =
|
||||
current_fs_time(parent_inode->i_sb);
|
||||
current_time(parent_inode);
|
||||
ret = btrfs_update_inode_fallback(trans, parent_root, parent_inode);
|
||||
if (ret) {
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
|
@ -252,7 +252,7 @@ int __btrfs_setxattr(struct btrfs_trans_handle *trans,
|
||||
goto out;
|
||||
|
||||
inode_inc_iversion(inode);
|
||||
inode->i_ctime = current_fs_time(inode->i_sb);
|
||||
inode->i_ctime = current_time(inode);
|
||||
set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags);
|
||||
ret = btrfs_update_inode(trans, root, inode);
|
||||
BUG_ON(ret);
|
||||
|
@ -804,8 +804,7 @@ struct dentry *cachefiles_get_directory(struct cachefiles_cache *cache,
|
||||
!d_backing_inode(subdir)->i_op->lookup ||
|
||||
!d_backing_inode(subdir)->i_op->mkdir ||
|
||||
!d_backing_inode(subdir)->i_op->create ||
|
||||
(!d_backing_inode(subdir)->i_op->rename &&
|
||||
!d_backing_inode(subdir)->i_op->rename2) ||
|
||||
!d_backing_inode(subdir)->i_op->rename ||
|
||||
!d_backing_inode(subdir)->i_op->rmdir ||
|
||||
!d_backing_inode(subdir)->i_op->unlink)
|
||||
goto check_error;
|
||||
|
@ -1061,7 +1061,8 @@ static int ceph_unlink(struct inode *dir, struct dentry *dentry)
|
||||
}
|
||||
|
||||
static int ceph_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry)
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags)
|
||||
{
|
||||
struct ceph_fs_client *fsc = ceph_sb_to_client(old_dir->i_sb);
|
||||
struct ceph_mds_client *mdsc = fsc->mdsc;
|
||||
@ -1069,6 +1070,9 @@ static int ceph_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
int op = CEPH_MDS_OP_RENAME;
|
||||
int err;
|
||||
|
||||
if (flags)
|
||||
return -EINVAL;
|
||||
|
||||
if (ceph_snap(old_dir) != ceph_snap(new_dir))
|
||||
return -EXDEV;
|
||||
if (ceph_snap(old_dir) != CEPH_NOSNAP) {
|
||||
|
@ -886,7 +886,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter,
|
||||
int num_pages = 0;
|
||||
int flags;
|
||||
int ret;
|
||||
struct timespec mtime = current_fs_time(inode->i_sb);
|
||||
struct timespec mtime = current_time(inode);
|
||||
size_t count = iov_iter_count(iter);
|
||||
loff_t pos = iocb->ki_pos;
|
||||
bool write = iov_iter_rw(iter) == WRITE;
|
||||
@ -1091,7 +1091,7 @@ ceph_sync_write(struct kiocb *iocb, struct iov_iter *from, loff_t pos,
|
||||
int flags;
|
||||
int check_caps = 0;
|
||||
int ret;
|
||||
struct timespec mtime = current_fs_time(inode->i_sb);
|
||||
struct timespec mtime = current_time(inode);
|
||||
size_t count = iov_iter_count(from);
|
||||
|
||||
if (ceph_snap(file_inode(file)) != CEPH_NOSNAP)
|
||||
|
@ -2067,7 +2067,7 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr)
|
||||
if (dirtied) {
|
||||
inode_dirty_flags = __ceph_mark_dirty_caps(ci, dirtied,
|
||||
&prealloc_cf);
|
||||
inode->i_ctime = current_fs_time(inode->i_sb);
|
||||
inode->i_ctime = current_time(inode);
|
||||
}
|
||||
|
||||
release &= issued;
|
||||
|
@ -1034,7 +1034,7 @@ int __ceph_setxattr(struct inode *inode, const char *name,
|
||||
dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_XATTR_EXCL,
|
||||
&prealloc_cf);
|
||||
ci->i_xattrs.dirty = true;
|
||||
inode->i_ctime = current_fs_time(inode->i_sb);
|
||||
inode->i_ctime = current_time(inode);
|
||||
}
|
||||
|
||||
spin_unlock(&ci->i_ceph_lock);
|
||||
|
@ -896,7 +896,7 @@ const struct inode_operations cifs_dir_inode_ops = {
|
||||
.link = cifs_hardlink,
|
||||
.mkdir = cifs_mkdir,
|
||||
.rmdir = cifs_rmdir,
|
||||
.rename2 = cifs_rename2,
|
||||
.rename = cifs_rename2,
|
||||
.permission = cifs_permission,
|
||||
.setattr = cifs_setattr,
|
||||
.symlink = cifs_symlink,
|
||||
|
@ -1878,7 +1878,7 @@ static int cifs_partialpagewrite(struct page *page, unsigned from, unsigned to)
|
||||
write_data, to - from, &offset);
|
||||
cifsFileInfo_put(open_file);
|
||||
/* Does mm or vfs already set times? */
|
||||
inode->i_atime = inode->i_mtime = current_fs_time(inode->i_sb);
|
||||
inode->i_atime = inode->i_mtime = current_time(inode);
|
||||
if ((bytes_written > 0) && (offset))
|
||||
rc = 0;
|
||||
else if (bytes_written < 0)
|
||||
@ -3565,7 +3565,7 @@ static int cifs_readpage_worker(struct file *file, struct page *page,
|
||||
cifs_dbg(FYI, "Bytes read %d\n", rc);
|
||||
|
||||
file_inode(file)->i_atime =
|
||||
current_fs_time(file_inode(file)->i_sb);
|
||||
current_time(file_inode(file));
|
||||
|
||||
if (PAGE_SIZE > rc)
|
||||
memset(read_data + rc, 0, PAGE_SIZE - rc);
|
||||
|
@ -109,7 +109,7 @@ static inline void coda_dir_update_mtime(struct inode *dir)
|
||||
/* optimistically we can also act as if our nose bleeds. The
|
||||
* granularity of the mtime is coarse anyways so we might actually be
|
||||
* right most of the time. Note: we only do this for directories. */
|
||||
dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC;
|
||||
dir->i_mtime = dir->i_ctime = current_time(dir);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -291,7 +291,8 @@ static int coda_rmdir(struct inode *dir, struct dentry *de)
|
||||
|
||||
/* rename */
|
||||
static int coda_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry)
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags)
|
||||
{
|
||||
const char *old_name = old_dentry->d_name.name;
|
||||
const char *new_name = new_dentry->d_name.name;
|
||||
@ -299,6 +300,9 @@ static int coda_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
int new_length = new_dentry->d_name.len;
|
||||
int error;
|
||||
|
||||
if (flags)
|
||||
return -EINVAL;
|
||||
|
||||
error = venus_rename(old_dir->i_sb, coda_i2f(old_dir),
|
||||
coda_i2f(new_dir), old_length, new_length,
|
||||
(const char *) old_name, (const char *)new_name);
|
||||
|
@ -54,7 +54,7 @@ coda_file_write_iter(struct kiocb *iocb, struct iov_iter *to)
|
||||
ret = vfs_iter_write(cfi->cfi_container, to, &iocb->ki_pos);
|
||||
coda_inode->i_size = file_inode(host_file)->i_size;
|
||||
coda_inode->i_blocks = (coda_inode->i_size + 511) >> 9;
|
||||
coda_inode->i_mtime = coda_inode->i_ctime = CURRENT_TIME_SEC;
|
||||
coda_inode->i_mtime = coda_inode->i_ctime = current_time(coda_inode);
|
||||
inode_unlock(coda_inode);
|
||||
file_end_write(host_file);
|
||||
return ret;
|
||||
|
@ -271,7 +271,7 @@ int coda_setattr(struct dentry *de, struct iattr *iattr)
|
||||
|
||||
memset(&vattr, 0, sizeof(vattr));
|
||||
|
||||
inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_ctime = current_time(inode);
|
||||
coda_iattr_to_vattr(iattr, &vattr);
|
||||
vattr.va_type = C_VNON; /* cannot set type */
|
||||
|
||||
|
@ -76,7 +76,7 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr)
|
||||
sd_iattr->ia_uid = GLOBAL_ROOT_UID;
|
||||
sd_iattr->ia_gid = GLOBAL_ROOT_GID;
|
||||
sd_iattr->ia_atime = sd_iattr->ia_mtime =
|
||||
sd_iattr->ia_ctime = current_fs_time(inode->i_sb);
|
||||
sd_iattr->ia_ctime = current_time(inode);
|
||||
sd->s_iattr = sd_iattr;
|
||||
}
|
||||
/* attributes were changed atleast once in past */
|
||||
@ -113,7 +113,7 @@ static inline void set_default_inode_attr(struct inode * inode, umode_t mode)
|
||||
{
|
||||
inode->i_mode = mode;
|
||||
inode->i_atime = inode->i_mtime =
|
||||
inode->i_ctime = current_fs_time(inode->i_sb);
|
||||
inode->i_ctime = current_time(inode);
|
||||
}
|
||||
|
||||
static inline void set_inode_attr(struct inode * inode, struct iattr * iattr)
|
||||
@ -197,7 +197,7 @@ int configfs_create(struct dentry * dentry, umode_t mode, void (*init)(struct in
|
||||
return -ENOMEM;
|
||||
|
||||
p_inode = d_inode(dentry->d_parent);
|
||||
p_inode->i_mtime = p_inode->i_ctime = current_fs_time(p_inode->i_sb);
|
||||
p_inode->i_mtime = p_inode->i_ctime = current_time(p_inode);
|
||||
configfs_set_inode_lock_class(sd, inode);
|
||||
|
||||
init(inode);
|
||||
|
@ -45,7 +45,7 @@ static struct inode *debugfs_get_inode(struct super_block *sb)
|
||||
if (inode) {
|
||||
inode->i_ino = get_next_ino();
|
||||
inode->i_atime = inode->i_mtime =
|
||||
inode->i_ctime = current_fs_time(sb);
|
||||
inode->i_ctime = current_time(inode);
|
||||
}
|
||||
return inode;
|
||||
}
|
||||
@ -748,7 +748,7 @@ struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
|
||||
old_name = fsnotify_oldname_init(old_dentry->d_name.name);
|
||||
|
||||
error = simple_rename(d_inode(old_dir), old_dentry, d_inode(new_dir),
|
||||
dentry);
|
||||
dentry, 0);
|
||||
if (error) {
|
||||
fsnotify_oldname_free(old_name);
|
||||
goto exit;
|
||||
|
@ -300,7 +300,7 @@ static int mknod_ptmx(struct super_block *sb)
|
||||
}
|
||||
|
||||
inode->i_ino = 2;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
|
||||
|
||||
mode = S_IFCHR|opts->ptmxmode;
|
||||
init_special_inode(inode, mode, MKDEV(TTYAUX_MAJOR, 2));
|
||||
@ -412,7 +412,7 @@ devpts_fill_super(struct super_block *s, void *data, int silent)
|
||||
if (!inode)
|
||||
goto fail;
|
||||
inode->i_ino = 1;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
|
||||
inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR;
|
||||
inode->i_op = &simple_dir_inode_operations;
|
||||
inode->i_fop = &simple_dir_operations;
|
||||
@ -540,7 +540,7 @@ struct dentry *devpts_pty_new(struct pts_fs_info *fsi, int index, void *priv)
|
||||
inode->i_ino = index + 3;
|
||||
inode->i_uid = opts->setuid ? opts->uid : current_fsuid();
|
||||
inode->i_gid = opts->setgid ? opts->gid : current_fsgid();
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
|
||||
init_special_inode(inode, S_IFCHR|opts->mode, MKDEV(UNIX98_PTY_SLAVE_MAJOR, index));
|
||||
|
||||
sprintf(s, "%d", index);
|
||||
|
@ -577,7 +577,8 @@ ecryptfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev
|
||||
|
||||
static int
|
||||
ecryptfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry)
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags)
|
||||
{
|
||||
int rc;
|
||||
struct dentry *lower_old_dentry;
|
||||
@ -587,6 +588,9 @@ ecryptfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct dentry *trap = NULL;
|
||||
struct inode *target_inode;
|
||||
|
||||
if (flags)
|
||||
return -EINVAL;
|
||||
|
||||
lower_old_dentry = ecryptfs_dentry_to_lower(old_dentry);
|
||||
lower_new_dentry = ecryptfs_dentry_to_lower(new_dentry);
|
||||
dget(lower_old_dentry);
|
||||
|
@ -24,7 +24,7 @@ struct inode *efivarfs_get_inode(struct super_block *sb,
|
||||
if (inode) {
|
||||
inode->i_ino = get_next_ino();
|
||||
inode->i_mode = mode;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
inode->i_flags = is_removable ? 0 : S_IMMUTABLE;
|
||||
switch (mode & S_IFMT) {
|
||||
case S_IFREG:
|
||||
|
@ -416,7 +416,7 @@ int exofs_set_link(struct inode *dir, struct exofs_dir_entry *de,
|
||||
if (likely(!err))
|
||||
err = exofs_commit_chunk(page, pos, len);
|
||||
exofs_put_page(page);
|
||||
dir->i_mtime = dir->i_ctime = CURRENT_TIME;
|
||||
dir->i_mtime = dir->i_ctime = current_time(dir);
|
||||
mark_inode_dirty(dir);
|
||||
return err;
|
||||
}
|
||||
@ -503,7 +503,7 @@ int exofs_add_link(struct dentry *dentry, struct inode *inode)
|
||||
de->inode_no = cpu_to_le64(inode->i_ino);
|
||||
exofs_set_de_type(de, inode);
|
||||
err = exofs_commit_chunk(page, pos, rec_len);
|
||||
dir->i_mtime = dir->i_ctime = CURRENT_TIME;
|
||||
dir->i_mtime = dir->i_ctime = current_time(dir);
|
||||
mark_inode_dirty(dir);
|
||||
sbi->s_numfiles++;
|
||||
|
||||
@ -554,7 +554,7 @@ int exofs_delete_entry(struct exofs_dir_entry *dir, struct page *page)
|
||||
dir->inode_no = 0;
|
||||
if (likely(!err))
|
||||
err = exofs_commit_chunk(page, pos, to - from);
|
||||
inode->i_ctime = inode->i_mtime = CURRENT_TIME;
|
||||
inode->i_ctime = inode->i_mtime = current_time(inode);
|
||||
mark_inode_dirty(inode);
|
||||
sbi->s_numfiles--;
|
||||
out:
|
||||
|
@ -1007,7 +1007,7 @@ static int _do_truncate(struct inode *inode, loff_t newsize)
|
||||
struct exofs_sb_info *sbi = inode->i_sb->s_fs_info;
|
||||
int ret;
|
||||
|
||||
inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
|
||||
ret = ore_truncate(&sbi->layout, &oi->oc, (u64)newsize);
|
||||
if (likely(!ret))
|
||||
@ -1313,7 +1313,7 @@ struct inode *exofs_new_inode(struct inode *dir, umode_t mode)
|
||||
inode_init_owner(inode, dir, mode);
|
||||
inode->i_ino = sbi->s_nextid++;
|
||||
inode->i_blkbits = EXOFS_BLKSHIFT;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
|
||||
oi->i_commit_size = inode->i_size = 0;
|
||||
spin_lock(&sbi->s_next_gen_lock);
|
||||
inode->i_generation = sbi->s_next_generation++;
|
||||
|
@ -142,7 +142,7 @@ static int exofs_link(struct dentry *old_dentry, struct inode *dir,
|
||||
{
|
||||
struct inode *inode = d_inode(old_dentry);
|
||||
|
||||
inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_ctime = current_time(inode);
|
||||
inode_inc_link_count(inode);
|
||||
ihold(inode);
|
||||
|
||||
@ -227,7 +227,8 @@ static int exofs_rmdir(struct inode *dir, struct dentry *dentry)
|
||||
}
|
||||
|
||||
static int exofs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry)
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags)
|
||||
{
|
||||
struct inode *old_inode = d_inode(old_dentry);
|
||||
struct inode *new_inode = d_inode(new_dentry);
|
||||
@ -237,6 +238,9 @@ static int exofs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct exofs_dir_entry *old_de;
|
||||
int err = -ENOENT;
|
||||
|
||||
if (flags & ~RENAME_NOREPLACE)
|
||||
return -EINVAL;
|
||||
|
||||
old_de = exofs_find_entry(old_dir, old_dentry, &old_page);
|
||||
if (!old_de)
|
||||
goto out;
|
||||
@ -261,7 +265,7 @@ static int exofs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
if (!new_de)
|
||||
goto out_dir;
|
||||
err = exofs_set_link(new_dir, new_de, new_page, old_inode);
|
||||
new_inode->i_ctime = CURRENT_TIME;
|
||||
new_inode->i_ctime = current_time(new_inode);
|
||||
if (dir_de)
|
||||
drop_nlink(new_inode);
|
||||
inode_dec_link_count(new_inode);
|
||||
@ -275,7 +279,7 @@ static int exofs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
inode_inc_link_count(new_dir);
|
||||
}
|
||||
|
||||
old_inode->i_ctime = CURRENT_TIME;
|
||||
old_inode->i_ctime = current_time(old_inode);
|
||||
|
||||
exofs_delete_entry(old_de, old_page);
|
||||
mark_inode_dirty(old_inode);
|
||||
@ -310,7 +314,7 @@ const struct inode_operations exofs_dir_inode_operations = {
|
||||
.mkdir = exofs_mkdir,
|
||||
.rmdir = exofs_rmdir,
|
||||
.mknod = exofs_mknod,
|
||||
.rename = exofs_rename,
|
||||
.rename = exofs_rename,
|
||||
.setattr = exofs_setattr,
|
||||
};
|
||||
|
||||
|
@ -193,7 +193,7 @@ ext2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
|
||||
error = posix_acl_update_mode(inode, &inode->i_mode, &acl);
|
||||
if (error)
|
||||
return error;
|
||||
inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_ctime = current_time(inode);
|
||||
mark_inode_dirty(inode);
|
||||
}
|
||||
break;
|
||||
|
@ -471,7 +471,7 @@ void ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de,
|
||||
err = ext2_commit_chunk(page, pos, len);
|
||||
ext2_put_page(page);
|
||||
if (update_times)
|
||||
dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC;
|
||||
dir->i_mtime = dir->i_ctime = current_time(dir);
|
||||
EXT2_I(dir)->i_flags &= ~EXT2_BTREE_FL;
|
||||
mark_inode_dirty(dir);
|
||||
}
|
||||
@ -561,7 +561,7 @@ int ext2_add_link (struct dentry *dentry, struct inode *inode)
|
||||
de->inode = cpu_to_le32(inode->i_ino);
|
||||
ext2_set_de_type (de, inode);
|
||||
err = ext2_commit_chunk(page, pos, rec_len);
|
||||
dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC;
|
||||
dir->i_mtime = dir->i_ctime = current_time(dir);
|
||||
EXT2_I(dir)->i_flags &= ~EXT2_BTREE_FL;
|
||||
mark_inode_dirty(dir);
|
||||
/* OFFSET_CACHE */
|
||||
@ -610,7 +610,7 @@ int ext2_delete_entry (struct ext2_dir_entry_2 * dir, struct page * page )
|
||||
pde->rec_len = ext2_rec_len_to_disk(to - from);
|
||||
dir->inode = 0;
|
||||
err = ext2_commit_chunk(page, pos, to - from);
|
||||
inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC;
|
||||
inode->i_ctime = inode->i_mtime = current_time(inode);
|
||||
EXT2_I(inode)->i_flags &= ~EXT2_BTREE_FL;
|
||||
mark_inode_dirty(inode);
|
||||
out:
|
||||
|
@ -556,7 +556,7 @@ struct inode *ext2_new_inode(struct inode *dir, umode_t mode,
|
||||
|
||||
inode->i_ino = ino;
|
||||
inode->i_blocks = 0;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
|
||||
memset(ei->i_data, 0, sizeof(ei->i_data));
|
||||
ei->i_flags =
|
||||
ext2_mask_flags(mode, EXT2_I(dir)->i_flags & EXT2_FL_INHERITED);
|
||||
|
@ -595,7 +595,7 @@ static void ext2_splice_branch(struct inode *inode,
|
||||
if (where->bh)
|
||||
mark_buffer_dirty_inode(where->bh, inode);
|
||||
|
||||
inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_ctime = current_time(inode);
|
||||
mark_inode_dirty(inode);
|
||||
}
|
||||
|
||||
@ -1308,7 +1308,7 @@ static int ext2_setsize(struct inode *inode, loff_t newsize)
|
||||
__ext2_truncate_blocks(inode, newsize);
|
||||
dax_sem_up_write(EXT2_I(inode));
|
||||
|
||||
inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
if (inode_needs_sync(inode)) {
|
||||
sync_mapping_buffers(inode->i_mapping);
|
||||
sync_inode_metadata(inode, 1);
|
||||
|
@ -79,7 +79,7 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||
ei->i_flags = flags;
|
||||
|
||||
ext2_set_inode_flags(inode);
|
||||
inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_ctime = current_time(inode);
|
||||
inode_unlock(inode);
|
||||
|
||||
mark_inode_dirty(inode);
|
||||
@ -103,7 +103,7 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||
}
|
||||
|
||||
inode_lock(inode);
|
||||
inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_ctime = current_time(inode);
|
||||
inode->i_generation = generation;
|
||||
inode_unlock(inode);
|
||||
|
||||
|
@ -221,7 +221,7 @@ static int ext2_link (struct dentry * old_dentry, struct inode * dir,
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_ctime = current_time(inode);
|
||||
inode_inc_link_count(inode);
|
||||
ihold(inode);
|
||||
|
||||
@ -328,7 +328,8 @@ static int ext2_rmdir (struct inode * dir, struct dentry *dentry)
|
||||
}
|
||||
|
||||
static int ext2_rename (struct inode * old_dir, struct dentry * old_dentry,
|
||||
struct inode * new_dir, struct dentry * new_dentry )
|
||||
struct inode * new_dir, struct dentry * new_dentry,
|
||||
unsigned int flags)
|
||||
{
|
||||
struct inode * old_inode = d_inode(old_dentry);
|
||||
struct inode * new_inode = d_inode(new_dentry);
|
||||
@ -338,6 +339,9 @@ static int ext2_rename (struct inode * old_dir, struct dentry * old_dentry,
|
||||
struct ext2_dir_entry_2 * old_de;
|
||||
int err;
|
||||
|
||||
if (flags & ~RENAME_NOREPLACE)
|
||||
return -EINVAL;
|
||||
|
||||
err = dquot_initialize(old_dir);
|
||||
if (err)
|
||||
goto out;
|
||||
@ -372,7 +376,7 @@ static int ext2_rename (struct inode * old_dir, struct dentry * old_dentry,
|
||||
if (!new_de)
|
||||
goto out_dir;
|
||||
ext2_set_link(new_dir, new_de, new_page, old_inode, 1);
|
||||
new_inode->i_ctime = CURRENT_TIME_SEC;
|
||||
new_inode->i_ctime = current_time(new_inode);
|
||||
if (dir_de)
|
||||
drop_nlink(new_inode);
|
||||
inode_dec_link_count(new_inode);
|
||||
@ -388,7 +392,7 @@ static int ext2_rename (struct inode * old_dir, struct dentry * old_dentry,
|
||||
* Like most other Unix systems, set the ctime for inodes on a
|
||||
* rename.
|
||||
*/
|
||||
old_inode->i_ctime = CURRENT_TIME_SEC;
|
||||
old_inode->i_ctime = current_time(old_inode);
|
||||
mark_inode_dirty(old_inode);
|
||||
|
||||
ext2_delete_entry (old_de, old_page);
|
||||
|
@ -1543,7 +1543,7 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type,
|
||||
if (inode->i_size < off+len-towrite)
|
||||
i_size_write(inode, off+len-towrite);
|
||||
inode->i_version++;
|
||||
inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
mark_inode_dirty(inode);
|
||||
return len - towrite;
|
||||
}
|
||||
|
@ -691,7 +691,7 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
|
||||
|
||||
/* Update the inode. */
|
||||
EXT2_I(inode)->i_file_acl = new_bh ? new_bh->b_blocknr : 0;
|
||||
inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_ctime = current_time(inode);
|
||||
if (IS_SYNC(inode)) {
|
||||
error = sync_inode_metadata(inode, 1);
|
||||
/* In case sync failed due to ENOSPC the inode was actually
|
||||
|
@ -3878,7 +3878,7 @@ const struct inode_operations ext4_dir_inode_operations = {
|
||||
.rmdir = ext4_rmdir,
|
||||
.mknod = ext4_mknod,
|
||||
.tmpfile = ext4_tmpfile,
|
||||
.rename2 = ext4_rename2,
|
||||
.rename = ext4_rename2,
|
||||
.setattr = ext4_setattr,
|
||||
.listxattr = ext4_listxattr,
|
||||
.get_acl = ext4_get_acl,
|
||||
|
@ -312,7 +312,7 @@ void f2fs_set_link(struct inode *dir, struct f2fs_dir_entry *de,
|
||||
f2fs_dentry_kunmap(dir, page);
|
||||
set_page_dirty(page);
|
||||
|
||||
dir->i_mtime = dir->i_ctime = CURRENT_TIME;
|
||||
dir->i_mtime = dir->i_ctime = current_time(dir);
|
||||
f2fs_mark_inode_dirty_sync(dir);
|
||||
f2fs_put_page(page, 1);
|
||||
}
|
||||
@ -465,7 +465,7 @@ void update_parent_metadata(struct inode *dir, struct inode *inode,
|
||||
f2fs_i_links_write(dir, true);
|
||||
clear_inode_flag(inode, FI_NEW_INODE);
|
||||
}
|
||||
dir->i_mtime = dir->i_ctime = CURRENT_TIME;
|
||||
dir->i_mtime = dir->i_ctime = current_time(dir);
|
||||
f2fs_mark_inode_dirty_sync(dir);
|
||||
|
||||
if (F2FS_I(dir)->i_current_depth != current_depth)
|
||||
@ -683,7 +683,7 @@ void f2fs_drop_nlink(struct inode *dir, struct inode *inode)
|
||||
|
||||
if (S_ISDIR(inode->i_mode))
|
||||
f2fs_i_links_write(dir, false);
|
||||
inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_ctime = current_time(inode);
|
||||
|
||||
f2fs_i_links_write(inode, false);
|
||||
if (S_ISDIR(inode->i_mode)) {
|
||||
@ -730,7 +730,7 @@ void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page,
|
||||
kunmap(page); /* kunmap - pair of f2fs_find_entry */
|
||||
set_page_dirty(page);
|
||||
|
||||
dir->i_ctime = dir->i_mtime = CURRENT_TIME;
|
||||
dir->i_ctime = dir->i_mtime = current_time(dir);
|
||||
f2fs_mark_inode_dirty_sync(dir);
|
||||
|
||||
if (inode)
|
||||
|
@ -631,7 +631,7 @@ int f2fs_truncate(struct inode *inode)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
f2fs_mark_inode_dirty_sync(inode);
|
||||
return 0;
|
||||
}
|
||||
@ -708,7 +708,7 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1392,7 +1392,7 @@ static long f2fs_fallocate(struct file *file, int mode,
|
||||
}
|
||||
|
||||
if (!ret) {
|
||||
inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
f2fs_mark_inode_dirty_sync(inode);
|
||||
f2fs_update_time(F2FS_I_SB(inode), REQ_TIME);
|
||||
}
|
||||
@ -1484,7 +1484,7 @@ static int f2fs_ioc_setflags(struct file *filp, unsigned long arg)
|
||||
fi->i_flags = flags;
|
||||
inode_unlock(inode);
|
||||
|
||||
inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_ctime = current_time(inode);
|
||||
f2fs_set_inode_flags(inode);
|
||||
out:
|
||||
mnt_drop_write_file(filp);
|
||||
|
@ -572,7 +572,7 @@ void f2fs_delete_inline_entry(struct f2fs_dir_entry *dentry, struct page *page,
|
||||
set_page_dirty(page);
|
||||
f2fs_put_page(page, 1);
|
||||
|
||||
dir->i_ctime = dir->i_mtime = CURRENT_TIME;
|
||||
dir->i_ctime = dir->i_mtime = current_time(dir);
|
||||
f2fs_mark_inode_dirty_sync(dir);
|
||||
|
||||
if (inode)
|
||||
|
@ -46,7 +46,7 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode)
|
||||
|
||||
inode->i_ino = ino;
|
||||
inode->i_blocks = 0;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
|
||||
inode->i_generation = sbi->s_next_generation++;
|
||||
|
||||
err = insert_inode_locked(inode);
|
||||
@ -182,7 +182,7 @@ static int f2fs_link(struct dentry *old_dentry, struct inode *dir,
|
||||
|
||||
f2fs_balance_fs(sbi, true);
|
||||
|
||||
inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_ctime = current_time(inode);
|
||||
ihold(inode);
|
||||
|
||||
set_inode_flag(inode, FI_INC_LINK);
|
||||
@ -723,7 +723,7 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
|
||||
f2fs_set_link(new_dir, new_entry, new_page, old_inode);
|
||||
|
||||
new_inode->i_ctime = CURRENT_TIME;
|
||||
new_inode->i_ctime = current_time(new_inode);
|
||||
down_write(&F2FS_I(new_inode)->i_sem);
|
||||
if (old_dir_entry)
|
||||
f2fs_i_links_write(new_inode, false);
|
||||
@ -777,7 +777,7 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
file_set_enc_name(old_inode);
|
||||
up_write(&F2FS_I(old_inode)->i_sem);
|
||||
|
||||
old_inode->i_ctime = CURRENT_TIME;
|
||||
old_inode->i_ctime = current_time(old_inode);
|
||||
f2fs_mark_inode_dirty_sync(old_inode);
|
||||
|
||||
f2fs_delete_entry(old_entry, old_page, old_dir, NULL);
|
||||
@ -932,7 +932,7 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
file_lost_pino(old_inode);
|
||||
up_write(&F2FS_I(old_inode)->i_sem);
|
||||
|
||||
old_dir->i_ctime = CURRENT_TIME;
|
||||
old_dir->i_ctime = current_time(old_dir);
|
||||
if (old_nlink) {
|
||||
down_write(&F2FS_I(old_dir)->i_sem);
|
||||
f2fs_i_links_write(old_dir, old_nlink > 0);
|
||||
@ -947,7 +947,7 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
file_lost_pino(new_inode);
|
||||
up_write(&F2FS_I(new_inode)->i_sem);
|
||||
|
||||
new_dir->i_ctime = CURRENT_TIME;
|
||||
new_dir->i_ctime = current_time(new_dir);
|
||||
if (new_nlink) {
|
||||
down_write(&F2FS_I(new_dir)->i_sem);
|
||||
f2fs_i_links_write(new_dir, new_nlink > 0);
|
||||
@ -1093,7 +1093,7 @@ const struct inode_operations f2fs_dir_inode_operations = {
|
||||
.mkdir = f2fs_mkdir,
|
||||
.rmdir = f2fs_rmdir,
|
||||
.mknod = f2fs_mknod,
|
||||
.rename2 = f2fs_rename2,
|
||||
.rename = f2fs_rename2,
|
||||
.tmpfile = f2fs_tmpfile,
|
||||
.getattr = f2fs_getattr,
|
||||
.setattr = f2fs_setattr,
|
||||
|
@ -548,7 +548,7 @@ static int __f2fs_setxattr(struct inode *inode, int index,
|
||||
|
||||
if (is_inode_flag_set(inode, FI_ACL_MODE)) {
|
||||
inode->i_mode = F2FS_I(inode)->i_acl_mode;
|
||||
inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_ctime = current_time(inode);
|
||||
clear_inode_flag(inode, FI_ACL_MODE);
|
||||
}
|
||||
if (index == F2FS_XATTR_INDEX_ENCRYPTION &&
|
||||
|
@ -1071,7 +1071,7 @@ int fat_remove_entries(struct inode *dir, struct fat_slot_info *sinfo)
|
||||
}
|
||||
}
|
||||
|
||||
dir->i_mtime = dir->i_atime = CURRENT_TIME_SEC;
|
||||
dir->i_mtime = dir->i_atime = current_time(dir);
|
||||
if (IS_DIRSYNC(dir))
|
||||
(void)fat_sync_inode(dir);
|
||||
else
|
||||
|
@ -63,7 +63,7 @@ static int fat_ioctl_set_attributes(struct file *file, u32 __user *user_attr)
|
||||
|
||||
/* Equivalent to a chmod() */
|
||||
ia.ia_valid = ATTR_MODE | ATTR_CTIME;
|
||||
ia.ia_ctime = current_fs_time(inode->i_sb);
|
||||
ia.ia_ctime = current_time(inode);
|
||||
if (is_dir)
|
||||
ia.ia_mode = fat_make_mode(sbi, attr, S_IRWXUGO);
|
||||
else {
|
||||
@ -194,7 +194,7 @@ static int fat_cont_expand(struct inode *inode, loff_t size)
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC;
|
||||
inode->i_ctime = inode->i_mtime = current_time(inode);
|
||||
mark_inode_dirty(inode);
|
||||
if (IS_SYNC(inode)) {
|
||||
int err2;
|
||||
@ -297,7 +297,7 @@ static int fat_free(struct inode *inode, int skip)
|
||||
MSDOS_I(inode)->i_logstart = 0;
|
||||
}
|
||||
MSDOS_I(inode)->i_attrs |= ATTR_ARCH;
|
||||
inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC;
|
||||
inode->i_ctime = inode->i_mtime = current_time(inode);
|
||||
if (wait) {
|
||||
err = fat_sync_inode(inode);
|
||||
if (err) {
|
||||
|
@ -237,7 +237,7 @@ static int fat_write_end(struct file *file, struct address_space *mapping,
|
||||
if (err < len)
|
||||
fat_write_failed(mapping, pos + len);
|
||||
if (!(err < 0) && !(MSDOS_I(inode)->i_attrs & ATTR_ARCH)) {
|
||||
inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
MSDOS_I(inode)->i_attrs |= ATTR_ARCH;
|
||||
mark_inode_dirty(inode);
|
||||
}
|
||||
|
@ -283,7 +283,7 @@ static int msdos_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||
goto out;
|
||||
}
|
||||
|
||||
ts = CURRENT_TIME_SEC;
|
||||
ts = current_time(dir);
|
||||
err = msdos_add_entry(dir, msdos_name, 0, is_hid, 0, &ts, &sinfo);
|
||||
if (err)
|
||||
goto out;
|
||||
@ -330,7 +330,7 @@ static int msdos_rmdir(struct inode *dir, struct dentry *dentry)
|
||||
drop_nlink(dir);
|
||||
|
||||
clear_nlink(inode);
|
||||
inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_ctime = current_time(inode);
|
||||
fat_detach(inode);
|
||||
out:
|
||||
mutex_unlock(&MSDOS_SB(sb)->s_lock);
|
||||
@ -364,7 +364,7 @@ static int msdos_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
|
||||
goto out;
|
||||
}
|
||||
|
||||
ts = CURRENT_TIME_SEC;
|
||||
ts = current_time(dir);
|
||||
cluster = fat_alloc_new_dir(dir, &ts);
|
||||
if (cluster < 0) {
|
||||
err = cluster;
|
||||
@ -416,7 +416,7 @@ static int msdos_unlink(struct inode *dir, struct dentry *dentry)
|
||||
if (err)
|
||||
goto out;
|
||||
clear_nlink(inode);
|
||||
inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_ctime = current_time(inode);
|
||||
fat_detach(inode);
|
||||
out:
|
||||
mutex_unlock(&MSDOS_SB(sb)->s_lock);
|
||||
@ -481,7 +481,7 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name,
|
||||
mark_inode_dirty(old_inode);
|
||||
|
||||
old_dir->i_version++;
|
||||
old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME_SEC;
|
||||
old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir);
|
||||
if (IS_DIRSYNC(old_dir))
|
||||
(void)fat_sync_inode(old_dir);
|
||||
else
|
||||
@ -490,7 +490,7 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name,
|
||||
}
|
||||
}
|
||||
|
||||
ts = CURRENT_TIME_SEC;
|
||||
ts = current_time(old_inode);
|
||||
if (new_inode) {
|
||||
if (err)
|
||||
goto out;
|
||||
@ -596,12 +596,16 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name,
|
||||
|
||||
/***** Rename, a wrapper for rename_same_dir & rename_diff_dir */
|
||||
static int msdos_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry)
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags)
|
||||
{
|
||||
struct super_block *sb = old_dir->i_sb;
|
||||
unsigned char old_msdos_name[MSDOS_NAME], new_msdos_name[MSDOS_NAME];
|
||||
int err, is_hid;
|
||||
|
||||
if (flags & ~RENAME_NOREPLACE)
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&MSDOS_SB(sb)->s_lock);
|
||||
|
||||
err = msdos_format_name(old_dentry->d_name.name,
|
||||
|
@ -788,7 +788,7 @@ static int vfat_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||
|
||||
mutex_lock(&MSDOS_SB(sb)->s_lock);
|
||||
|
||||
ts = CURRENT_TIME_SEC;
|
||||
ts = current_time(dir);
|
||||
err = vfat_add_entry(dir, &dentry->d_name, 0, 0, &ts, &sinfo);
|
||||
if (err)
|
||||
goto out;
|
||||
@ -832,7 +832,7 @@ static int vfat_rmdir(struct inode *dir, struct dentry *dentry)
|
||||
drop_nlink(dir);
|
||||
|
||||
clear_nlink(inode);
|
||||
inode->i_mtime = inode->i_atime = CURRENT_TIME_SEC;
|
||||
inode->i_mtime = inode->i_atime = current_time(inode);
|
||||
fat_detach(inode);
|
||||
vfat_d_version_set(dentry, dir->i_version);
|
||||
out:
|
||||
@ -858,7 +858,7 @@ static int vfat_unlink(struct inode *dir, struct dentry *dentry)
|
||||
if (err)
|
||||
goto out;
|
||||
clear_nlink(inode);
|
||||
inode->i_mtime = inode->i_atime = CURRENT_TIME_SEC;
|
||||
inode->i_mtime = inode->i_atime = current_time(inode);
|
||||
fat_detach(inode);
|
||||
vfat_d_version_set(dentry, dir->i_version);
|
||||
out:
|
||||
@ -877,7 +877,7 @@ static int vfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
|
||||
|
||||
mutex_lock(&MSDOS_SB(sb)->s_lock);
|
||||
|
||||
ts = CURRENT_TIME_SEC;
|
||||
ts = current_time(dir);
|
||||
cluster = fat_alloc_new_dir(dir, &ts);
|
||||
if (cluster < 0) {
|
||||
err = cluster;
|
||||
@ -914,7 +914,8 @@ static int vfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
|
||||
}
|
||||
|
||||
static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry)
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags)
|
||||
{
|
||||
struct buffer_head *dotdot_bh;
|
||||
struct msdos_dir_entry *dotdot_de;
|
||||
@ -925,6 +926,9 @@ static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
int err, is_dir, update_dotdot, corrupt = 0;
|
||||
struct super_block *sb = old_dir->i_sb;
|
||||
|
||||
if (flags & ~RENAME_NOREPLACE)
|
||||
return -EINVAL;
|
||||
|
||||
old_sinfo.bh = sinfo.bh = dotdot_bh = NULL;
|
||||
old_inode = d_inode(old_dentry);
|
||||
new_inode = d_inode(new_dentry);
|
||||
@ -942,7 +946,7 @@ static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
}
|
||||
}
|
||||
|
||||
ts = CURRENT_TIME_SEC;
|
||||
ts = current_time(old_dir);
|
||||
if (new_inode) {
|
||||
if (is_dir) {
|
||||
err = fat_dir_empty(new_inode);
|
||||
|
@ -220,7 +220,7 @@ static struct dentry *fuse_ctl_add_dentry(struct dentry *parent,
|
||||
inode->i_mode = mode;
|
||||
inode->i_uid = fc->user_id;
|
||||
inode->i_gid = fc->group_id;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
/* setting ->i_op to NULL is not allowed */
|
||||
if (iop)
|
||||
inode->i_op = iop;
|
||||
|
@ -647,7 +647,7 @@ static int fuse_symlink(struct inode *dir, struct dentry *entry,
|
||||
void fuse_update_ctime(struct inode *inode)
|
||||
{
|
||||
if (!IS_NOCMTIME(inode)) {
|
||||
inode->i_ctime = current_fs_time(inode->i_sb);
|
||||
inode->i_ctime = current_time(inode);
|
||||
mark_inode_dirty_sync(inode);
|
||||
}
|
||||
}
|
||||
@ -1793,7 +1793,7 @@ static const struct inode_operations fuse_dir_inode_operations = {
|
||||
.symlink = fuse_symlink,
|
||||
.unlink = fuse_unlink,
|
||||
.rmdir = fuse_rmdir,
|
||||
.rename2 = fuse_rename2,
|
||||
.rename = fuse_rename2,
|
||||
.link = fuse_link,
|
||||
.setattr = fuse_setattr,
|
||||
.create = fuse_create,
|
||||
|
@ -836,7 +836,7 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh,
|
||||
gfs2_quota_change(ip, -(s64)btotal, ip->i_inode.i_uid,
|
||||
ip->i_inode.i_gid);
|
||||
|
||||
ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME;
|
||||
ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode);
|
||||
|
||||
gfs2_dinode_out(ip, dibh->b_data);
|
||||
|
||||
@ -1063,7 +1063,7 @@ static int trunc_start(struct inode *inode, u64 oldsize, u64 newsize)
|
||||
}
|
||||
|
||||
i_size_write(inode, newsize);
|
||||
ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME;
|
||||
ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode);
|
||||
gfs2_dinode_out(ip, dibh->b_data);
|
||||
|
||||
if (journaled)
|
||||
@ -1142,7 +1142,7 @@ static int trunc_end(struct gfs2_inode *ip)
|
||||
gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode));
|
||||
gfs2_ordered_del_inode(ip);
|
||||
}
|
||||
ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME;
|
||||
ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode);
|
||||
ip->i_diskflags &= ~GFS2_DIF_TRUNC_IN_PROG;
|
||||
|
||||
gfs2_trans_add_meta(ip->i_gl, dibh);
|
||||
@ -1252,7 +1252,7 @@ static int do_grow(struct inode *inode, u64 size)
|
||||
goto do_end_trans;
|
||||
|
||||
i_size_write(inode, size);
|
||||
ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME;
|
||||
ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode);
|
||||
gfs2_trans_add_meta(ip->i_gl, dibh);
|
||||
gfs2_dinode_out(ip, dibh->b_data);
|
||||
brelse(dibh);
|
||||
|
@ -135,7 +135,7 @@ static int gfs2_dir_write_stuffed(struct gfs2_inode *ip, const char *buf,
|
||||
memcpy(dibh->b_data + offset + sizeof(struct gfs2_dinode), buf, size);
|
||||
if (ip->i_inode.i_size < offset + size)
|
||||
i_size_write(&ip->i_inode, offset + size);
|
||||
ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME;
|
||||
ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode);
|
||||
gfs2_dinode_out(ip, dibh->b_data);
|
||||
|
||||
brelse(dibh);
|
||||
@ -233,7 +233,7 @@ static int gfs2_dir_write_data(struct gfs2_inode *ip, const char *buf,
|
||||
|
||||
if (ip->i_inode.i_size < offset + copied)
|
||||
i_size_write(&ip->i_inode, offset + copied);
|
||||
ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME;
|
||||
ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode);
|
||||
|
||||
gfs2_trans_add_meta(ip->i_gl, dibh);
|
||||
gfs2_dinode_out(ip, dibh->b_data);
|
||||
@ -872,7 +872,7 @@ static struct gfs2_leaf *new_leaf(struct inode *inode, struct buffer_head **pbh,
|
||||
struct gfs2_leaf *leaf;
|
||||
struct gfs2_dirent *dent;
|
||||
struct qstr name = { .name = "" };
|
||||
struct timespec tv = CURRENT_TIME;
|
||||
struct timespec tv = current_time(inode);
|
||||
|
||||
error = gfs2_alloc_blocks(ip, &bn, &n, 0, NULL);
|
||||
if (error)
|
||||
@ -1816,7 +1816,7 @@ int gfs2_dir_add(struct inode *inode, const struct qstr *name,
|
||||
gfs2_inum_out(nip, dent);
|
||||
dent->de_type = cpu_to_be16(IF2DT(nip->i_inode.i_mode));
|
||||
dent->de_rahead = cpu_to_be16(gfs2_inode_ra_len(nip));
|
||||
tv = CURRENT_TIME;
|
||||
tv = current_time(&ip->i_inode);
|
||||
if (ip->i_diskflags & GFS2_DIF_EXHASH) {
|
||||
leaf = (struct gfs2_leaf *)bh->b_data;
|
||||
be16_add_cpu(&leaf->lf_entries, 1);
|
||||
@ -1878,7 +1878,7 @@ int gfs2_dir_del(struct gfs2_inode *dip, const struct dentry *dentry)
|
||||
const struct qstr *name = &dentry->d_name;
|
||||
struct gfs2_dirent *dent, *prev = NULL;
|
||||
struct buffer_head *bh;
|
||||
struct timespec tv = CURRENT_TIME;
|
||||
struct timespec tv = current_time(&dip->i_inode);
|
||||
|
||||
/* Returns _either_ the entry (if its first in block) or the
|
||||
previous entry otherwise */
|
||||
@ -1960,7 +1960,7 @@ int gfs2_dir_mvino(struct gfs2_inode *dip, const struct qstr *filename,
|
||||
gfs2_trans_add_meta(dip->i_gl, bh);
|
||||
}
|
||||
|
||||
dip->i_inode.i_mtime = dip->i_inode.i_ctime = CURRENT_TIME;
|
||||
dip->i_inode.i_mtime = dip->i_inode.i_ctime = current_time(&dip->i_inode);
|
||||
gfs2_dinode_out(dip, bh->b_data);
|
||||
brelse(bh);
|
||||
return 0;
|
||||
|
@ -656,7 +656,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
|
||||
set_nlink(inode, S_ISDIR(mode) ? 2 : 1);
|
||||
inode->i_rdev = dev;
|
||||
inode->i_size = size;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
gfs2_set_inode_blocks(inode, 1);
|
||||
munge_mode_uid_gid(dip, inode);
|
||||
check_and_update_goal(dip);
|
||||
@ -983,7 +983,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
|
||||
|
||||
gfs2_trans_add_meta(ip->i_gl, dibh);
|
||||
inc_nlink(&ip->i_inode);
|
||||
ip->i_inode.i_ctime = CURRENT_TIME;
|
||||
ip->i_inode.i_ctime = current_time(&ip->i_inode);
|
||||
ihold(inode);
|
||||
d_instantiate(dentry, inode);
|
||||
mark_inode_dirty(inode);
|
||||
@ -1067,7 +1067,7 @@ static int gfs2_unlink_inode(struct gfs2_inode *dip,
|
||||
return error;
|
||||
|
||||
ip->i_entries = 0;
|
||||
inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_ctime = current_time(inode);
|
||||
if (S_ISDIR(inode->i_mode))
|
||||
clear_nlink(inode);
|
||||
else
|
||||
@ -1330,7 +1330,7 @@ static int update_moved_ino(struct gfs2_inode *ip, struct gfs2_inode *ndip,
|
||||
error = gfs2_meta_inode_buffer(ip, &dibh);
|
||||
if (error)
|
||||
return error;
|
||||
ip->i_inode.i_ctime = CURRENT_TIME;
|
||||
ip->i_inode.i_ctime = current_time(&ip->i_inode);
|
||||
gfs2_trans_add_meta(ip->i_gl, dibh);
|
||||
gfs2_dinode_out(ip, dibh->b_data);
|
||||
brelse(dibh);
|
||||
@ -2055,7 +2055,7 @@ const struct inode_operations gfs2_dir_iops = {
|
||||
.mkdir = gfs2_mkdir,
|
||||
.rmdir = gfs2_unlink,
|
||||
.mknod = gfs2_mknod,
|
||||
.rename2 = gfs2_rename2,
|
||||
.rename = gfs2_rename2,
|
||||
.permission = gfs2_permission,
|
||||
.setattr = gfs2_setattr,
|
||||
.getattr = gfs2_getattr,
|
||||
|
@ -854,7 +854,7 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc,
|
||||
size = loc + sizeof(struct gfs2_quota);
|
||||
if (size > inode->i_size)
|
||||
i_size_write(inode, size);
|
||||
inode->i_mtime = inode->i_atime = CURRENT_TIME;
|
||||
inode->i_mtime = inode->i_atime = current_time(inode);
|
||||
mark_inode_dirty(inode);
|
||||
set_bit(QDF_REFRESH, &qd->qd_flags);
|
||||
}
|
||||
|
@ -309,7 +309,7 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh,
|
||||
|
||||
error = gfs2_meta_inode_buffer(ip, &dibh);
|
||||
if (!error) {
|
||||
ip->i_inode.i_ctime = CURRENT_TIME;
|
||||
ip->i_inode.i_ctime = current_time(&ip->i_inode);
|
||||
gfs2_trans_add_meta(ip->i_gl, dibh);
|
||||
gfs2_dinode_out(ip, dibh->b_data);
|
||||
brelse(dibh);
|
||||
@ -775,7 +775,7 @@ static int ea_alloc_skeleton(struct gfs2_inode *ip, struct gfs2_ea_request *er,
|
||||
|
||||
error = gfs2_meta_inode_buffer(ip, &dibh);
|
||||
if (!error) {
|
||||
ip->i_inode.i_ctime = CURRENT_TIME;
|
||||
ip->i_inode.i_ctime = current_time(&ip->i_inode);
|
||||
gfs2_trans_add_meta(ip->i_gl, dibh);
|
||||
gfs2_dinode_out(ip, dibh->b_data);
|
||||
brelse(dibh);
|
||||
@ -910,7 +910,7 @@ static int ea_set_simple_noalloc(struct gfs2_inode *ip, struct buffer_head *bh,
|
||||
error = gfs2_meta_inode_buffer(ip, &dibh);
|
||||
if (error)
|
||||
goto out;
|
||||
ip->i_inode.i_ctime = CURRENT_TIME;
|
||||
ip->i_inode.i_ctime = current_time(&ip->i_inode);
|
||||
gfs2_trans_add_meta(ip->i_gl, dibh);
|
||||
gfs2_dinode_out(ip, dibh->b_data);
|
||||
brelse(dibh);
|
||||
@ -1133,7 +1133,7 @@ static int ea_remove_stuffed(struct gfs2_inode *ip, struct gfs2_ea_location *el)
|
||||
|
||||
error = gfs2_meta_inode_buffer(ip, &dibh);
|
||||
if (!error) {
|
||||
ip->i_inode.i_ctime = CURRENT_TIME;
|
||||
ip->i_inode.i_ctime = current_time(&ip->i_inode);
|
||||
gfs2_trans_add_meta(ip->i_gl, dibh);
|
||||
gfs2_dinode_out(ip, dibh->b_data);
|
||||
brelse(dibh);
|
||||
|
@ -125,7 +125,7 @@ int hfs_cat_create(u32 cnid, struct inode *dir, const struct qstr *str, struct i
|
||||
goto err1;
|
||||
|
||||
dir->i_size++;
|
||||
dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC;
|
||||
dir->i_mtime = dir->i_ctime = current_time(dir);
|
||||
mark_inode_dirty(dir);
|
||||
hfs_find_exit(&fd);
|
||||
return 0;
|
||||
@ -261,7 +261,7 @@ int hfs_cat_delete(u32 cnid, struct inode *dir, const struct qstr *str)
|
||||
}
|
||||
|
||||
dir->i_size--;
|
||||
dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC;
|
||||
dir->i_mtime = dir->i_ctime = current_time(dir);
|
||||
mark_inode_dirty(dir);
|
||||
res = 0;
|
||||
out:
|
||||
@ -321,7 +321,7 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, const struct qstr *src_name,
|
||||
if (err)
|
||||
goto out;
|
||||
dst_dir->i_size++;
|
||||
dst_dir->i_mtime = dst_dir->i_ctime = CURRENT_TIME_SEC;
|
||||
dst_dir->i_mtime = dst_dir->i_ctime = current_time(dst_dir);
|
||||
mark_inode_dirty(dst_dir);
|
||||
|
||||
/* finally remove the old entry */
|
||||
@ -333,7 +333,7 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, const struct qstr *src_name,
|
||||
if (err)
|
||||
goto out;
|
||||
src_dir->i_size--;
|
||||
src_dir->i_mtime = src_dir->i_ctime = CURRENT_TIME_SEC;
|
||||
src_dir->i_mtime = src_dir->i_ctime = current_time(src_dir);
|
||||
mark_inode_dirty(src_dir);
|
||||
|
||||
type = entry.type;
|
||||
|
@ -268,7 +268,7 @@ static int hfs_remove(struct inode *dir, struct dentry *dentry)
|
||||
if (res)
|
||||
return res;
|
||||
clear_nlink(inode);
|
||||
inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_ctime = current_time(inode);
|
||||
hfs_delete_inode(inode);
|
||||
mark_inode_dirty(inode);
|
||||
return 0;
|
||||
@ -286,10 +286,14 @@ static int hfs_remove(struct inode *dir, struct dentry *dentry)
|
||||
* XXX: how do you handle must_be dir?
|
||||
*/
|
||||
static int hfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry)
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags)
|
||||
{
|
||||
int res;
|
||||
|
||||
if (flags & ~RENAME_NOREPLACE)
|
||||
return -EINVAL;
|
||||
|
||||
/* Unlink destination if it already exists */
|
||||
if (d_really_is_positive(new_dentry)) {
|
||||
res = hfs_remove(new_dir, new_dentry);
|
||||
|
@ -194,7 +194,7 @@ struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name, umode_t
|
||||
inode->i_uid = current_fsuid();
|
||||
inode->i_gid = current_fsgid();
|
||||
set_nlink(inode, 1);
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
|
||||
HFS_I(inode)->flags = 0;
|
||||
HFS_I(inode)->rsrc_inode = NULL;
|
||||
HFS_I(inode)->fs_blocks = 0;
|
||||
|
@ -303,7 +303,7 @@ int hfsplus_create_cat(u32 cnid, struct inode *dir,
|
||||
dir->i_size++;
|
||||
if (S_ISDIR(inode->i_mode))
|
||||
hfsplus_subfolders_inc(dir);
|
||||
dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC;
|
||||
dir->i_mtime = dir->i_ctime = current_time(dir);
|
||||
hfsplus_mark_inode_dirty(dir, HFSPLUS_I_CAT_DIRTY);
|
||||
|
||||
hfs_find_exit(&fd);
|
||||
@ -400,7 +400,7 @@ int hfsplus_delete_cat(u32 cnid, struct inode *dir, const struct qstr *str)
|
||||
dir->i_size--;
|
||||
if (type == HFSPLUS_FOLDER)
|
||||
hfsplus_subfolders_dec(dir);
|
||||
dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC;
|
||||
dir->i_mtime = dir->i_ctime = current_time(dir);
|
||||
hfsplus_mark_inode_dirty(dir, HFSPLUS_I_CAT_DIRTY);
|
||||
|
||||
if (type == HFSPLUS_FILE || type == HFSPLUS_FOLDER) {
|
||||
@ -469,7 +469,7 @@ int hfsplus_rename_cat(u32 cnid,
|
||||
dst_dir->i_size++;
|
||||
if (type == HFSPLUS_FOLDER)
|
||||
hfsplus_subfolders_inc(dst_dir);
|
||||
dst_dir->i_mtime = dst_dir->i_ctime = CURRENT_TIME_SEC;
|
||||
dst_dir->i_mtime = dst_dir->i_ctime = current_time(dst_dir);
|
||||
|
||||
/* finally remove the old entry */
|
||||
err = hfsplus_cat_build_key(sb, src_fd.search_key,
|
||||
@ -486,7 +486,7 @@ int hfsplus_rename_cat(u32 cnid,
|
||||
src_dir->i_size--;
|
||||
if (type == HFSPLUS_FOLDER)
|
||||
hfsplus_subfolders_dec(src_dir);
|
||||
src_dir->i_mtime = src_dir->i_ctime = CURRENT_TIME_SEC;
|
||||
src_dir->i_mtime = src_dir->i_ctime = current_time(src_dir);
|
||||
|
||||
/* remove old thread entry */
|
||||
hfsplus_cat_build_key_with_cnid(sb, src_fd.search_key, cnid);
|
||||
|
@ -347,7 +347,7 @@ static int hfsplus_link(struct dentry *src_dentry, struct inode *dst_dir,
|
||||
inc_nlink(inode);
|
||||
hfsplus_instantiate(dst_dentry, inode, cnid);
|
||||
ihold(inode);
|
||||
inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_ctime = current_time(inode);
|
||||
mark_inode_dirty(inode);
|
||||
sbi->file_count++;
|
||||
hfsplus_mark_mdb_dirty(dst_dir->i_sb);
|
||||
@ -406,7 +406,7 @@ static int hfsplus_unlink(struct inode *dir, struct dentry *dentry)
|
||||
hfsplus_delete_inode(inode);
|
||||
} else
|
||||
sbi->file_count--;
|
||||
inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_ctime = current_time(inode);
|
||||
mark_inode_dirty(inode);
|
||||
out:
|
||||
mutex_unlock(&sbi->vh_mutex);
|
||||
@ -427,7 +427,7 @@ static int hfsplus_rmdir(struct inode *dir, struct dentry *dentry)
|
||||
if (res)
|
||||
goto out;
|
||||
clear_nlink(inode);
|
||||
inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_ctime = current_time(inode);
|
||||
hfsplus_delete_inode(inode);
|
||||
mark_inode_dirty(inode);
|
||||
out:
|
||||
@ -530,10 +530,14 @@ static int hfsplus_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
|
||||
}
|
||||
|
||||
static int hfsplus_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry)
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags)
|
||||
{
|
||||
int res;
|
||||
|
||||
if (flags & ~RENAME_NOREPLACE)
|
||||
return -EINVAL;
|
||||
|
||||
/* Unlink destination if it already exists */
|
||||
if (d_really_is_positive(new_dentry)) {
|
||||
if (d_is_dir(new_dentry))
|
||||
|
@ -366,7 +366,7 @@ struct inode *hfsplus_new_inode(struct super_block *sb, umode_t mode)
|
||||
inode->i_uid = current_fsuid();
|
||||
inode->i_gid = current_fsgid();
|
||||
set_nlink(inode, 1);
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
|
||||
|
||||
hip = HFSPLUS_I(inode);
|
||||
INIT_LIST_HEAD(&hip->open_dir_list);
|
||||
|
@ -122,7 +122,7 @@ static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags)
|
||||
else
|
||||
hip->userflags &= ~HFSPLUS_FLG_NODUMP;
|
||||
|
||||
inode->i_ctime = CURRENT_TIME_SEC;
|
||||
inode->i_ctime = current_time(inode);
|
||||
mark_inode_dirty(inode);
|
||||
|
||||
out_unlock_inode:
|
||||
|
@ -885,7 +885,7 @@ static const struct inode_operations hostfs_dir_iops = {
|
||||
.mkdir = hostfs_mkdir,
|
||||
.rmdir = hostfs_rmdir,
|
||||
.mknod = hostfs_mknod,
|
||||
.rename2 = hostfs_rename2,
|
||||
.rename = hostfs_rename2,
|
||||
.permission = hostfs_permission,
|
||||
.setattr = hostfs_setattr,
|
||||
};
|
||||
|
@ -507,7 +507,8 @@ const struct address_space_operations hpfs_symlink_aops = {
|
||||
};
|
||||
|
||||
static int hpfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry)
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags)
|
||||
{
|
||||
const unsigned char *old_name = old_dentry->d_name.name;
|
||||
unsigned old_len = old_dentry->d_name.len;
|
||||
@ -524,6 +525,9 @@ static int hpfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct fnode *fnode;
|
||||
int err;
|
||||
|
||||
if (flags & ~RENAME_NOREPLACE)
|
||||
return -EINVAL;
|
||||
|
||||
if ((err = hpfs_chk_name(new_name, &new_len))) return err;
|
||||
err = 0;
|
||||
hpfs_adjust_length(old_name, &old_len);
|
||||
|
@ -655,7 +655,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset,
|
||||
|
||||
if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + len > inode->i_size)
|
||||
i_size_write(inode, offset + len);
|
||||
inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_ctime = current_time(inode);
|
||||
out:
|
||||
inode_unlock(inode);
|
||||
return error;
|
||||
@ -700,7 +700,7 @@ static struct inode *hugetlbfs_get_root(struct super_block *sb,
|
||||
inode->i_mode = S_IFDIR | config->mode;
|
||||
inode->i_uid = config->uid;
|
||||
inode->i_gid = config->gid;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
info = HUGETLBFS_I(inode);
|
||||
mpol_shared_policy_init(&info->policy, NULL);
|
||||
inode->i_op = &hugetlbfs_dir_inode_operations;
|
||||
@ -739,7 +739,7 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb,
|
||||
lockdep_set_class(&inode->i_mapping->i_mmap_rwsem,
|
||||
&hugetlbfs_i_mmap_rwsem_key);
|
||||
inode->i_mapping->a_ops = &hugetlbfs_aops;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
inode->i_mapping->private_data = resv_map;
|
||||
info = HUGETLBFS_I(inode);
|
||||
/*
|
||||
@ -788,7 +788,7 @@ static int hugetlbfs_mknod(struct inode *dir,
|
||||
|
||||
inode = hugetlbfs_get_inode(dir->i_sb, dir, mode, dev);
|
||||
if (inode) {
|
||||
dir->i_ctime = dir->i_mtime = CURRENT_TIME;
|
||||
dir->i_ctime = dir->i_mtime = current_time(dir);
|
||||
d_instantiate(dentry, inode);
|
||||
dget(dentry); /* Extra count - pin the dentry in core */
|
||||
error = 0;
|
||||
@ -825,7 +825,7 @@ static int hugetlbfs_symlink(struct inode *dir,
|
||||
} else
|
||||
iput(inode);
|
||||
}
|
||||
dir->i_ctime = dir->i_mtime = CURRENT_TIME;
|
||||
dir->i_ctime = dir->i_mtime = current_time(dir);
|
||||
|
||||
return error;
|
||||
}
|
||||
|
29
fs/inode.c
29
fs/inode.c
@ -1686,7 +1686,7 @@ bool __atime_needs_update(const struct path *path, struct inode *inode,
|
||||
if ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))
|
||||
return false;
|
||||
|
||||
now = current_fs_time(inode->i_sb);
|
||||
now = current_time(inode);
|
||||
|
||||
if (!relatime_need_update(path, inode, now, rcu))
|
||||
return false;
|
||||
@ -1720,7 +1720,7 @@ void touch_atime(const struct path *path)
|
||||
* We may also fail on filesystems that have the ability to make parts
|
||||
* of the fs read only, e.g. subvolumes in Btrfs.
|
||||
*/
|
||||
now = current_fs_time(inode->i_sb);
|
||||
now = current_time(inode);
|
||||
update_time(inode, &now, S_ATIME);
|
||||
__mnt_drop_write(mnt);
|
||||
skip_update:
|
||||
@ -1843,7 +1843,7 @@ int file_update_time(struct file *file)
|
||||
if (IS_NOCMTIME(inode))
|
||||
return 0;
|
||||
|
||||
now = current_fs_time(inode->i_sb);
|
||||
now = current_time(inode);
|
||||
if (!timespec_equal(&inode->i_mtime, &now))
|
||||
sync_it = S_MTIME;
|
||||
|
||||
@ -2099,3 +2099,26 @@ void inode_nohighmem(struct inode *inode)
|
||||
mapping_set_gfp_mask(inode->i_mapping, GFP_USER);
|
||||
}
|
||||
EXPORT_SYMBOL(inode_nohighmem);
|
||||
|
||||
/**
|
||||
* current_time - Return FS time
|
||||
* @inode: inode.
|
||||
*
|
||||
* Return the current time truncated to the time granularity supported by
|
||||
* the fs.
|
||||
*
|
||||
* Note that inode and inode->sb cannot be NULL.
|
||||
* Otherwise, the function warns and returns time without truncation.
|
||||
*/
|
||||
struct timespec current_time(struct inode *inode)
|
||||
{
|
||||
struct timespec now = current_kernel_time();
|
||||
|
||||
if (unlikely(!inode->i_sb)) {
|
||||
WARN(1, "current_time() called with uninitialized super_block in the inode");
|
||||
return now;
|
||||
}
|
||||
|
||||
return timespec_trunc(now, inode->i_sb->s_time_gran);
|
||||
}
|
||||
EXPORT_SYMBOL(current_time);
|
||||
|
@ -243,7 +243,7 @@ int jffs2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
|
||||
|
||||
attr.ia_valid = ATTR_MODE | ATTR_CTIME;
|
||||
attr.ia_mode = mode;
|
||||
attr.ia_ctime = CURRENT_TIME_SEC;
|
||||
attr.ia_ctime = current_time(inode);
|
||||
rc = jffs2_do_setattr(inode, &attr);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
@ -35,7 +35,8 @@ static int jffs2_mkdir (struct inode *,struct dentry *,umode_t);
|
||||
static int jffs2_rmdir (struct inode *,struct dentry *);
|
||||
static int jffs2_mknod (struct inode *,struct dentry *,umode_t,dev_t);
|
||||
static int jffs2_rename (struct inode *, struct dentry *,
|
||||
struct inode *, struct dentry *);
|
||||
struct inode *, struct dentry *,
|
||||
unsigned int);
|
||||
|
||||
const struct file_operations jffs2_dir_operations =
|
||||
{
|
||||
@ -756,7 +757,8 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, umode_t mode
|
||||
}
|
||||
|
||||
static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
|
||||
struct inode *new_dir_i, struct dentry *new_dentry)
|
||||
struct inode *new_dir_i, struct dentry *new_dentry,
|
||||
unsigned int flags)
|
||||
{
|
||||
int ret;
|
||||
struct jffs2_sb_info *c = JFFS2_SB_INFO(old_dir_i->i_sb);
|
||||
@ -764,6 +766,9 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
|
||||
uint8_t type;
|
||||
uint32_t now;
|
||||
|
||||
if (flags & ~RENAME_NOREPLACE)
|
||||
return -EINVAL;
|
||||
|
||||
/* The VFS will check for us and prevent trying to rename a
|
||||
* file over a directory and vice versa, but if it's a directory,
|
||||
* the VFS can't check whether the victim is empty. The filesystem
|
||||
|
@ -472,7 +472,7 @@ struct inode *jffs2_new_inode (struct inode *dir_i, umode_t mode, struct jffs2_r
|
||||
inode->i_mode = jemode_to_cpu(ri->mode);
|
||||
i_gid_write(inode, je16_to_cpu(ri->gid));
|
||||
i_uid_write(inode, je16_to_cpu(ri->uid));
|
||||
inode->i_atime = inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC;
|
||||
inode->i_atime = inode->i_ctime = inode->i_mtime = current_time(inode);
|
||||
ri->atime = ri->mtime = ri->ctime = cpu_to_je32(I_SEC(inode->i_mtime));
|
||||
|
||||
inode->i_blocks = 0;
|
||||
|
@ -81,7 +81,7 @@ static int __jfs_set_acl(tid_t tid, struct inode *inode, int type,
|
||||
rc = posix_acl_update_mode(inode, &inode->i_mode, &acl);
|
||||
if (rc)
|
||||
return rc;
|
||||
inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_ctime = current_time(inode);
|
||||
mark_inode_dirty(inode);
|
||||
}
|
||||
break;
|
||||
|
@ -403,7 +403,7 @@ void jfs_truncate_nolock(struct inode *ip, loff_t length)
|
||||
break;
|
||||
}
|
||||
|
||||
ip->i_mtime = ip->i_ctime = CURRENT_TIME;
|
||||
ip->i_mtime = ip->i_ctime = current_time(ip);
|
||||
mark_inode_dirty(ip);
|
||||
|
||||
txCommit(tid, 1, &ip, 0);
|
||||
|
@ -131,7 +131,7 @@ struct inode *ialloc(struct inode *parent, umode_t mode)
|
||||
jfs_inode->mode2 |= inode->i_mode;
|
||||
|
||||
inode->i_blocks = 0;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
|
||||
jfs_inode->otime = inode->i_ctime.tv_sec;
|
||||
inode->i_generation = JFS_SBI(sb)->gengen++;
|
||||
|
||||
|
@ -162,7 +162,7 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, umode_t mode,
|
||||
|
||||
mark_inode_dirty(ip);
|
||||
|
||||
dip->i_ctime = dip->i_mtime = CURRENT_TIME;
|
||||
dip->i_ctime = dip->i_mtime = current_time(dip);
|
||||
|
||||
mark_inode_dirty(dip);
|
||||
|
||||
@ -298,7 +298,7 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, umode_t mode)
|
||||
|
||||
/* update parent directory inode */
|
||||
inc_nlink(dip); /* for '..' from child directory */
|
||||
dip->i_ctime = dip->i_mtime = CURRENT_TIME;
|
||||
dip->i_ctime = dip->i_mtime = current_time(dip);
|
||||
mark_inode_dirty(dip);
|
||||
|
||||
rc = txCommit(tid, 2, &iplist[0], 0);
|
||||
@ -406,7 +406,7 @@ static int jfs_rmdir(struct inode *dip, struct dentry *dentry)
|
||||
/* update parent directory's link count corresponding
|
||||
* to ".." entry of the target directory deleted
|
||||
*/
|
||||
dip->i_ctime = dip->i_mtime = CURRENT_TIME;
|
||||
dip->i_ctime = dip->i_mtime = current_time(dip);
|
||||
inode_dec_link_count(dip);
|
||||
|
||||
/*
|
||||
@ -528,7 +528,7 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry)
|
||||
|
||||
ASSERT(ip->i_nlink);
|
||||
|
||||
ip->i_ctime = dip->i_ctime = dip->i_mtime = CURRENT_TIME;
|
||||
ip->i_ctime = dip->i_ctime = dip->i_mtime = current_time(ip);
|
||||
mark_inode_dirty(dip);
|
||||
|
||||
/* update target's inode */
|
||||
@ -838,8 +838,8 @@ static int jfs_link(struct dentry *old_dentry,
|
||||
|
||||
/* update object inode */
|
||||
inc_nlink(ip); /* for new link */
|
||||
ip->i_ctime = CURRENT_TIME;
|
||||
dir->i_ctime = dir->i_mtime = CURRENT_TIME;
|
||||
ip->i_ctime = current_time(ip);
|
||||
dir->i_ctime = dir->i_mtime = current_time(dir);
|
||||
mark_inode_dirty(dir);
|
||||
ihold(ip);
|
||||
|
||||
@ -1039,7 +1039,7 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
|
||||
|
||||
mark_inode_dirty(ip);
|
||||
|
||||
dip->i_ctime = dip->i_mtime = CURRENT_TIME;
|
||||
dip->i_ctime = dip->i_mtime = current_time(dip);
|
||||
mark_inode_dirty(dip);
|
||||
/*
|
||||
* commit update of parent directory and link object
|
||||
@ -1078,7 +1078,8 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
|
||||
* FUNCTION: rename a file or directory
|
||||
*/
|
||||
static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry)
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags)
|
||||
{
|
||||
struct btstack btstack;
|
||||
ino_t ino;
|
||||
@ -1097,6 +1098,8 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
s64 new_size = 0;
|
||||
int commit_flag;
|
||||
|
||||
if (flags & ~RENAME_NOREPLACE)
|
||||
return -EINVAL;
|
||||
|
||||
jfs_info("jfs_rename: %pd %pd", old_dentry, new_dentry);
|
||||
|
||||
@ -1215,7 +1218,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
tblk->xflag |= COMMIT_DELETE;
|
||||
tblk->u.ip = new_ip;
|
||||
} else {
|
||||
new_ip->i_ctime = CURRENT_TIME;
|
||||
new_ip->i_ctime = current_time(new_ip);
|
||||
mark_inode_dirty(new_ip);
|
||||
}
|
||||
} else {
|
||||
@ -1278,10 +1281,10 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
/*
|
||||
* Update ctime on changed/moved inodes & mark dirty
|
||||
*/
|
||||
old_ip->i_ctime = CURRENT_TIME;
|
||||
old_ip->i_ctime = current_time(old_ip);
|
||||
mark_inode_dirty(old_ip);
|
||||
|
||||
new_dir->i_ctime = new_dir->i_mtime = current_fs_time(new_dir->i_sb);
|
||||
new_dir->i_ctime = new_dir->i_mtime = current_time(new_dir);
|
||||
mark_inode_dirty(new_dir);
|
||||
|
||||
/* Build list of inodes modified by this transaction */
|
||||
@ -1293,7 +1296,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
|
||||
if (old_dir != new_dir) {
|
||||
iplist[ipcount++] = new_dir;
|
||||
old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
|
||||
old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir);
|
||||
mark_inode_dirty(old_dir);
|
||||
}
|
||||
|
||||
@ -1426,7 +1429,7 @@ static int jfs_mknod(struct inode *dir, struct dentry *dentry,
|
||||
|
||||
mark_inode_dirty(ip);
|
||||
|
||||
dir->i_ctime = dir->i_mtime = CURRENT_TIME;
|
||||
dir->i_ctime = dir->i_mtime = current_time(dir);
|
||||
|
||||
mark_inode_dirty(dir);
|
||||
|
||||
|
@ -830,7 +830,7 @@ static ssize_t jfs_quota_write(struct super_block *sb, int type,
|
||||
if (inode->i_size < off+len-towrite)
|
||||
i_size_write(inode, off+len-towrite);
|
||||
inode->i_version++;
|
||||
inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
mark_inode_dirty(inode);
|
||||
inode_unlock(inode);
|
||||
return len - towrite;
|
||||
|
@ -658,7 +658,7 @@ static int ea_put(tid_t tid, struct inode *inode, struct ea_buffer *ea_buf,
|
||||
if (old_blocks)
|
||||
dquot_free_block(inode, old_blocks);
|
||||
|
||||
inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_ctime = current_time(inode);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1096,13 +1096,17 @@ static int kernfs_iop_rmdir(struct inode *dir, struct dentry *dentry)
|
||||
}
|
||||
|
||||
static int kernfs_iop_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
struct inode *new_dir, struct dentry *new_dentry)
|
||||
struct inode *new_dir, struct dentry *new_dentry,
|
||||
unsigned int flags)
|
||||
{
|
||||
struct kernfs_node *kn = old_dentry->d_fsdata;
|
||||
struct kernfs_node *new_parent = new_dir->i_private;
|
||||
struct kernfs_syscall_ops *scops = kernfs_root(kn)->syscall_ops;
|
||||
int ret;
|
||||
|
||||
if (flags)
|
||||
return -EINVAL;
|
||||
|
||||
if (!scops || !scops->rename)
|
||||
return -EPERM;
|
||||
|
||||
|
@ -168,7 +168,7 @@ static inline void set_default_inode_attr(struct inode *inode, umode_t mode)
|
||||
{
|
||||
inode->i_mode = mode;
|
||||
inode->i_atime = inode->i_mtime =
|
||||
inode->i_ctime = current_fs_time(inode->i_sb);
|
||||
inode->i_ctime = current_time(inode);
|
||||
}
|
||||
|
||||
static inline void set_inode_attr(struct inode *inode, struct iattr *iattr)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user