* [PATCH 28/79] ext2: switch to new ctime accessors
[not found] ` <20230621144735.55953-1-jlayton@kernel.org>
@ 2023-06-21 14:45 ` Jeff Layton
2023-06-21 14:45 ` [PATCH 29/79] ext4: " Jeff Layton
1 sibling, 0 replies; 7+ messages in thread
From: Jeff Layton @ 2023-06-21 14:45 UTC (permalink / raw)
To: Christian Brauner, Jan Kara; +Cc: Al Viro, Jan Kara, linux-ext4, linux-kernel
In later patches, we're going to change how the ctime.tv_nsec field is
utilized. Switch to using accessor functions instead of raw accesses of
inode->i_ctime.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
fs/ext2/acl.c | 2 +-
fs/ext2/dir.c | 6 +++---
fs/ext2/ialloc.c | 2 +-
fs/ext2/inode.c | 11 ++++++-----
fs/ext2/ioctl.c | 4 ++--
fs/ext2/namei.c | 8 ++++----
fs/ext2/super.c | 2 +-
fs/ext2/xattr.c | 2 +-
8 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c
index 82b17d7fc93f..8f0fc476c423 100644
--- a/fs/ext2/acl.c
+++ b/fs/ext2/acl.c
@@ -237,7 +237,7 @@ ext2_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
error = __ext2_set_acl(inode, acl, type);
if (!error && update_mode) {
inode->i_mode = mode;
- inode->i_ctime = current_time(inode);
+ inode_ctime_set_current(inode);
mark_inode_dirty(inode);
}
return error;
diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c
index 42db804794bd..b449599cbf6a 100644
--- a/fs/ext2/dir.c
+++ b/fs/ext2/dir.c
@@ -468,7 +468,7 @@ int ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de,
ext2_set_de_type(de, inode);
ext2_commit_chunk(page, pos, len);
if (update_times)
- dir->i_mtime = dir->i_ctime = current_time(dir);
+ dir->i_mtime = inode_ctime_set_current(dir);
EXT2_I(dir)->i_flags &= ~EXT2_BTREE_FL;
mark_inode_dirty(dir);
return ext2_handle_dirsync(dir);
@@ -555,7 +555,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);
ext2_commit_chunk(page, pos, rec_len);
- dir->i_mtime = dir->i_ctime = current_time(dir);
+ dir->i_mtime = inode_ctime_set_current(dir);
EXT2_I(dir)->i_flags &= ~EXT2_BTREE_FL;
mark_inode_dirty(dir);
err = ext2_handle_dirsync(dir);
@@ -606,7 +606,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;
ext2_commit_chunk(page, pos, to - from);
- inode->i_ctime = inode->i_mtime = current_time(inode);
+ inode->i_mtime = inode_ctime_set_current(inode);
EXT2_I(inode)->i_flags &= ~EXT2_BTREE_FL;
mark_inode_dirty(inode);
return ext2_handle_dirsync(inode);
diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c
index a4e1d7a9c544..3a5bd92ba907 100644
--- a/fs/ext2/ialloc.c
+++ b/fs/ext2/ialloc.c
@@ -549,7 +549,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(inode);
+ inode->i_mtime = inode->i_atime = inode_ctime_set_current(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);
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index 75983215c7a1..318b0b5e8d60 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -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(inode);
+ inode_ctime_set_current(inode);
mark_inode_dirty(inode);
}
@@ -1287,7 +1287,7 @@ static int ext2_setsize(struct inode *inode, loff_t newsize)
__ext2_truncate_blocks(inode, newsize);
filemap_invalidate_unlock(inode->i_mapping);
- inode->i_mtime = inode->i_ctime = current_time(inode);
+ inode->i_mtime = inode_ctime_set_current(inode);
if (inode_needs_sync(inode)) {
sync_mapping_buffers(inode->i_mapping);
sync_inode_metadata(inode, 1);
@@ -1409,9 +1409,10 @@ struct inode *ext2_iget (struct super_block *sb, unsigned long ino)
set_nlink(inode, le16_to_cpu(raw_inode->i_links_count));
inode->i_size = le32_to_cpu(raw_inode->i_size);
inode->i_atime.tv_sec = (signed)le32_to_cpu(raw_inode->i_atime);
- inode->i_ctime.tv_sec = (signed)le32_to_cpu(raw_inode->i_ctime);
+ inode_ctime_set_sec(inode, (signed)le32_to_cpu(raw_inode->i_ctime));
inode->i_mtime.tv_sec = (signed)le32_to_cpu(raw_inode->i_mtime);
- inode->i_atime.tv_nsec = inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = 0;
+ inode->i_atime.tv_nsec = inode->i_mtime.tv_nsec = inode_ctime_set_nsec(inode,
+ 0);
ei->i_dtime = le32_to_cpu(raw_inode->i_dtime);
/* We now have enough fields to check if the inode was active or not.
* This is needed because nfsd might try to access dead inodes
@@ -1541,7 +1542,7 @@ static int __ext2_write_inode(struct inode *inode, int do_sync)
raw_inode->i_links_count = cpu_to_le16(inode->i_nlink);
raw_inode->i_size = cpu_to_le32(inode->i_size);
raw_inode->i_atime = cpu_to_le32(inode->i_atime.tv_sec);
- raw_inode->i_ctime = cpu_to_le32(inode->i_ctime.tv_sec);
+ raw_inode->i_ctime = cpu_to_le32(inode_ctime_peek(inode).tv_sec);
raw_inode->i_mtime = cpu_to_le32(inode->i_mtime.tv_sec);
raw_inode->i_blocks = cpu_to_le32(inode->i_blocks);
diff --git a/fs/ext2/ioctl.c b/fs/ext2/ioctl.c
index cc87d413eb43..7e1db518d104 100644
--- a/fs/ext2/ioctl.c
+++ b/fs/ext2/ioctl.c
@@ -44,7 +44,7 @@ int ext2_fileattr_set(struct mnt_idmap *idmap,
(fa->flags & EXT2_FL_USER_MODIFIABLE);
ext2_set_inode_flags(inode);
- inode->i_ctime = current_time(inode);
+ inode_ctime_set_current(inode);
mark_inode_dirty(inode);
return 0;
@@ -77,7 +77,7 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
}
inode_lock(inode);
- inode->i_ctime = current_time(inode);
+ inode_ctime_set_current(inode);
inode->i_generation = generation;
inode_unlock(inode);
diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c
index 937dd8f60f96..2559974afbff 100644
--- a/fs/ext2/namei.c
+++ b/fs/ext2/namei.c
@@ -211,7 +211,7 @@ static int ext2_link (struct dentry * old_dentry, struct inode * dir,
if (err)
return err;
- inode->i_ctime = current_time(inode);
+ inode_ctime_set_current(inode);
inode_inc_link_count(inode);
ihold(inode);
@@ -291,7 +291,7 @@ static int ext2_unlink(struct inode *dir, struct dentry *dentry)
if (err)
goto out;
- inode->i_ctime = dir->i_ctime;
+ inode_ctime_set(inode, inode_ctime_peek(dir));
inode_dec_link_count(inode);
err = 0;
out:
@@ -367,7 +367,7 @@ static int ext2_rename (struct mnt_idmap * idmap,
ext2_put_page(new_page, new_de);
if (err)
goto out_dir;
- new_inode->i_ctime = current_time(new_inode);
+ inode_ctime_set_current(new_inode);
if (dir_de)
drop_nlink(new_inode);
inode_dec_link_count(new_inode);
@@ -383,7 +383,7 @@ static int ext2_rename (struct mnt_idmap * idmap,
* Like most other Unix systems, set the ctime for inodes on a
* rename.
*/
- old_inode->i_ctime = current_time(old_inode);
+ inode_ctime_set_current(old_inode);
mark_inode_dirty(old_inode);
err = ext2_delete_entry(old_de, old_page);
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index f342f347a695..dfb0b95cf4cb 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -1587,7 +1587,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_inc_iversion(inode);
- inode->i_mtime = inode->i_ctime = current_time(inode);
+ inode->i_mtime = inode_ctime_set_current(inode);
mark_inode_dirty(inode);
return len - towrite;
}
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
index 8906ba479aaf..b05645ba7b1d 100644
--- a/fs/ext2/xattr.c
+++ b/fs/ext2/xattr.c
@@ -773,7 +773,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(inode);
+ inode_ctime_set_current(inode);
if (IS_SYNC(inode)) {
error = sync_inode_metadata(inode, 1);
/* In case sync failed due to ENOSPC the inode was actually
--
2.41.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 29/79] ext4: switch to new ctime accessors
[not found] ` <20230621144735.55953-1-jlayton@kernel.org>
2023-06-21 14:45 ` [PATCH 28/79] ext2: switch to new ctime accessors Jeff Layton
@ 2023-06-21 14:45 ` Jeff Layton
1 sibling, 0 replies; 7+ messages in thread
From: Jeff Layton @ 2023-06-21 14:45 UTC (permalink / raw)
To: Christian Brauner, Theodore Ts'o, Andreas Dilger
Cc: Al Viro, Jan Kara, linux-ext4, linux-kernel
In later patches, we're going to change how the ctime.tv_nsec field is
utilized. Switch to using accessor functions instead of raw accesses of
inode->i_ctime.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
fs/ext4/acl.c | 2 +-
fs/ext4/ext4.h | 20 ++++++++++++++++++++
fs/ext4/extents.c | 12 ++++++------
fs/ext4/ialloc.c | 2 +-
fs/ext4/inline.c | 4 ++--
fs/ext4/inode.c | 16 +++++++---------
fs/ext4/ioctl.c | 9 +++++----
fs/ext4/namei.c | 26 ++++++++++++--------------
fs/ext4/super.c | 2 +-
fs/ext4/xattr.c | 6 +++---
10 files changed, 58 insertions(+), 41 deletions(-)
diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c
index 27fcbddfb148..4db1a1d5e552 100644
--- a/fs/ext4/acl.c
+++ b/fs/ext4/acl.c
@@ -259,7 +259,7 @@ ext4_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
error = __ext4_set_acl(handle, inode, type, acl, 0 /* xattr_flags */);
if (!error && update_mode) {
inode->i_mode = mode;
- inode->i_ctime = current_time(inode);
+ inode_ctime_set_current(inode);
error = ext4_mark_inode_dirty(handle, inode);
}
out_stop:
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 0a2d55faa095..4262d31f74d8 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -3823,6 +3823,26 @@ static inline int ext4_buffer_uptodate(struct buffer_head *bh)
return buffer_uptodate(bh);
}
+static inline void ext4_inode_set_ctime(struct inode *inode, struct ext4_inode *raw_inode)
+{
+ struct timespec64 ctime = inode_ctime_peek(inode);
+
+ if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), i_ctime_extra)) {
+ raw_inode->i_ctime = cpu_to_le32(ctime.tv_sec);
+ raw_inode->i_ctime_extra = ext4_encode_extra_time(&ctime);
+ } else {
+ raw_inode->i_ctime = cpu_to_le32(clamp_t(int32_t, ctime.tv_sec, S32_MIN, S32_MAX));
+ }
+}
+
+static inline void ext4_inode_get_ctime(struct inode *inode, const struct ext4_inode *raw_inode)
+{
+ struct timespec64 ctime = { .tv_sec = (signed)le32_to_cpu(raw_inode->i_ctime) };
+
+ if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), i_ctime_extra))
+ ext4_decode_extra_time(&ctime, raw_inode->i_ctime_extra);
+ inode_ctime_set(inode, ctime);
+}
#endif /* __KERNEL__ */
#define EFSBADCRC EBADMSG /* Bad CRC detected */
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index e4115d338f10..213178a31111 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4476,12 +4476,12 @@ static int ext4_alloc_file_blocks(struct file *file, ext4_lblk_t offset,
map.m_lblk += ret;
map.m_len = len = len - ret;
epos = (loff_t)map.m_lblk << inode->i_blkbits;
- inode->i_ctime = current_time(inode);
+ inode_ctime_set_current(inode);
if (new_size) {
if (epos > new_size)
epos = new_size;
if (ext4_update_inode_size(inode, epos) & 0x1)
- inode->i_mtime = inode->i_ctime;
+ inode->i_mtime = inode_ctime_peek(inode);
}
ret2 = ext4_mark_inode_dirty(handle, inode);
ext4_update_inode_fsync_trans(handle, inode, 1);
@@ -4617,7 +4617,7 @@ static long ext4_zero_range(struct file *file, loff_t offset,
/* Now release the pages and zero block aligned part of pages */
truncate_pagecache_range(inode, start, end - 1);
- inode->i_mtime = inode->i_ctime = current_time(inode);
+ inode->i_mtime = inode_ctime_set_current(inode);
ret = ext4_alloc_file_blocks(file, lblk, max_blocks, new_size,
flags);
@@ -4642,7 +4642,7 @@ static long ext4_zero_range(struct file *file, loff_t offset,
goto out_mutex;
}
- inode->i_mtime = inode->i_ctime = current_time(inode);
+ inode->i_mtime = inode_ctime_set_current(inode);
if (new_size)
ext4_update_inode_size(inode, new_size);
ret = ext4_mark_inode_dirty(handle, inode);
@@ -5378,7 +5378,7 @@ static int ext4_collapse_range(struct file *file, loff_t offset, loff_t len)
up_write(&EXT4_I(inode)->i_data_sem);
if (IS_SYNC(inode))
ext4_handle_sync(handle);
- inode->i_mtime = inode->i_ctime = current_time(inode);
+ inode->i_mtime = inode_ctime_set_current(inode);
ret = ext4_mark_inode_dirty(handle, inode);
ext4_update_inode_fsync_trans(handle, inode, 1);
@@ -5488,7 +5488,7 @@ static int ext4_insert_range(struct file *file, loff_t offset, loff_t len)
/* Expand file to avoid data loss if there is error while shifting */
inode->i_size += len;
EXT4_I(inode)->i_disksize += len;
- inode->i_mtime = inode->i_ctime = current_time(inode);
+ inode->i_mtime = inode_ctime_set_current(inode);
ret = ext4_mark_inode_dirty(handle, inode);
if (ret)
goto out_stop;
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 754f961cd9fd..03fcfcaf8dd6 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -1250,7 +1250,7 @@ struct inode *__ext4_new_inode(struct mnt_idmap *idmap,
inode->i_ino = ino + group * EXT4_INODES_PER_GROUP(sb);
/* This is the optimal IO size (for stat), not the fs block size */
inode->i_blocks = 0;
- inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
+ inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode);
ei->i_crtime = inode->i_mtime;
memset(ei->i_data, 0, sizeof(ei->i_data));
diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
index a4b7e4bc32d4..678dc459d7f7 100644
--- a/fs/ext4/inline.c
+++ b/fs/ext4/inline.c
@@ -1037,7 +1037,7 @@ static int ext4_add_dirent_to_inline(handle_t *handle,
* happen is that the times are slightly out of date
* and/or different from the directory change time.
*/
- dir->i_mtime = dir->i_ctime = current_time(dir);
+ dir->i_mtime = inode_ctime_set_current(dir);
ext4_update_dx_flag(dir);
inode_inc_iversion(dir);
return 1;
@@ -1991,7 +1991,7 @@ int ext4_inline_data_truncate(struct inode *inode, int *has_inline)
ext4_orphan_del(handle, inode);
if (err == 0) {
- inode->i_mtime = inode->i_ctime = current_time(inode);
+ inode->i_mtime = inode_ctime_set_current(inode);
err = ext4_mark_inode_dirty(handle, inode);
if (IS_SYNC(inode))
ext4_handle_sync(handle);
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 43775a6ca505..ee9586e71246 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3986,7 +3986,7 @@ int ext4_punch_hole(struct file *file, loff_t offset, loff_t length)
if (IS_SYNC(inode))
ext4_handle_sync(handle);
- inode->i_mtime = inode->i_ctime = current_time(inode);
+ inode->i_mtime = inode_ctime_set_current(inode);
ret2 = ext4_mark_inode_dirty(handle, inode);
if (unlikely(ret2))
ret = ret2;
@@ -4146,7 +4146,7 @@ int ext4_truncate(struct inode *inode)
if (inode->i_nlink)
ext4_orphan_del(handle, inode);
- inode->i_mtime = inode->i_ctime = current_time(inode);
+ inode->i_mtime = inode_ctime_set_current(inode);
err2 = ext4_mark_inode_dirty(handle, inode);
if (unlikely(err2 && !err))
err = err2;
@@ -4249,7 +4249,7 @@ static int ext4_fill_raw_inode(struct inode *inode, struct ext4_inode *raw_inode
}
raw_inode->i_links_count = cpu_to_le16(inode->i_nlink);
- EXT4_INODE_SET_XTIME(i_ctime, inode, raw_inode);
+ ext4_inode_set_ctime(inode, raw_inode);
EXT4_INODE_SET_XTIME(i_mtime, inode, raw_inode);
EXT4_INODE_SET_XTIME(i_atime, inode, raw_inode);
EXT4_EINODE_SET_XTIME(i_crtime, ei, raw_inode);
@@ -4858,7 +4858,7 @@ struct inode *__ext4_iget(struct super_block *sb, unsigned long ino,
}
}
- EXT4_INODE_GET_XTIME(i_ctime, inode, raw_inode);
+ ext4_inode_get_ctime(inode, raw_inode);
EXT4_INODE_GET_XTIME(i_mtime, inode, raw_inode);
EXT4_INODE_GET_XTIME(i_atime, inode, raw_inode);
EXT4_EINODE_GET_XTIME(i_crtime, ei, raw_inode);
@@ -4981,7 +4981,7 @@ static void __ext4_update_other_inode_time(struct super_block *sb,
spin_unlock(&inode->i_lock);
spin_lock(&ei->i_raw_lock);
- EXT4_INODE_SET_XTIME(i_ctime, inode, raw_inode);
+ ext4_inode_set_ctime(inode, raw_inode);
EXT4_INODE_SET_XTIME(i_mtime, inode, raw_inode);
EXT4_INODE_SET_XTIME(i_atime, inode, raw_inode);
ext4_inode_csum_set(inode, raw_inode, ei);
@@ -5376,10 +5376,8 @@ int ext4_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
* Update c/mtime on truncate up, ext4_truncate() will
* update c/mtime in shrink case below
*/
- if (!shrink) {
- inode->i_mtime = current_time(inode);
- inode->i_ctime = inode->i_mtime;
- }
+ if (!shrink)
+ inode->i_mtime = inode_ctime_set_current(inode);
if (shrink)
ext4_fc_track_range(handle, inode,
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 961284cc9b65..c212371cf003 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -449,7 +449,8 @@ static long swap_inode_boot_loader(struct super_block *sb,
diff = size - size_bl;
swap_inode_data(inode, inode_bl);
- inode->i_ctime = inode_bl->i_ctime = current_time(inode);
+ inode_ctime_set_current(inode);
+ inode_ctime_set_current(inode_bl);
inode_inc_iversion(inode);
inode->i_generation = get_random_u32();
@@ -663,7 +664,7 @@ static int ext4_ioctl_setflags(struct inode *inode,
ext4_set_inode_flags(inode, false);
- inode->i_ctime = current_time(inode);
+ inode_ctime_set_current(inode);
inode_inc_iversion(inode);
err = ext4_mark_iloc_dirty(handle, inode, &iloc);
@@ -774,7 +775,7 @@ static int ext4_ioctl_setproject(struct inode *inode, __u32 projid)
}
EXT4_I(inode)->i_projid = kprojid;
- inode->i_ctime = current_time(inode);
+ inode_ctime_set_current(inode);
inode_inc_iversion(inode);
out_dirty:
rc = ext4_mark_iloc_dirty(handle, inode, &iloc);
@@ -1263,7 +1264,7 @@ static long __ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
}
err = ext4_reserve_inode_write(handle, inode, &iloc);
if (err == 0) {
- inode->i_ctime = current_time(inode);
+ inode_ctime_set_current(inode);
inode_inc_iversion(inode);
inode->i_generation = generation;
err = ext4_mark_iloc_dirty(handle, inode, &iloc);
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 0caf6c730ce3..63392b06fa5f 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2203,7 +2203,7 @@ static int add_dirent_to_buf(handle_t *handle, struct ext4_filename *fname,
* happen is that the times are slightly out of date
* and/or different from the directory change time.
*/
- dir->i_mtime = dir->i_ctime = current_time(dir);
+ dir->i_mtime = inode_ctime_set_current(dir);
ext4_update_dx_flag(dir);
inode_inc_iversion(dir);
err2 = ext4_mark_inode_dirty(handle, dir);
@@ -3197,7 +3197,8 @@ static int ext4_rmdir(struct inode *dir, struct dentry *dentry)
* recovery. */
inode->i_size = 0;
ext4_orphan_add(handle, inode);
- inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode);
+ inode_ctime_set_current(inode);
+ dir->i_mtime = inode_ctime_set_current(inode);
retval = ext4_mark_inode_dirty(handle, inode);
if (retval)
goto end_rmdir;
@@ -3271,7 +3272,7 @@ int __ext4_unlink(struct inode *dir, const struct qstr *d_name,
retval = ext4_delete_entry(handle, dir, de, bh);
if (retval)
goto out_handle;
- dir->i_ctime = dir->i_mtime = current_time(dir);
+ dir->i_mtime = inode_ctime_set_current(dir);
ext4_update_dx_flag(dir);
retval = ext4_mark_inode_dirty(handle, dir);
if (retval)
@@ -3286,7 +3287,7 @@ int __ext4_unlink(struct inode *dir, const struct qstr *d_name,
drop_nlink(inode);
if (!inode->i_nlink)
ext4_orphan_add(handle, inode);
- inode->i_ctime = current_time(inode);
+ inode_ctime_set_current(inode);
retval = ext4_mark_inode_dirty(handle, inode);
if (dentry && !retval)
ext4_fc_track_unlink(handle, dentry);
@@ -3463,7 +3464,7 @@ int __ext4_link(struct inode *dir, struct inode *inode, struct dentry *dentry)
if (IS_DIRSYNC(dir))
ext4_handle_sync(handle);
- inode->i_ctime = current_time(inode);
+ inode_ctime_set_current(inode);
ext4_inc_count(inode);
ihold(inode);
@@ -3641,8 +3642,7 @@ static int ext4_setent(handle_t *handle, struct ext4_renament *ent,
if (ext4_has_feature_filetype(ent->dir->i_sb))
ent->de->file_type = file_type;
inode_inc_iversion(ent->dir);
- ent->dir->i_ctime = ent->dir->i_mtime =
- current_time(ent->dir);
+ ent->dir->i_mtime = inode_ctime_set_current(ent->dir);
retval = ext4_mark_inode_dirty(handle, ent->dir);
BUFFER_TRACE(ent->bh, "call ext4_handle_dirty_metadata");
if (!ent->inlined) {
@@ -3941,7 +3941,7 @@ static int ext4_rename(struct mnt_idmap *idmap, struct inode *old_dir,
* Like most other Unix systems, set the ctime for inodes on a
* rename.
*/
- old.inode->i_ctime = current_time(old.inode);
+ inode_ctime_set_current(old.inode);
retval = ext4_mark_inode_dirty(handle, old.inode);
if (unlikely(retval))
goto end_rename;
@@ -3955,9 +3955,9 @@ static int ext4_rename(struct mnt_idmap *idmap, struct inode *old_dir,
if (new.inode) {
ext4_dec_count(new.inode);
- new.inode->i_ctime = current_time(new.inode);
+ inode_ctime_set_current(new.inode);
}
- old.dir->i_ctime = old.dir->i_mtime = current_time(old.dir);
+ old.dir->i_mtime = inode_ctime_set_current(old.dir);
ext4_update_dx_flag(old.dir);
if (old.dir_bh) {
retval = ext4_rename_dir_finish(handle, &old, new.dir->i_ino);
@@ -4053,7 +4053,6 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
};
u8 new_file_type;
int retval;
- struct timespec64 ctime;
if ((ext4_test_inode_flag(new_dir, EXT4_INODE_PROJINHERIT) &&
!projid_eq(EXT4_I(new_dir)->i_projid,
@@ -4147,9 +4146,8 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
* Like most other Unix systems, set the ctime for inodes on a
* rename.
*/
- ctime = current_time(old.inode);
- old.inode->i_ctime = ctime;
- new.inode->i_ctime = ctime;
+ inode_ctime_set_current(old.inode);
+ inode_ctime_set_current(new.inode);
retval = ext4_mark_inode_dirty(handle, old.inode);
if (unlikely(retval))
goto end_rename;
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 15ea8782222e..27f9a3b96a3e 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -7095,7 +7095,7 @@ static int ext4_quota_off(struct super_block *sb, int type)
}
EXT4_I(inode)->i_flags &= ~(EXT4_NOATIME_FL | EXT4_IMMUTABLE_FL);
inode_set_flags(inode, 0, S_NOATIME | S_IMMUTABLE);
- inode->i_mtime = inode->i_ctime = current_time(inode);
+ inode->i_mtime = inode_ctime_set_current(inode);
err = ext4_mark_inode_dirty(handle, inode);
ext4_journal_stop(handle);
out_unlock:
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index 321e3a888c20..b405a4314814 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -356,13 +356,13 @@ ext4_xattr_inode_hash(struct ext4_sb_info *sbi, const void *buffer, size_t size)
static u64 ext4_xattr_inode_get_ref(struct inode *ea_inode)
{
- return ((u64)ea_inode->i_ctime.tv_sec << 32) |
+ return ((u64) inode_ctime_peek(ea_inode).tv_sec << 32) |
(u32) inode_peek_iversion_raw(ea_inode);
}
static void ext4_xattr_inode_set_ref(struct inode *ea_inode, u64 ref_count)
{
- ea_inode->i_ctime.tv_sec = (u32)(ref_count >> 32);
+ inode_ctime_set_sec(ea_inode, (u32)(ref_count >> 32));
inode_set_iversion_raw(ea_inode, ref_count & 0xffffffff);
}
@@ -2459,7 +2459,7 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
}
if (!error) {
ext4_xattr_update_super_block(handle, inode->i_sb);
- inode->i_ctime = current_time(inode);
+ inode_ctime_set_current(inode);
inode_inc_iversion(inode);
if (!value)
no_expand = 0;
--
2.41.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 01/79] fs: add ctime accessors infrastructure
[not found] ` <99b3c749-23d9-6f09-fb75-6a84f3d1b066@kernel.org>
@ 2023-06-22 10:14 ` Jeff Layton
0 siblings, 0 replies; 7+ messages in thread
From: Jeff Layton @ 2023-06-22 10:14 UTC (permalink / raw)
To: Damien Le Moal, Jeremy Kerr, Arnd Bergmann, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
Martijn Coenen, Joel Fernandes, Christian Brauner, Carlos Llamas,
Suren Baghdasaryan, Dennis Dalessandro, Jason Gunthorpe,
Leon Romanovsky, Brad Warrum, Ritu Agarwal, Eric Van Hensbergen,
Latchesar Ionkov, Dominique Martinet, Christian Schoenebeck,
David Sterba, David Howells, Marc Dionne, Alexander Viro,
Ian Kent, Luis de Bethencourt, Salah Triki, Tigran A. Aivazian,
Eric Biederman, Kees Cook, Chris Mason, Josef Bacik, Xiubo Li,
Ilya Dryomov, Jan Harkes, coda, Joel Becker, Christoph Hellwig,
Nicolas Pitre, Rafael J. Wysocki, Tyler Hicks, Ard Biesheuvel,
Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu, Namjae Jeon, Sungjong Seo,
Jan Kara, Theodore Ts'o, Andreas Dilger, Jaegeuk Kim,
OGAWA Hirofumi, Miklos Szeredi, Bob Peterson, Andreas Gruenbacher,
Richard Weinberger, Anton Ivanov, Johannes Berg, Mikulas Patocka,
Mike Kravetz, Muchun Song, David Woodhouse, Dave Kleikamp,
Tejun Heo, Trond Myklebust, Anna Schumaker, Chuck Lever,
Ryusuke Konishi, Anton Altaparmakov, Konstantin Komarov,
Mark Fasheh, Joseph Qi, Bob Copeland, Mike Marshall,
Martin Brandenburg, Luis Chamberlain, Iurii Zaikin, Tony Luck,
Guilherme G. Piccoli, Anders Larsen, Steve French,
Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N, Tom Talpey,
Sergey Senozhatsky, Phillip Lougher, Steven Rostedt,
Masami Hiramatsu, Evgeniy Dushistov, Hans de Goede,
Darrick J. Wong, Naohiro Aota, Johannes Thumshirn,
Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, Hugh Dickins,
Andrew Morton, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, John Johansen, Paul Moore, James Morris,
Serge E. Hallyn, Stephen Smalley, Eric Paris, Juergen Gross,
Ruihan Li, Laurent Pinchart, Wolfram Sang, Udipto Goswami,
Linyu Yuan, John Keeping, Andrzej Pietrasiewicz, Dan Carpenter,
Yuta Hayama, Jozef Martiniak, Jens Axboe, Alan Stern,
Sandeep Dhavale, Dave Chinner, Johannes Weiner, ZhangPeng,
Viacheslav Dubeyko, Tetsuo Handa, Aditya Garg, Erez Zadok,
Yifei Liu, Yu Zhe, Matthew Wilcox (Oracle), Oleg Kanatov,
Dr. David Alan Gilbert, Jiangshan Yi, xu xin, Stefan Roesch,
Zhihao Cheng, Liam R. Howlett, Alexey Dobriyan, Minghao Chi,
Seth Forshee, Zeng Jingxiang, Bart Van Assche, Mimi Zohar,
Roberto Sassu, Zhang Yi, Tom Rix, Fabio M. De Francesco,
Chen Zhongjin, Zhengchao Shao, Rik van Riel, Jingyu Wang,
Hangyu Hua, linuxppc-dev, linux-kernel, linux-s390, linux-rdma,
linux-usb, v9fs, linux-fsdevel, linux-afs, autofs, linux-mm,
linux-btrfs, ceph-devel, codalist, ecryptfs, linux-efi,
linux-erofs, linux-ext4, linux-f2fs-devel, cluster-devel,
linux-um, linux-mtd, jfs-discussion, linux-nfs, linux-nilfs,
linux-ntfs-dev, ntfs3, ocfs2-devel, linux-karma-devel, devel,
linux-unionfs, linux-hardening, reiserfs-devel, linux-cifs,
samba-technical, linux-trace-kernel, linux-xfs, bpf, netdev,
apparmor, linux-security-module, selinux
On Thu, 2023-06-22 at 09:46 +0900, Damien Le Moal wrote:
> On 6/21/23 23:45, Jeff Layton wrote:
> > struct timespec64 has unused bits in the tv_nsec field that can be used
> > for other purposes. In future patches, we're going to change how the
> > inode->i_ctime is accessed in certain inodes in order to make use of
> > them. In order to do that safely though, we'll need to eradicate raw
> > accesses of the inode->i_ctime field from the kernel.
> >
> > Add new accessor functions for the ctime that we can use to replace them.
> >
> > Signed-off-by: Jeff Layton <jlayton@kernel.org>
>
> [...]
>
> > +/**
> > + * inode_ctime_peek - fetch the current ctime from the inode
> > + * @inode: inode from which to fetch ctime
> > + *
> > + * Grab the current ctime from the inode and return it.
> > + */
> > +static inline struct timespec64 inode_ctime_peek(const struct inode *inode)
>
> To be consistent with inode_ctime_set(), why not call this one inode_ctime_get()
In later patches fetching the ctime for presentation may have side
effects on certain filesystems. Using "peek" here is a hint that we want
to avoid those side effects in these calls.
> ? Also, inode_set_ctime() & inode_get_ctime() may be a little more natural. But
> no strong opinion about that though.
>
I like the consistency of the inode_ctime_* prefix. It makes it simpler
to find these calls when grepping, etc.
That said, my opinions on naming are pretty loosely-held, so if the
consensus is that the names should as you suggest, I'll go along with
it.
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 00/79] fs: new accessors for inode->i_ctime
[not found] ` <2a5a069572b46b59dd16fe8d54e549a9b5bbb6eb.camel@kernel.org>
@ 2023-06-23 12:41 ` Christian Brauner
0 siblings, 0 replies; 7+ messages in thread
From: Christian Brauner @ 2023-06-23 12:41 UTC (permalink / raw)
To: Jeff Layton
Cc: Steven Rostedt, Jeremy Kerr, Arnd Bergmann, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
Martijn Coenen, Joel Fernandes, Carlos Llamas, Suren Baghdasaryan,
Dennis Dalessandro, Jason Gunthorpe, Leon Romanovsky, Brad Warrum,
Ritu Agarwal, Eric Van Hensbergen, Latchesar Ionkov,
Dominique Martinet, Christian Schoenebeck, David Sterba,
David Howells, Marc Dionne, Alexander Viro, Ian Kent,
Luis de Bethencourt, Salah Triki, Tigran A. Aivazian,
Eric Biederman, Kees Cook, Chris Mason, Josef Bacik, Xiubo Li,
Ilya Dryomov, Jan Harkes, coda, Joel Becker, Christoph Hellwig,
Nicolas Pitre, Rafael J. Wysocki, Tyler Hicks, Ard Biesheuvel,
Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu, Namjae Jeon, Sungjong Seo,
Jan Kara, Theodore Ts'o, Andreas Dilger, Jaegeuk Kim,
OGAWA Hirofumi, Miklos Szeredi, Bob Peterson, Andreas Gruenbacher,
Richard Weinberger, Anton Ivanov, Johannes Berg, Mikulas Patocka,
Mike Kravetz, Muchun Song, David Woodhouse, Dave Kleikamp,
Tejun Heo, Trond Myklebust, Anna Schumaker, Chuck Lever,
Ryusuke Konishi, Anton Altaparmakov, Konstantin Komarov,
Mark Fasheh, Joseph Qi, Bob Copeland, Mike Marshall,
Martin Brandenburg, Luis Chamberlain, Iurii Zaikin, Tony Luck,
Guilherme G. Piccoli, Anders Larsen, Steve French,
Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N, Tom Talpey,
Sergey Senozhatsky, Phillip Lougher, Masami Hiramatsu,
Evgeniy Dushistov, Hans de Goede, Darrick J. Wong, Damien Le Moal,
Naohiro Aota, Johannes Thumshirn, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau, Song Liu,
Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
Hao Luo, Jiri Olsa, Hugh Dickins, Andrew Morton, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, John Johansen,
Paul Moore, James Morris, Serge E. Hallyn, Stephen Smalley,
Eric Paris, Juergen Gross, Ruihan Li, Laurent Pinchart,
Wolfram Sang, Udipto Goswami, Linyu Yuan, John Keeping,
Andrzej Pietrasiewicz, Dan Carpenter, Yuta Hayama,
Jozef Martiniak, Jens Axboe, Alan Stern, Sandeep Dhavale,
Dave Chinner, Johannes Weiner, ZhangPeng, Viacheslav Dubeyko,
Tetsuo Handa, Aditya Garg, Erez Zadok, Yifei Liu, Yu Zhe,
Matthew Wilcox (Oracle), Oleg Kanatov, Dr. David Alan Gilbert,
Jiangshan Yi, xu xin, Stefan Roesch, Zhihao Cheng,
Liam R. Howlett, Alexey Dobriyan, Minghao Chi, Seth Forshee,
Zeng Jingxiang, Bart Van Assche, Mimi Zohar, Roberto Sassu,
Zhang Yi, Tom Rix, Fabio M. De Francesco, Chen Zhongjin,
Zhengchao Shao, Rik van Riel, Jingyu Wang, Hangyu Hua,
linuxppc-dev, linux-kernel, linux-s390, linux-rdma, linux-usb,
v9fs, linux-fsdevel, linux-afs, autofs, linux-mm, linux-btrfs,
ceph-devel, codalist, ecryptfs, linux-efi, linux-erofs,
linux-ext4, linux-f2fs-devel, cluster-devel, linux-um, linux-mtd,
jfs-discussion, linux-nfs, linux-nilfs, linux-ntfs-dev, ntfs3,
ocfs2-devel, linux-karma-devel, devel, linux-unionfs,
linux-hardening, reiserfs-devel, linux-cifs, samba-technical,
linux-trace-kernel, linux-xfs, bpf, netdev, apparmor,
linux-security-module, selinux
On Wed, Jun 21, 2023 at 03:52:27PM -0400, Jeff Layton wrote:
> On Wed, 2023-06-21 at 15:21 -0400, Steven Rostedt wrote:
> > On Wed, 21 Jun 2023 10:45:05 -0400
> > Jeff Layton <jlayton@kernel.org> wrote:
> >
> > > Most of this conversion was done via coccinelle, with a few of the more
> > > non-standard accesses done by hand. There should be no behavioral
> > > changes with this set. That will come later, as we convert individual
> > > filesystems to use multigrain timestamps.
> >
> > BTW, Linus has suggested to me that whenever a conccinelle script is used,
> > it should be included in the change log.
> >
>
> Ok, here's what I have. I note again that my usage of coccinelle is
> pretty primitive, so I ended up doing a fair bit of by-hand fixing after
> applying these.
>
> Given the way that this change is broken up into 77 patches by
> subsystem, to which changelogs should I add it? I could add it to the
> "infrastructure" patch, but that's the one where I _didn't_ use it.
>
> Maybe to patch #79 (the one that renames i_ctime)?
That works. I can also put this into a merge commit or pr message.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 00/79] fs: new accessors for inode->i_ctime
[not found] ` <20230621152141.5961cf5f@gandalf.local.home>
[not found] ` <2a5a069572b46b59dd16fe8d54e549a9b5bbb6eb.camel@kernel.org>
@ 2023-06-30 22:11 ` Luis Chamberlain
1 sibling, 0 replies; 7+ messages in thread
From: Luis Chamberlain @ 2023-06-30 22:11 UTC (permalink / raw)
To: Steven Rostedt, Julia Lawall, Takashi Iwai
Cc: Jeff Layton, Jeremy Kerr, Arnd Bergmann, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
Martijn Coenen, Joel Fernandes, Christian Brauner, Carlos Llamas,
Suren Baghdasaryan, Dennis Dalessandro, Jason Gunthorpe,
Leon Romanovsky, Brad Warrum, Ritu Agarwal, Eric Van Hensbergen,
Latchesar Ionkov, Dominique Martinet, Christian Schoenebeck,
David Sterba, David Howells, Marc Dionne, Alexander Viro,
Ian Kent, Luis de Bethencourt, Salah Triki, Tigran A. Aivazian,
Eric Biederman, Kees Cook, Chris Mason, Josef Bacik, Xiubo Li,
Ilya Dryomov, Jan Harkes, coda, Joel Becker, Christoph Hellwig,
Nicolas Pitre, Rafael J. Wysocki, Tyler Hicks, Ard Biesheuvel,
Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu, Namjae Jeon, Sungjong Seo,
Jan Kara, Theodore Ts'o, Andreas Dilger, Jaegeuk Kim,
OGAWA Hirofumi, Miklos Szeredi, Bob Peterson, Andreas Gruenbacher,
Richard Weinberger, Anton Ivanov, Johannes Berg, Mikulas Patocka,
Mike Kravetz, Muchun Song, David Woodhouse, Dave Kleikamp,
Tejun Heo, Trond Myklebust, Anna Schumaker, Chuck Lever,
Ryusuke Konishi, Anton Altaparmakov, Konstantin Komarov,
Mark Fasheh, Joseph Qi, Bob Copeland, Mike Marshall,
Martin Brandenburg, Iurii Zaikin, Tony Luck, Guilherme G. Piccoli,
Anders Larsen, Steve French, Paulo Alcantara, Ronnie Sahlberg,
Shyam Prasad N, Tom Talpey, Sergey Senozhatsky, Phillip Lougher,
Masami Hiramatsu, Evgeniy Dushistov, Hans de Goede,
Darrick J. Wong, Damien Le Moal, Naohiro Aota, Johannes Thumshirn,
Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, Hugh Dickins,
Andrew Morton, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, John Johansen, Paul Moore, James Morris,
Serge E. Hallyn, Stephen Smalley, Eric Paris, Juergen Gross,
Ruihan Li, Laurent Pinchart, Wolfram Sang, Udipto Goswami,
Linyu Yuan, John Keeping, Andrzej Pietrasiewicz, Dan Carpenter,
Yuta Hayama, Jozef Martiniak, Jens Axboe, Alan Stern,
Sandeep Dhavale, Dave Chinner, Johannes Weiner, ZhangPeng,
Viacheslav Dubeyko, Tetsuo Handa, Aditya Garg, Erez Zadok,
Yifei Liu, Yu Zhe, Matthew Wilcox (Oracle), Oleg Kanatov,
Dr. David Alan Gilbert, Jiangshan Yi, xu xin, Stefan Roesch,
Zhihao Cheng, Liam R. Howlett, Alexey Dobriyan, Minghao Chi,
Seth Forshee, Zeng Jingxiang, Bart Van Assche, Mimi Zohar,
Roberto Sassu, Zhang Yi, Tom Rix, Fabio M. De Francesco,
Chen Zhongjin, Zhengchao Shao, Rik van Riel, Jingyu Wang,
Hangyu Hua, linuxppc-dev, linux-kernel, linux-s390, linux-rdma,
linux-usb, v9fs, linux-fsdevel, linux-afs, autofs, linux-mm,
linux-btrfs, ceph-devel, codalist, ecryptfs, linux-efi,
linux-erofs, linux-ext4, linux-f2fs-devel, cluster-devel,
linux-um, linux-mtd, jfs-discussion, linux-nfs, linux-nilfs,
linux-ntfs-dev, ntfs3, ocfs2-devel, linux-karma-devel, devel,
linux-unionfs, linux-hardening, reiserfs-devel, linux-cifs,
samba-technical, linux-trace-kernel, linux-xfs, bpf, netdev,
apparmor, linux-security-module, selinux
On Wed, Jun 21, 2023 at 03:21:41PM -0400, Steven Rostedt wrote:
> On Wed, 21 Jun 2023 10:45:05 -0400
> Jeff Layton <jlayton@kernel.org> wrote:
>
> > Most of this conversion was done via coccinelle, with a few of the more
> > non-standard accesses done by hand. There should be no behavioral
> > changes with this set. That will come later, as we convert individual
> > filesystems to use multigrain timestamps.
>
> BTW, Linus has suggested to me that whenever a conccinelle script is used,
> it should be included in the change log.
Sometimes people like the coccinelle included in the commit, sometimes
people don't [0], it really ends up being up to a subjective maintainer
preference. A compromise could be to use git notes as these are
optional, however if we want to go down that path we should try to make
a general consensus on it so we can send a consistent message.
[0] https://lore.kernel.org/all/20230512073100.GC32559@twin.jikos.cz/
Luis
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 01/79] fs: add ctime accessors infrastructure
[not found] ` <20230621144507.55591-2-jlayton@kernel.org>
[not found] ` <99b3c749-23d9-6f09-fb75-6a84f3d1b066@kernel.org>
@ 2023-06-30 22:12 ` Luis Chamberlain
2023-07-12 15:31 ` Randy Dunlap
2 siblings, 0 replies; 7+ messages in thread
From: Luis Chamberlain @ 2023-06-30 22:12 UTC (permalink / raw)
To: Jeff Layton
Cc: Jeremy Kerr, Arnd Bergmann, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
Martijn Coenen, Joel Fernandes, Christian Brauner, Carlos Llamas,
Suren Baghdasaryan, Dennis Dalessandro, Jason Gunthorpe,
Leon Romanovsky, Brad Warrum, Ritu Agarwal, Eric Van Hensbergen,
Latchesar Ionkov, Dominique Martinet, Christian Schoenebeck,
David Sterba, David Howells, Marc Dionne, Alexander Viro,
Ian Kent, Luis de Bethencourt, Salah Triki, Tigran A. Aivazian,
Eric Biederman, Kees Cook, Chris Mason, Josef Bacik, Xiubo Li,
Ilya Dryomov, Jan Harkes, coda, Joel Becker, Christoph Hellwig,
Nicolas Pitre, Rafael J. Wysocki, Tyler Hicks, Ard Biesheuvel,
Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu, Namjae Jeon, Sungjong Seo,
Jan Kara, Theodore Ts'o, Andreas Dilger, Jaegeuk Kim,
OGAWA Hirofumi, Miklos Szeredi, Bob Peterson, Andreas Gruenbacher,
Richard Weinberger, Anton Ivanov, Johannes Berg, Mikulas Patocka,
Mike Kravetz, Muchun Song, David Woodhouse, Dave Kleikamp,
Tejun Heo, Trond Myklebust, Anna Schumaker, Chuck Lever,
Ryusuke Konishi, Anton Altaparmakov, Konstantin Komarov,
Mark Fasheh, Joseph Qi, Bob Copeland, Mike Marshall,
Martin Brandenburg, Iurii Zaikin, Tony Luck, Guilherme G. Piccoli,
Anders Larsen, Steve French, Paulo Alcantara, Ronnie Sahlberg,
Shyam Prasad N, Tom Talpey, Sergey Senozhatsky, Phillip Lougher,
Steven Rostedt, Masami Hiramatsu, Evgeniy Dushistov,
Hans de Goede, Darrick J. Wong, Damien Le Moal, Naohiro Aota,
Johannes Thumshirn, Alexei Starovoitov, Daniel Borkmann,
Andrii Nakryiko, Martin KaFai Lau, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Hugh Dickins, Andrew Morton, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, John Johansen, Paul Moore,
James Morris, Serge E. Hallyn, Stephen Smalley, Eric Paris,
Juergen Gross, Ruihan Li, Laurent Pinchart, Wolfram Sang,
Udipto Goswami, Linyu Yuan, John Keeping, Andrzej Pietrasiewicz,
Dan Carpenter, Yuta Hayama, Jozef Martiniak, Jens Axboe,
Alan Stern, Sandeep Dhavale, Dave Chinner, Johannes Weiner,
ZhangPeng, Viacheslav Dubeyko, Tetsuo Handa, Aditya Garg,
Erez Zadok, Yifei Liu, Yu Zhe, Matthew Wilcox (Oracle),
Oleg Kanatov, Dr. David Alan Gilbert, Jiangshan Yi, xu xin,
Stefan Roesch, Zhihao Cheng, Liam R. Howlett, Alexey Dobriyan,
Minghao Chi, Seth Forshee, Zeng Jingxiang, Bart Van Assche,
Mimi Zohar, Roberto Sassu, Zhang Yi, Tom Rix,
Fabio M. De Francesco, Chen Zhongjin, Zhengchao Shao,
Rik van Riel, Jingyu Wang, Hangyu Hua, linuxppc-dev, linux-kernel,
linux-s390, linux-rdma, linux-usb, v9fs, linux-fsdevel, linux-afs,
autofs, linux-mm, linux-btrfs, ceph-devel, codalist, ecryptfs,
linux-efi, linux-erofs, linux-ext4, linux-f2fs-devel,
cluster-devel, linux-um, linux-mtd, jfs-discussion, linux-nfs,
linux-nilfs, linux-ntfs-dev, ntfs3, ocfs2-devel,
linux-karma-devel, devel, linux-unionfs, linux-hardening,
reiserfs-devel, linux-cifs, samba-technical, linux-trace-kernel,
linux-xfs, bpf, netdev, apparmor, linux-security-module, selinux
On Wed, Jun 21, 2023 at 10:45:06AM -0400, Jeff Layton wrote:
> struct timespec64 has unused bits in the tv_nsec field that can be used
> for other purposes. In future patches, we're going to change how the
> inode->i_ctime is accessed in certain inodes in order to make use of
> them. In order to do that safely though, we'll need to eradicate raw
> accesses of the inode->i_ctime field from the kernel.
>
> Add new accessor functions for the ctime that we can use to replace them.
>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Luis
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 01/79] fs: add ctime accessors infrastructure
[not found] ` <20230621144507.55591-2-jlayton@kernel.org>
[not found] ` <99b3c749-23d9-6f09-fb75-6a84f3d1b066@kernel.org>
2023-06-30 22:12 ` Luis Chamberlain
@ 2023-07-12 15:31 ` Randy Dunlap
2 siblings, 0 replies; 7+ messages in thread
From: Randy Dunlap @ 2023-07-12 15:31 UTC (permalink / raw)
To: Jeff Layton, linux-kernel@vger.kernel.org,
Linux FS-devel Mailing List, linux-um
Hi Jeff,
On arch/um/, (subarch i386 or x86_64), hostfs build fails with:
../fs/hostfs/hostfs_kern.c:520:36: error: incompatible type for arg
ument 2 of 'inode_set_ctime_to_ts'
../include/linux/fs.h:1499:73: note: expected 'struct timespec64' b
ut argument is of type 'const struct hostfs_timespec *'
--
~Randy
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-07-12 15:33 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20230621144507.55591-1-jlayton@kernel.org>
[not found] ` <20230621144735.55953-1-jlayton@kernel.org>
2023-06-21 14:45 ` [PATCH 28/79] ext2: switch to new ctime accessors Jeff Layton
2023-06-21 14:45 ` [PATCH 29/79] ext4: " Jeff Layton
[not found] ` <20230621152141.5961cf5f@gandalf.local.home>
[not found] ` <2a5a069572b46b59dd16fe8d54e549a9b5bbb6eb.camel@kernel.org>
2023-06-23 12:41 ` [PATCH 00/79] fs: new accessors for inode->i_ctime Christian Brauner
2023-06-30 22:11 ` Luis Chamberlain
[not found] ` <20230621144507.55591-2-jlayton@kernel.org>
[not found] ` <99b3c749-23d9-6f09-fb75-6a84f3d1b066@kernel.org>
2023-06-22 10:14 ` [PATCH 01/79] fs: add ctime accessors infrastructure Jeff Layton
2023-06-30 22:12 ` Luis Chamberlain
2023-07-12 15:31 ` Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).