* [f2fs-dev] [PATCH 00/79] fs: new accessors for inode->i_ctime
@ 2023-06-21 14:45 Jeff Layton
2023-06-21 14:45 ` [f2fs-dev] [PATCH 01/79] fs: add ctime accessors infrastructure Jeff Layton
` (3 more replies)
0 siblings, 4 replies; 16+ messages in thread
From: Jeff Layton @ 2023-06-21 14:45 UTC (permalink / raw)
To: 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, 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
I've been working on a patchset to change how the inode->i_ctime is
accessed in order to give us conditional, high-res timestamps for the
ctime and mtime. struct timespec64 has unused bits in it that we can use
to implement this. In order to do that however, we need to wrap all
accesses of inode->i_ctime to ensure that bits used as flags are
appropriately handled.
This patchset first adds some new inode_ctime_* accessor functions. It
then converts all in-tree accesses of inode->i_ctime to use those new
functions and then renames the i_ctime field to __i_ctime to help ensure
that use of the accessors.
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.
Some of these patches depend on the set I sent recently to add missing
ctime updates in various subsystems:
https://lore.kernel.org/linux-fsdevel/20230612104524.17058-1-jlayton@kernel.org/T/#m25399f903cc9526e46b2e0f5a35713c80b52fde9
Since this patchset is so large, I'm only going to send individual
conversion patches to the appropriate maintainers. Please send
Acked-by's or Reviewed-by's if you can. The intent is to merge these as
a set (probably in v6.6). Let me know if that causes conflicts though,
and we can work it out.
This is based on top of linux-next as of yesterday.
Jeff Layton (79):
fs: add ctime accessors infrastructure
spufs: switch to new ctime accessors
s390: switch to new ctime accessors
binderfs: switch to new ctime accessors
qib_fs: switch to new ctime accessors
ibm: switch to new ctime accessors
usb: switch to new ctime accessors
9p: switch to new ctime accessors
adfs: switch to new ctime accessors
affs: switch to new ctime accessors
afs: switch to new ctime accessors
fs: switch to new ctime accessors
autofs: switch to new ctime accessors
befs: switch to new ctime accessors
bfs: switch to new ctime accessors
btrfs: switch to new ctime accessors
ceph: switch to new ctime accessors
coda: switch to new ctime accessors
configfs: switch to new ctime accessors
cramfs: switch to new ctime accessors
debugfs: switch to new ctime accessors
devpts: switch to new ctime accessors
ecryptfs: switch to new ctime accessors
efivarfs: switch to new ctime accessors
efs: switch to new ctime accessors
erofs: switch to new ctime accessors
exfat: switch to new ctime accessors
ext2: switch to new ctime accessors
ext4: switch to new ctime accessors
f2fs: switch to new ctime accessors
fat: switch to new ctime accessors
freevxfs: switch to new ctime accessors
fuse: switch to new ctime accessors
gfs2: switch to new ctime accessors
hfs: switch to new ctime accessors
hfsplus: switch to new ctime accessors
hostfs: switch to new ctime accessors
hpfs: switch to new ctime accessors
hugetlbfs: switch to new ctime accessors
isofs: switch to new ctime accessors
jffs2: switch to new ctime accessors
jfs: switch to new ctime accessors
kernfs: switch to new ctime accessors
minix: switch to new ctime accessors
nfs: switch to new ctime accessors
nfsd: switch to new ctime accessors
nilfs2: switch to new ctime accessors
ntfs: switch to new ctime accessors
ntfs3: switch to new ctime accessors
ocfs2: switch to new ctime accessors
omfs: switch to new ctime accessors
openpromfs: switch to new ctime accessors
orangefs: switch to new ctime accessors
overlayfs: switch to new ctime accessors
proc: switch to new ctime accessors
pstore: switch to new ctime accessors
qnx4: switch to new ctime accessors
qnx6: switch to new ctime accessors
ramfs: switch to new ctime accessors
reiserfs: switch to new ctime accessors
romfs: switch to new ctime accessors
smb: switch to new ctime accessors
squashfs: switch to new ctime accessors
sysv: switch to new ctime accessors
tracefs: switch to new ctime accessors
ubifs: switch to new ctime accessors
udf: switch to new ctime accessors
ufs: switch to new ctime accessors
vboxsf: switch to new ctime accessors
xfs: switch to new ctime accessors
zonefs: switch to new ctime accessors
mqueue: switch to new ctime accessors
bpf: switch to new ctime accessors
shmem: switch to new ctime accessors
rpc_pipefs: switch to new ctime accessors
apparmor: switch to new ctime accessors
security: switch to new ctime accessors
selinux: switch to new ctime accessors
fs: rename i_ctime field to __i_ctime
arch/powerpc/platforms/cell/spufs/inode.c | 2 +-
arch/s390/hypfs/inode.c | 4 +-
drivers/android/binderfs.c | 8 +--
drivers/infiniband/hw/qib/qib_fs.c | 4 +-
drivers/misc/ibmasm/ibmasmfs.c | 2 +-
drivers/misc/ibmvmc.c | 2 +-
drivers/usb/core/devio.c | 16 +++---
drivers/usb/gadget/function/f_fs.c | 6 +--
drivers/usb/gadget/legacy/inode.c | 3 +-
fs/9p/vfs_inode.c | 6 ++-
fs/9p/vfs_inode_dotl.c | 11 ++--
fs/adfs/inode.c | 4 +-
fs/affs/amigaffs.c | 6 +--
fs/affs/inode.c | 17 +++---
fs/afs/dynroot.c | 2 +-
fs/afs/inode.c | 6 +--
fs/attr.c | 2 +-
fs/autofs/inode.c | 2 +-
fs/autofs/root.c | 6 +--
fs/bad_inode.c | 3 +-
fs/befs/linuxvfs.c | 2 +-
fs/bfs/dir.c | 16 +++---
fs/bfs/inode.c | 6 +--
fs/binfmt_misc.c | 3 +-
fs/btrfs/delayed-inode.c | 10 ++--
fs/btrfs/file.c | 24 +++------
fs/btrfs/inode.c | 66 +++++++++--------------
fs/btrfs/ioctl.c | 2 +-
fs/btrfs/reflink.c | 7 ++-
fs/btrfs/transaction.c | 3 +-
fs/btrfs/tree-log.c | 4 +-
fs/btrfs/xattr.c | 4 +-
fs/ceph/acl.c | 2 +-
fs/ceph/caps.c | 2 +-
fs/ceph/inode.c | 17 +++---
fs/ceph/snap.c | 2 +-
fs/ceph/xattr.c | 2 +-
fs/coda/coda_linux.c | 2 +-
fs/coda/dir.c | 2 +-
fs/coda/file.c | 2 +-
fs/coda/inode.c | 2 +-
fs/configfs/inode.c | 6 +--
fs/cramfs/inode.c | 2 +-
fs/debugfs/inode.c | 2 +-
fs/devpts/inode.c | 6 +--
fs/ecryptfs/inode.c | 2 +-
fs/efivarfs/file.c | 2 +-
fs/efivarfs/inode.c | 2 +-
fs/efs/inode.c | 5 +-
fs/erofs/inode.c | 16 +++---
fs/exfat/file.c | 4 +-
fs/exfat/inode.c | 6 +--
fs/exfat/namei.c | 29 +++++-----
fs/exfat/super.c | 4 +-
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 +-
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 +--
fs/f2fs/dir.c | 8 +--
fs/f2fs/f2fs.h | 5 +-
fs/f2fs/file.c | 16 +++---
fs/f2fs/inline.c | 2 +-
fs/f2fs/inode.c | 10 ++--
fs/f2fs/namei.c | 12 ++---
fs/f2fs/recovery.c | 4 +-
fs/f2fs/super.c | 2 +-
fs/f2fs/xattr.c | 2 +-
fs/fat/inode.c | 8 +--
fs/fat/misc.c | 7 ++-
fs/freevxfs/vxfs_inode.c | 4 +-
fs/fuse/control.c | 2 +-
fs/fuse/dir.c | 8 +--
fs/fuse/inode.c | 18 ++++---
fs/gfs2/acl.c | 2 +-
fs/gfs2/bmap.c | 11 ++--
fs/gfs2/dir.c | 15 +++---
fs/gfs2/file.c | 2 +-
fs/gfs2/glops.c | 4 +-
fs/gfs2/inode.c | 8 +--
fs/gfs2/super.c | 4 +-
fs/gfs2/xattr.c | 8 +--
fs/hfs/catalog.c | 8 +--
fs/hfs/dir.c | 2 +-
fs/hfs/inode.c | 13 +++--
fs/hfs/sysdep.c | 2 +-
fs/hfsplus/catalog.c | 8 +--
fs/hfsplus/dir.c | 6 +--
fs/hfsplus/inode.c | 14 ++---
fs/hostfs/hostfs_kern.c | 4 +-
fs/hpfs/dir.c | 8 +--
fs/hpfs/inode.c | 6 +--
fs/hpfs/namei.c | 26 +++++----
fs/hpfs/super.c | 5 +-
fs/hugetlbfs/inode.c | 12 ++---
fs/inode.c | 26 +++++++--
fs/isofs/inode.c | 4 +-
fs/isofs/rock.c | 16 +++---
fs/jffs2/dir.c | 19 +++----
fs/jffs2/file.c | 3 +-
fs/jffs2/fs.c | 10 ++--
fs/jffs2/os-linux.h | 2 +-
fs/jfs/acl.c | 2 +-
fs/jfs/inode.c | 2 +-
fs/jfs/ioctl.c | 2 +-
fs/jfs/jfs_imap.c | 8 +--
fs/jfs/jfs_inode.c | 4 +-
fs/jfs/namei.c | 25 ++++-----
fs/jfs/super.c | 2 +-
fs/jfs/xattr.c | 2 +-
fs/kernfs/inode.c | 4 +-
fs/libfs.c | 32 +++++------
fs/minix/bitmap.c | 2 +-
fs/minix/dir.c | 6 +--
fs/minix/inode.c | 11 ++--
fs/minix/itree_common.c | 4 +-
fs/minix/namei.c | 6 +--
fs/nfs/callback_proc.c | 2 +-
fs/nfs/fscache.h | 4 +-
fs/nfs/inode.c | 21 ++++----
fs/nfsd/nfsctl.c | 2 +-
fs/nfsd/vfs.c | 2 +-
fs/nilfs2/dir.c | 6 +--
fs/nilfs2/inode.c | 12 ++---
fs/nilfs2/ioctl.c | 2 +-
fs/nilfs2/namei.c | 8 +--
fs/nsfs.c | 2 +-
fs/ntfs/inode.c | 15 +++---
fs/ntfs/mft.c | 3 +-
fs/ntfs3/file.c | 6 +--
fs/ntfs3/frecord.c | 4 +-
fs/ntfs3/inode.c | 14 ++---
fs/ntfs3/namei.c | 10 ++--
fs/ntfs3/xattr.c | 4 +-
fs/ocfs2/acl.c | 6 +--
fs/ocfs2/alloc.c | 6 +--
fs/ocfs2/aops.c | 2 +-
fs/ocfs2/dir.c | 8 +--
fs/ocfs2/dlmfs/dlmfs.c | 4 +-
fs/ocfs2/dlmglue.c | 10 ++--
fs/ocfs2/file.c | 16 +++---
fs/ocfs2/inode.c | 14 ++---
fs/ocfs2/move_extents.c | 6 +--
fs/ocfs2/namei.c | 22 ++++----
fs/ocfs2/refcounttree.c | 14 ++---
fs/ocfs2/xattr.c | 6 +--
fs/omfs/dir.c | 4 +-
fs/omfs/inode.c | 10 ++--
fs/openpromfs/inode.c | 4 +-
fs/orangefs/namei.c | 2 +-
fs/orangefs/orangefs-utils.c | 6 +--
fs/overlayfs/file.c | 7 ++-
fs/overlayfs/util.c | 2 +-
fs/pipe.c | 2 +-
fs/posix_acl.c | 2 +-
fs/proc/base.c | 2 +-
fs/proc/inode.c | 2 +-
fs/proc/proc_sysctl.c | 2 +-
fs/proc/self.c | 2 +-
fs/proc/thread_self.c | 2 +-
fs/pstore/inode.c | 4 +-
fs/qnx4/inode.c | 4 +-
fs/qnx6/inode.c | 4 +-
fs/ramfs/inode.c | 6 +--
fs/reiserfs/inode.c | 14 ++---
fs/reiserfs/ioctl.c | 4 +-
fs/reiserfs/namei.c | 21 ++++----
fs/reiserfs/stree.c | 4 +-
fs/reiserfs/super.c | 2 +-
fs/reiserfs/xattr.c | 5 +-
fs/reiserfs/xattr_acl.c | 2 +-
fs/romfs/super.c | 4 +-
fs/smb/client/file.c | 4 +-
fs/smb/client/fscache.h | 5 +-
fs/smb/client/inode.c | 15 +++---
fs/smb/client/smb2ops.c | 2 +-
fs/smb/server/smb2pdu.c | 8 +--
fs/squashfs/inode.c | 2 +-
fs/stack.c | 2 +-
fs/stat.c | 2 +-
fs/sysv/dir.c | 6 +--
fs/sysv/ialloc.c | 2 +-
fs/sysv/inode.c | 6 +--
fs/sysv/itree.c | 4 +-
fs/sysv/namei.c | 6 +--
fs/tracefs/inode.c | 2 +-
fs/ubifs/debug.c | 4 +-
fs/ubifs/dir.c | 39 +++++++-------
fs/ubifs/file.c | 16 +++---
fs/ubifs/ioctl.c | 2 +-
fs/ubifs/journal.c | 4 +-
fs/ubifs/super.c | 4 +-
fs/ubifs/xattr.c | 6 +--
fs/udf/ialloc.c | 2 +-
fs/udf/inode.c | 17 +++---
fs/udf/namei.c | 24 ++++-----
fs/ufs/dir.c | 6 +--
fs/ufs/ialloc.c | 2 +-
fs/ufs/inode.c | 23 ++++----
fs/ufs/namei.c | 8 +--
fs/vboxsf/utils.c | 4 +-
fs/xfs/libxfs/xfs_inode_buf.c | 4 +-
fs/xfs/libxfs/xfs_trans_inode.c | 2 +-
fs/xfs/xfs_acl.c | 2 +-
fs/xfs/xfs_bmap_util.c | 6 ++-
fs/xfs/xfs_inode.c | 2 +-
fs/xfs/xfs_inode_item.c | 2 +-
fs/xfs/xfs_iops.c | 4 +-
fs/xfs/xfs_itable.c | 4 +-
fs/zonefs/super.c | 8 +--
include/linux/fs.h | 55 ++++++++++++++++++-
include/linux/fs_stack.h | 2 +-
ipc/mqueue.c | 20 ++++---
kernel/bpf/inode.c | 4 +-
mm/shmem.c | 28 +++++-----
net/sunrpc/rpc_pipe.c | 2 +-
security/apparmor/apparmorfs.c | 6 +--
security/apparmor/policy_unpack.c | 4 +-
security/inode.c | 2 +-
security/selinux/selinuxfs.c | 2 +-
233 files changed, 914 insertions(+), 808 deletions(-)
--
2.41.0
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* [f2fs-dev] [PATCH 01/79] fs: add ctime accessors infrastructure
2023-06-21 14:45 [f2fs-dev] [PATCH 00/79] fs: new accessors for inode->i_ctime Jeff Layton
@ 2023-06-21 14:45 ` Jeff Layton
2023-06-21 16:34 ` Jan Kara
` (3 more replies)
[not found] ` <20230621144735.55953-1-jlayton@kernel.org>
` (2 subsequent siblings)
3 siblings, 4 replies; 16+ messages in thread
From: Jeff Layton @ 2023-06-21 14:45 UTC (permalink / raw)
To: 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, 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
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>
---
fs/inode.c | 16 ++++++++++++++
include/linux/fs.h | 53 +++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 68 insertions(+), 1 deletion(-)
diff --git a/fs/inode.c b/fs/inode.c
index d37fad91c8da..c005e7328fbb 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -2499,6 +2499,22 @@ struct timespec64 current_time(struct inode *inode)
}
EXPORT_SYMBOL(current_time);
+/**
+ * inode_ctime_set_current - set the ctime to current_time
+ * @inode: inode
+ *
+ * Set the inode->i_ctime to the current value for the inode. Returns
+ * the current value that was assigned to i_ctime.
+ */
+struct timespec64 inode_ctime_set_current(struct inode *inode)
+{
+ struct timespec64 now = current_time(inode);
+
+ inode_set_ctime(inode, now);
+ return now;
+}
+EXPORT_SYMBOL(inode_ctime_set_current);
+
/**
* in_group_or_capable - check whether caller is CAP_FSETID privileged
* @idmap: idmap of the mount @inode was found from
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 6867512907d6..9afb30606373 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1474,7 +1474,58 @@ static inline bool fsuidgid_has_mapping(struct super_block *sb,
kgid_has_mapping(fs_userns, kgid);
}
-extern struct timespec64 current_time(struct inode *inode);
+struct timespec64 current_time(struct inode *inode);
+struct timespec64 inode_ctime_set_current(struct inode *inode);
+
+/**
+ * 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)
+{
+ return inode->i_ctime;
+}
+
+/**
+ * inode_ctime_set - set the ctime in the inode to the given value
+ * @inode: inode in which to set the ctime
+ * @ts: timespec value to set the ctime
+ *
+ * Set the ctime in @inode to @ts.
+ */
+static inline struct timespec64 inode_ctime_set(struct inode *inode, struct timespec64 ts)
+{
+ inode->i_ctime = ts;
+ return ts;
+}
+
+/**
+ * inode_ctime_set_sec - set only the tv_sec field in the inode ctime
+ * @inode: inode in which to set the ctime
+ * @sec: value to set the tv_sec field
+ *
+ * Set the sec field in the ctime. Returns @sec.
+ */
+static inline time64_t inode_ctime_set_sec(struct inode *inode, time64_t sec)
+{
+ inode->i_ctime.tv_sec = sec;
+ return sec;
+}
+
+/**
+ * inode_ctime_set_nsec - set only the tv_nsec field in the inode ctime
+ * @inode: inode in which to set the ctime
+ * @nsec: value to set the tv_nsec field
+ *
+ * Set the nsec field in the ctime. Returns @nsec.
+ */
+static inline long inode_ctime_set_nsec(struct inode *inode, long nsec)
+{
+ inode->i_ctime.tv_nsec = nsec;
+ return nsec;
+}
/*
* Snapshotting support.
--
2.41.0
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [f2fs-dev] [PATCH 30/79] f2fs: switch to new ctime accessors
[not found] ` <20230621144735.55953-1-jlayton@kernel.org>
@ 2023-06-21 14:45 ` Jeff Layton
0 siblings, 0 replies; 16+ messages in thread
From: Jeff Layton @ 2023-06-21 14:45 UTC (permalink / raw)
To: Christian Brauner, Jaegeuk Kim, Chao Yu
Cc: linux-kernel, Jan Kara, Al Viro, linux-f2fs-devel
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/f2fs/dir.c | 8 ++++----
fs/f2fs/f2fs.h | 5 ++++-
fs/f2fs/file.c | 16 ++++++++--------
fs/f2fs/inline.c | 2 +-
fs/f2fs/inode.c | 10 +++++-----
fs/f2fs/namei.c | 12 ++++++------
fs/f2fs/recovery.c | 4 ++--
fs/f2fs/super.c | 2 +-
fs/f2fs/xattr.c | 2 +-
9 files changed, 32 insertions(+), 29 deletions(-)
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index 887e55988450..54fa7285e2d6 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -455,7 +455,7 @@ void f2fs_set_link(struct inode *dir, struct f2fs_dir_entry *de,
de->file_type = fs_umode_to_ftype(inode->i_mode);
set_page_dirty(page);
- dir->i_mtime = dir->i_ctime = current_time(dir);
+ dir->i_mtime = inode_ctime_set_current(dir);
f2fs_mark_inode_dirty_sync(dir, false);
f2fs_put_page(page, 1);
}
@@ -609,7 +609,7 @@ void f2fs_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);
+ dir->i_mtime = inode_ctime_set_current(dir);
f2fs_mark_inode_dirty_sync(dir, false);
if (F2FS_I(dir)->i_current_depth != current_depth)
@@ -851,7 +851,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);
+ inode_ctime_set_current(inode);
f2fs_i_links_write(inode, false);
if (S_ISDIR(inode->i_mode)) {
@@ -912,7 +912,7 @@ void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page,
}
f2fs_put_page(page, 1);
- dir->i_ctime = dir->i_mtime = current_time(dir);
+ dir->i_mtime = inode_ctime_set_current(dir);
f2fs_mark_inode_dirty_sync(dir, false);
if (inode)
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 7b9af2d51656..b0a0de41f823 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -3302,9 +3302,12 @@ static inline void clear_file(struct inode *inode, int type)
static inline bool f2fs_is_time_consistent(struct inode *inode)
{
+ struct timespec64 ctime;
+
if (!timespec64_equal(F2FS_I(inode)->i_disk_time, &inode->i_atime))
return false;
- if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 1, &inode->i_ctime))
+ ctime = inode_ctime_peek(inode);
+ if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 1, &ctime))
return false;
if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 2, &inode->i_mtime))
return false;
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 38688b5192ef..76c38cd89865 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -809,7 +809,7 @@ int f2fs_truncate(struct inode *inode)
if (err)
return err;
- inode->i_mtime = inode->i_ctime = current_time(inode);
+ inode->i_mtime = inode_ctime_set_current(inode);
f2fs_mark_inode_dirty_sync(inode, false);
return 0;
}
@@ -920,7 +920,7 @@ static void __setattr_copy(struct mnt_idmap *idmap,
if (ia_valid & ATTR_MTIME)
inode->i_mtime = attr->ia_mtime;
if (ia_valid & ATTR_CTIME)
- inode->i_ctime = attr->ia_ctime;
+ inode_ctime_set(inode, attr->ia_ctime);
if (ia_valid & ATTR_MODE) {
umode_t mode = attr->ia_mode;
vfsgid_t vfsgid = i_gid_into_vfsgid(idmap, inode);
@@ -1023,7 +1023,7 @@ int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
return err;
spin_lock(&F2FS_I(inode)->i_size_lock);
- inode->i_mtime = inode->i_ctime = current_time(inode);
+ inode->i_mtime = inode_ctime_set_current(inode);
F2FS_I(inode)->last_disk_size = i_size_read(inode);
spin_unlock(&F2FS_I(inode)->i_size_lock);
}
@@ -1850,7 +1850,7 @@ static long f2fs_fallocate(struct file *file, int mode,
}
if (!ret) {
- inode->i_mtime = inode->i_ctime = current_time(inode);
+ inode->i_mtime = inode_ctime_set_current(inode);
f2fs_mark_inode_dirty_sync(inode, false);
f2fs_update_time(F2FS_I_SB(inode), REQ_TIME);
}
@@ -1952,7 +1952,7 @@ static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask)
else
clear_inode_flag(inode, FI_PROJ_INHERIT);
- inode->i_ctime = current_time(inode);
+ inode_ctime_set_current(inode);
f2fs_set_inode_flags(inode);
f2fs_mark_inode_dirty_sync(inode, true);
return 0;
@@ -3077,7 +3077,7 @@ static int f2fs_ioc_setproject(struct inode *inode, __u32 projid)
goto out_unlock;
fi->i_projid = kprojid;
- inode->i_ctime = current_time(inode);
+ inode_ctime_set_current(inode);
f2fs_mark_inode_dirty_sync(inode, true);
out_unlock:
f2fs_unlock_op(sbi);
@@ -3510,7 +3510,7 @@ static int f2fs_release_compress_blocks(struct file *filp, unsigned long arg)
goto out;
set_inode_flag(inode, FI_COMPRESS_RELEASED);
- inode->i_ctime = current_time(inode);
+ inode_ctime_set_current(inode);
f2fs_mark_inode_dirty_sync(inode, true);
if (!atomic_read(&F2FS_I(inode)->i_compr_blocks))
@@ -3712,7 +3712,7 @@ static int f2fs_reserve_compress_blocks(struct file *filp, unsigned long arg)
if (ret >= 0) {
clear_inode_flag(inode, FI_COMPRESS_RELEASED);
- inode->i_ctime = current_time(inode);
+ inode_ctime_set_current(inode);
f2fs_mark_inode_dirty_sync(inode, true);
}
unlock_inode:
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index 4638fee16a91..72bb5340b088 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -698,7 +698,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);
+ dir->i_mtime = inode_ctime_set_current(dir);
f2fs_mark_inode_dirty_sync(dir, false);
if (inode)
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
index 09e986b050c6..95b89e48a159 100644
--- a/fs/f2fs/inode.c
+++ b/fs/f2fs/inode.c
@@ -403,7 +403,7 @@ static void init_idisk_time(struct inode *inode)
struct f2fs_inode_info *fi = F2FS_I(inode);
fi->i_disk_time[0] = inode->i_atime;
- fi->i_disk_time[1] = inode->i_ctime;
+ fi->i_disk_time[1] = inode_ctime_peek(inode);
fi->i_disk_time[2] = inode->i_mtime;
}
@@ -434,10 +434,10 @@ static int do_read_inode(struct inode *inode)
inode->i_blocks = SECTOR_FROM_BLOCK(le64_to_cpu(ri->i_blocks) - 1);
inode->i_atime.tv_sec = le64_to_cpu(ri->i_atime);
- inode->i_ctime.tv_sec = le64_to_cpu(ri->i_ctime);
+ inode_ctime_set_sec(inode, le64_to_cpu(ri->i_ctime));
inode->i_mtime.tv_sec = le64_to_cpu(ri->i_mtime);
inode->i_atime.tv_nsec = le32_to_cpu(ri->i_atime_nsec);
- inode->i_ctime.tv_nsec = le32_to_cpu(ri->i_ctime_nsec);
+ inode_ctime_set_nsec(inode, le32_to_cpu(ri->i_ctime_nsec));
inode->i_mtime.tv_nsec = le32_to_cpu(ri->i_mtime_nsec);
inode->i_generation = le32_to_cpu(ri->i_generation);
if (S_ISDIR(inode->i_mode))
@@ -714,10 +714,10 @@ void f2fs_update_inode(struct inode *inode, struct page *node_page)
set_raw_inline(inode, ri);
ri->i_atime = cpu_to_le64(inode->i_atime.tv_sec);
- ri->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec);
+ ri->i_ctime = cpu_to_le64(inode_ctime_peek(inode).tv_sec);
ri->i_mtime = cpu_to_le64(inode->i_mtime.tv_sec);
ri->i_atime_nsec = cpu_to_le32(inode->i_atime.tv_nsec);
- ri->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec);
+ ri->i_ctime_nsec = cpu_to_le32(inode_ctime_peek(inode).tv_nsec);
ri->i_mtime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec);
if (S_ISDIR(inode->i_mode))
ri->i_current_depth =
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 614c33f0f17e..c7876c5d74a6 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -233,7 +233,7 @@ static struct inode *f2fs_new_inode(struct mnt_idmap *idmap,
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);
F2FS_I(inode)->i_crtime = inode->i_mtime;
inode->i_generation = get_random_u32();
@@ -410,7 +410,7 @@ static int f2fs_link(struct dentry *old_dentry, struct inode *dir,
f2fs_balance_fs(sbi, true);
- inode->i_ctime = current_time(inode);
+ inode_ctime_set_current(inode);
ihold(inode);
set_inode_flag(inode, FI_INC_LINK);
@@ -1042,7 +1042,7 @@ static int f2fs_rename(struct mnt_idmap *idmap, struct inode *old_dir,
f2fs_set_link(new_dir, new_entry, new_page, old_inode);
new_page = NULL;
- new_inode->i_ctime = current_time(new_inode);
+ inode_ctime_set_current(new_inode);
f2fs_down_write(&F2FS_I(new_inode)->i_sem);
if (old_dir_entry)
f2fs_i_links_write(new_inode, false);
@@ -1076,7 +1076,7 @@ static int f2fs_rename(struct mnt_idmap *idmap, struct inode *old_dir,
f2fs_i_pino_write(old_inode, new_dir->i_ino);
f2fs_up_write(&F2FS_I(old_inode)->i_sem);
- old_inode->i_ctime = current_time(old_inode);
+ inode_ctime_set_current(old_inode);
f2fs_mark_inode_dirty_sync(old_inode, false);
f2fs_delete_entry(old_entry, old_page, old_dir, NULL);
@@ -1241,7 +1241,7 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
f2fs_i_pino_write(old_inode, new_dir->i_ino);
f2fs_up_write(&F2FS_I(old_inode)->i_sem);
- old_dir->i_ctime = current_time(old_dir);
+ inode_ctime_set_current(old_dir);
if (old_nlink) {
f2fs_down_write(&F2FS_I(old_dir)->i_sem);
f2fs_i_links_write(old_dir, old_nlink > 0);
@@ -1260,7 +1260,7 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
f2fs_i_pino_write(new_inode, old_dir->i_ino);
f2fs_up_write(&F2FS_I(new_inode)->i_sem);
- new_dir->i_ctime = current_time(new_dir);
+ inode_ctime_set_current(new_dir);
if (new_nlink) {
f2fs_down_write(&F2FS_I(new_dir)->i_sem);
f2fs_i_links_write(new_dir, new_nlink > 0);
diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
index 4e7d4ceeb084..5a06dd15453d 100644
--- a/fs/f2fs/recovery.c
+++ b/fs/f2fs/recovery.c
@@ -321,10 +321,10 @@ static int recover_inode(struct inode *inode, struct page *page)
f2fs_i_size_write(inode, le64_to_cpu(raw->i_size));
inode->i_atime.tv_sec = le64_to_cpu(raw->i_atime);
- inode->i_ctime.tv_sec = le64_to_cpu(raw->i_ctime);
+ inode_ctime_set_sec(inode, le64_to_cpu(raw->i_ctime));
inode->i_mtime.tv_sec = le64_to_cpu(raw->i_mtime);
inode->i_atime.tv_nsec = le32_to_cpu(raw->i_atime_nsec);
- inode->i_ctime.tv_nsec = le32_to_cpu(raw->i_ctime_nsec);
+ inode_ctime_set_nsec(inode, le32_to_cpu(raw->i_ctime_nsec));
inode->i_mtime.tv_nsec = le32_to_cpu(raw->i_mtime_nsec);
F2FS_I(inode)->i_advise = raw->i_advise;
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index bc15841fd33c..3c6bb358a7a3 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -2702,7 +2702,7 @@ static ssize_t f2fs_quota_write(struct super_block *sb, int type,
if (len == towrite)
return err;
- inode->i_mtime = inode->i_ctime = current_time(inode);
+ inode->i_mtime = inode_ctime_set_current(inode);
f2fs_mark_inode_dirty_sync(inode, false);
return len - towrite;
}
diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c
index bdc8a55085a2..9bc685b33f4d 100644
--- a/fs/f2fs/xattr.c
+++ b/fs/f2fs/xattr.c
@@ -749,7 +749,7 @@ static int __f2fs_setxattr(struct inode *inode, int index,
same:
if (is_inode_flag_set(inode, FI_ACL_MODE)) {
inode->i_mode = F2FS_I(inode)->i_acl_mode;
- inode->i_ctime = current_time(inode);
+ inode_ctime_set_current(inode);
clear_inode_flag(inode, FI_ACL_MODE);
}
--
2.41.0
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [f2fs-dev] [PATCH 79/79] fs: rename i_ctime field to __i_ctime
2023-06-21 14:45 [f2fs-dev] [PATCH 00/79] fs: new accessors for inode->i_ctime Jeff Layton
2023-06-21 14:45 ` [f2fs-dev] [PATCH 01/79] fs: add ctime accessors infrastructure Jeff Layton
[not found] ` <20230621144735.55953-1-jlayton@kernel.org>
@ 2023-06-21 14:49 ` Jeff Layton
2023-06-21 19:21 ` [f2fs-dev] [PATCH 00/79] fs: new accessors for inode->i_ctime Steven Rostedt
3 siblings, 0 replies; 16+ messages in thread
From: Jeff Layton @ 2023-06-21 14:49 UTC (permalink / raw)
To: 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, 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
Now that everything in-tree is converted to use the accessor functions,
rename the i_ctime field in the inode to make its accesses more
self-documenting.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
include/linux/fs.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 9afb30606373..2ca46c532b49 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -642,7 +642,7 @@ struct inode {
loff_t i_size;
struct timespec64 i_atime;
struct timespec64 i_mtime;
- struct timespec64 i_ctime;
+ struct timespec64 __i_ctime; /* use inode_ctime_* accessors! */
spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
unsigned short i_bytes;
u8 i_blkbits;
@@ -1485,7 +1485,7 @@ struct timespec64 inode_ctime_set_current(struct inode *inode);
*/
static inline struct timespec64 inode_ctime_peek(const struct inode *inode)
{
- return inode->i_ctime;
+ return inode->__i_ctime;
}
/**
@@ -1497,7 +1497,7 @@ static inline struct timespec64 inode_ctime_peek(const struct inode *inode)
*/
static inline struct timespec64 inode_ctime_set(struct inode *inode, struct timespec64 ts)
{
- inode->i_ctime = ts;
+ inode->__i_ctime = ts;
return ts;
}
@@ -1510,7 +1510,7 @@ static inline struct timespec64 inode_ctime_set(struct inode *inode, struct time
*/
static inline time64_t inode_ctime_set_sec(struct inode *inode, time64_t sec)
{
- inode->i_ctime.tv_sec = sec;
+ inode->__i_ctime.tv_sec = sec;
return sec;
}
@@ -1523,7 +1523,7 @@ static inline time64_t inode_ctime_set_sec(struct inode *inode, time64_t sec)
*/
static inline long inode_ctime_set_nsec(struct inode *inode, long nsec)
{
- inode->i_ctime.tv_nsec = nsec;
+ inode->__i_ctime.tv_nsec = nsec;
return nsec;
}
--
2.41.0
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [f2fs-dev] [PATCH 01/79] fs: add ctime accessors infrastructure
2023-06-21 14:45 ` [f2fs-dev] [PATCH 01/79] fs: add ctime accessors infrastructure Jeff Layton
@ 2023-06-21 16:34 ` Jan Kara
2023-06-21 17:29 ` Tom Talpey
` (2 subsequent siblings)
3 siblings, 0 replies; 16+ messages in thread
From: Jan Kara @ 2023-06-21 16:34 UTC (permalink / raw)
To: Jeff Layton
Cc: Latchesar Ionkov, Rafael J. Wysocki, Darrick J. Wong,
Anders Larsen, Carlos Llamas, Andrii Nakryiko, Hugh Dickins,
John Johansen, Seth Forshee, Alexander Gordeev, Christoph Hellwig,
Mike Marshall, Paulo Alcantara, linux-xfs, Bart Van Assche,
Michael Ellerman, John Keeping, Zhang Yi, James Morris,
Christophe Leroy, Tyler Hicks, Alan Stern, Christian Borntraeger,
devel, Shyam Prasad N, Jan Harkes, linux-um, Nicholas Piggin,
Alexander Viro, Eric Van Hensbergen, Suren Baghdasaryan,
Trond Myklebust, Anton Altaparmakov, Christian Brauner,
Wolfram Sang, Greg Kroah-Hartman, Stephen Smalley, linux-usb,
linux-kernel, Ronnie Sahlberg, Sergey Senozhatsky,
Luis Chamberlain, Chuck Lever, Sven Schnelle, Jiri Olsa, Jan Kara,
Tejun Heo, Andrew Morton, linux-trace-kernel, linux-hardening,
Dave Kleikamp, Sandeep Dhavale, Tetsuo Handa, Mimi Zohar,
linux-mm, Joel Fernandes, Eric Dumazet, Stanislav Fomichev,
Andrzej Pietrasiewicz, Hangyu Hua, linux-s390, linux-nilfs,
Paul Moore, Leon Romanovsky, John Fastabend,
Arve Hjønnevåg, Minghao Chi, codalist, selinux,
ZhangPeng, Udipto Goswami, Yonghong Song, Iurii Zaikin,
Namjae Jeon, Masami Hiramatsu, ecryptfs, Todd Kjos, Vasily Gorbik,
Yu Zhe, linuxppc-dev, reiserfs-devel, Miklos Szeredi, Yue Hu,
Jaegeuk Kim, Aditya Garg, Martijn Coenen, OGAWA Hirofumi, Hao Luo,
Tony Luck, Theodore Ts'o, Nicolas Pitre, linux-ntfs-dev,
Muchun Song, Roberto Sassu, linux-f2fs-devel,
Guilherme G. Piccoli, Jozef Martiniak, Eric Biederman,
Anna Schumaker, xu xin, Brad Warrum, Mike Kravetz, Jingyu Wang,
linux-efi, Dan Carpenter, Martin Brandenburg, Tom Rix,
Alexei Starovoitov, Chris Mason, linux-mtd,
Matthew Wilcox (Oracle), Marc Dionne, linux-afs, Ian Kent,
Naohiro Aota, Daniel Borkmann, Dennis Dalessandro, linux-rdma,
Linyu Yuan, coda, Viacheslav Dubeyko, Ilya Dryomov, Paolo Abeni,
Alexey Dobriyan, Serge E. Hallyn, Jens Axboe, Zeng Jingxiang,
Kees Cook, Arnd Bergmann, autofs, Steven Rostedt, Yifei Liu,
Damien Le Moal, Eric Paris, ceph-devel, Gao Xiang, Jiangshan Yi,
David Howells, linux-nfs, linux-ext4, Song Liu, samba-technical,
Steve French, Jeremy Kerr, netdev, Bob Peterson, linux-fsdevel,
bpf, ntfs3, linux-erofs, David S. Miller, ocfs2-devel,
jfs-discussion, Dominique Martinet, Christian Schoenebeck,
Bob Copeland, KP Singh, Oleg Kanatov, Konstantin Komarov,
Joseph Qi, Yuta Hayama, Andreas Dilger, Mikulas Patocka,
Zhengchao Shao, Chen Zhongjin, Ard Biesheuvel, Anton Ivanov,
Laurent Pinchart, Andreas Gruenbacher, Richard Weinberger,
Mark Fasheh, Stefan Roesch, cluster-devel, Jason Gunthorpe,
Jakub Kicinski, Rik van Riel, Salah Triki, Evgeniy Dushistov,
linux-cifs, Heiko Carstens, apparmor, Josef Bacik,
Liam R. Howlett, Tom Talpey, Hans de Goede, Tigran A. Aivazian,
Dave Chinner, David Sterba, Xiubo Li, Ryusuke Konishi,
Juergen Gross, Johannes Thumshirn, Ritu Agarwal,
Luis de Bethencourt, Martin KaFai Lau, v9fs,
Fabio M. De Francesco, linux-unionfs, Ruihan Li,
linux-security-module, Erez Zadok, Jeffle Xu,
Dr. David Alan Gilbert, Johannes Weiner, Phillip Lougher,
Johannes Berg, Sungjong Seo, David Woodhouse, linux-karma-devel,
linux-btrfs, Joel Becker
On Wed 21-06-23 10:45:06, 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>
Looks good to me. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/inode.c | 16 ++++++++++++++
> include/linux/fs.h | 53 +++++++++++++++++++++++++++++++++++++++++++++-
> 2 files changed, 68 insertions(+), 1 deletion(-)
>
> diff --git a/fs/inode.c b/fs/inode.c
> index d37fad91c8da..c005e7328fbb 100644
> --- a/fs/inode.c
> +++ b/fs/inode.c
> @@ -2499,6 +2499,22 @@ struct timespec64 current_time(struct inode *inode)
> }
> EXPORT_SYMBOL(current_time);
>
> +/**
> + * inode_ctime_set_current - set the ctime to current_time
> + * @inode: inode
> + *
> + * Set the inode->i_ctime to the current value for the inode. Returns
> + * the current value that was assigned to i_ctime.
> + */
> +struct timespec64 inode_ctime_set_current(struct inode *inode)
> +{
> + struct timespec64 now = current_time(inode);
> +
> + inode_set_ctime(inode, now);
> + return now;
> +}
> +EXPORT_SYMBOL(inode_ctime_set_current);
> +
> /**
> * in_group_or_capable - check whether caller is CAP_FSETID privileged
> * @idmap: idmap of the mount @inode was found from
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 6867512907d6..9afb30606373 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -1474,7 +1474,58 @@ static inline bool fsuidgid_has_mapping(struct super_block *sb,
> kgid_has_mapping(fs_userns, kgid);
> }
>
> -extern struct timespec64 current_time(struct inode *inode);
> +struct timespec64 current_time(struct inode *inode);
> +struct timespec64 inode_ctime_set_current(struct inode *inode);
> +
> +/**
> + * 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)
> +{
> + return inode->i_ctime;
> +}
> +
> +/**
> + * inode_ctime_set - set the ctime in the inode to the given value
> + * @inode: inode in which to set the ctime
> + * @ts: timespec value to set the ctime
> + *
> + * Set the ctime in @inode to @ts.
> + */
> +static inline struct timespec64 inode_ctime_set(struct inode *inode, struct timespec64 ts)
> +{
> + inode->i_ctime = ts;
> + return ts;
> +}
> +
> +/**
> + * inode_ctime_set_sec - set only the tv_sec field in the inode ctime
> + * @inode: inode in which to set the ctime
> + * @sec: value to set the tv_sec field
> + *
> + * Set the sec field in the ctime. Returns @sec.
> + */
> +static inline time64_t inode_ctime_set_sec(struct inode *inode, time64_t sec)
> +{
> + inode->i_ctime.tv_sec = sec;
> + return sec;
> +}
> +
> +/**
> + * inode_ctime_set_nsec - set only the tv_nsec field in the inode ctime
> + * @inode: inode in which to set the ctime
> + * @nsec: value to set the tv_nsec field
> + *
> + * Set the nsec field in the ctime. Returns @nsec.
> + */
> +static inline long inode_ctime_set_nsec(struct inode *inode, long nsec)
> +{
> + inode->i_ctime.tv_nsec = nsec;
> + return nsec;
> +}
>
> /*
> * Snapshotting support.
> --
> 2.41.0
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [f2fs-dev] [PATCH 01/79] fs: add ctime accessors infrastructure
2023-06-21 14:45 ` [f2fs-dev] [PATCH 01/79] fs: add ctime accessors infrastructure Jeff Layton
2023-06-21 16:34 ` Jan Kara
@ 2023-06-21 17:29 ` Tom Talpey
2023-06-21 18:01 ` Jeff Layton
2023-06-22 0:46 ` Damien Le Moal
2023-06-30 22:12 ` Luis Chamberlain
3 siblings, 1 reply; 16+ messages in thread
From: Tom Talpey @ 2023-06-21 17:29 UTC (permalink / raw)
To: 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, Luis Chamberlain, Iurii Zaikin, Tony Luck,
Guilherme G. Piccoli, Anders Larsen, Steve French,
Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
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 6/21/2023 10:45 AM, 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>
> ---
> fs/inode.c | 16 ++++++++++++++
> include/linux/fs.h | 53 +++++++++++++++++++++++++++++++++++++++++++++-
> 2 files changed, 68 insertions(+), 1 deletion(-)
>
> diff --git a/fs/inode.c b/fs/inode.c
> index d37fad91c8da..c005e7328fbb 100644
> --- a/fs/inode.c
> +++ b/fs/inode.c
> @@ -2499,6 +2499,22 @@ struct timespec64 current_time(struct inode *inode)
> }
> EXPORT_SYMBOL(current_time);
>
> +/**
> + * inode_ctime_set_current - set the ctime to current_time
> + * @inode: inode
> + *
> + * Set the inode->i_ctime to the current value for the inode. Returns
> + * the current value that was assigned to i_ctime.
> + */
> +struct timespec64 inode_ctime_set_current(struct inode *inode)
> +{
> + struct timespec64 now = current_time(inode);
> +
> + inode_set_ctime(inode, now);
> + return now;
> +}
> +EXPORT_SYMBOL(inode_ctime_set_current);
> +
> /**
> * in_group_or_capable - check whether caller is CAP_FSETID privileged
> * @idmap: idmap of the mount @inode was found from
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 6867512907d6..9afb30606373 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -1474,7 +1474,58 @@ static inline bool fsuidgid_has_mapping(struct super_block *sb,
> kgid_has_mapping(fs_userns, kgid);
> }
>
> -extern struct timespec64 current_time(struct inode *inode);
> +struct timespec64 current_time(struct inode *inode);
> +struct timespec64 inode_ctime_set_current(struct inode *inode);
> +
> +/**
> + * 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)
> +{
> + return inode->i_ctime;
> +}
> +
> +/**
> + * inode_ctime_set - set the ctime in the inode to the given value
> + * @inode: inode in which to set the ctime
> + * @ts: timespec value to set the ctime
> + *
> + * Set the ctime in @inode to @ts.
> + */
> +static inline struct timespec64 inode_ctime_set(struct inode *inode, struct timespec64 ts)
> +{
> + inode->i_ctime = ts;
> + return ts;
> +}
> +
> +/**
> + * inode_ctime_set_sec - set only the tv_sec field in the inode ctime
I'm curious about why you choose to split the tv_sec and tv_nsec
set_ functions. Do any callers not set them both? Wouldn't a
single call enable a more atomic behavior someday?
inode_ctime_set_sec_nsec(struct inode *, time64_t, time64_t)
(or simply initialize a timespec64 and use inode_ctime_spec() )
Tom.
> + * @inode: inode in which to set the ctime
> + * @sec: value to set the tv_sec field
> + *
> + * Set the sec field in the ctime. Returns @sec.
> + */
> +static inline time64_t inode_ctime_set_sec(struct inode *inode, time64_t sec)
> +{
> + inode->i_ctime.tv_sec = sec;
> + return sec;
> +}
> +
> +/**
> + * inode_ctime_set_nsec - set only the tv_nsec field in the inode ctime
> + * @inode: inode in which to set the ctime
> + * @nsec: value to set the tv_nsec field
> + *
> + * Set the nsec field in the ctime. Returns @nsec.
> + */
> +static inline long inode_ctime_set_nsec(struct inode *inode, long nsec)
> +{
> + inode->i_ctime.tv_nsec = nsec;
> + return nsec;
> +}
>
> /*
> * Snapshotting support.
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [f2fs-dev] [PATCH 01/79] fs: add ctime accessors infrastructure
2023-06-21 17:29 ` Tom Talpey
@ 2023-06-21 18:01 ` Jeff Layton
2023-06-21 18:19 ` Tom Talpey
0 siblings, 1 reply; 16+ messages in thread
From: Jeff Layton @ 2023-06-21 18:01 UTC (permalink / raw)
To: Tom Talpey, 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,
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, 2023-06-21 at 13:29 -0400, Tom Talpey wrote:
> On 6/21/2023 10:45 AM, 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>
> > ---
> > fs/inode.c | 16 ++++++++++++++
> > include/linux/fs.h | 53 +++++++++++++++++++++++++++++++++++++++++++++-
> > 2 files changed, 68 insertions(+), 1 deletion(-)
> >
> > diff --git a/fs/inode.c b/fs/inode.c
> > index d37fad91c8da..c005e7328fbb 100644
> > --- a/fs/inode.c
> > +++ b/fs/inode.c
> > @@ -2499,6 +2499,22 @@ struct timespec64 current_time(struct inode *inode)
> > }
> > EXPORT_SYMBOL(current_time);
> >
> > +/**
> > + * inode_ctime_set_current - set the ctime to current_time
> > + * @inode: inode
> > + *
> > + * Set the inode->i_ctime to the current value for the inode. Returns
> > + * the current value that was assigned to i_ctime.
> > + */
> > +struct timespec64 inode_ctime_set_current(struct inode *inode)
> > +{
> > + struct timespec64 now = current_time(inode);
> > +
> > + inode_set_ctime(inode, now);
> > + return now;
> > +}
> > +EXPORT_SYMBOL(inode_ctime_set_current);
> > +
> > /**
> > * in_group_or_capable - check whether caller is CAP_FSETID privileged
> > * @idmap: idmap of the mount @inode was found from
> > diff --git a/include/linux/fs.h b/include/linux/fs.h
> > index 6867512907d6..9afb30606373 100644
> > --- a/include/linux/fs.h
> > +++ b/include/linux/fs.h
> > @@ -1474,7 +1474,58 @@ static inline bool fsuidgid_has_mapping(struct super_block *sb,
> > kgid_has_mapping(fs_userns, kgid);
> > }
> >
> > -extern struct timespec64 current_time(struct inode *inode);
> > +struct timespec64 current_time(struct inode *inode);
> > +struct timespec64 inode_ctime_set_current(struct inode *inode);
> > +
> > +/**
> > + * 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)
> > +{
> > + return inode->i_ctime;
> > +}
> > +
> > +/**
> > + * inode_ctime_set - set the ctime in the inode to the given value
> > + * @inode: inode in which to set the ctime
> > + * @ts: timespec value to set the ctime
> > + *
> > + * Set the ctime in @inode to @ts.
> > + */
> > +static inline struct timespec64 inode_ctime_set(struct inode *inode, struct timespec64 ts)
> > +{
> > + inode->i_ctime = ts;
> > + return ts;
> > +}
> > +
> > +/**
> > + * inode_ctime_set_sec - set only the tv_sec field in the inode ctime
>
> I'm curious about why you choose to split the tv_sec and tv_nsec
> set_ functions. Do any callers not set them both? Wouldn't a
> single call enable a more atomic behavior someday?
>
> inode_ctime_set_sec_nsec(struct inode *, time64_t, time64_t)
>
> (or simply initialize a timespec64 and use inode_ctime_spec() )
>
Yes, quite a few places set the fields individually. For example, when
loading a value from disk that doesn't have sufficient granularity to
set the nsecs field to anything but 0.
Could I have done it by declaring a local timespec64 variable and just
use the inode_ctime_set function in these places? Absolutely.
That's a bit more difficult to handle with coccinelle though. If someone
wants to suggest a way to do that without having to change all of these
call sites manually, then I'm open to redoing the set.
That might be better left for a later cleanup though.
> > + * @inode: inode in which to set the ctime
> > + * @sec: value to set the tv_sec field
> > + *
> > + * Set the sec field in the ctime. Returns @sec.
> > + */
> > +static inline time64_t inode_ctime_set_sec(struct inode *inode, time64_t sec)
> > +{
> > + inode->i_ctime.tv_sec = sec;
> > + return sec;
> > +}
> > +
> > +/**
> > + * inode_ctime_set_nsec - set only the tv_nsec field in the inode ctime
> > + * @inode: inode in which to set the ctime
> > + * @nsec: value to set the tv_nsec field
> > + *
> > + * Set the nsec field in the ctime. Returns @nsec.
> > + */
> > +static inline long inode_ctime_set_nsec(struct inode *inode, long nsec)
> > +{
> > + inode->i_ctime.tv_nsec = nsec;
> > + return nsec;
> > +}
> >
> > /*
> > * Snapshotting support.
--
Jeff Layton <jlayton@kernel.org>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [f2fs-dev] [PATCH 01/79] fs: add ctime accessors infrastructure
2023-06-21 18:01 ` Jeff Layton
@ 2023-06-21 18:19 ` Tom Talpey
2023-06-21 18:48 ` Jeff Layton
0 siblings, 1 reply; 16+ messages in thread
From: Tom Talpey @ 2023-06-21 18:19 UTC (permalink / raw)
To: 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, Luis Chamberlain, Iurii Zaikin, Tony Luck,
Guilherme G. Piccoli, Anders Larsen, Steve French,
Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
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 6/21/2023 2:01 PM, Jeff Layton wrote:
> On Wed, 2023-06-21 at 13:29 -0400, Tom Talpey wrote:
>> On 6/21/2023 10:45 AM, 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>
>>> ---
>>> fs/inode.c | 16 ++++++++++++++
>>> include/linux/fs.h | 53 +++++++++++++++++++++++++++++++++++++++++++++-
>>> 2 files changed, 68 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/fs/inode.c b/fs/inode.c
>>> index d37fad91c8da..c005e7328fbb 100644
>>> --- a/fs/inode.c
>>> +++ b/fs/inode.c
>>> @@ -2499,6 +2499,22 @@ struct timespec64 current_time(struct inode *inode)
>>> }
>>> EXPORT_SYMBOL(current_time);
>>>
>>> +/**
>>> + * inode_ctime_set_current - set the ctime to current_time
>>> + * @inode: inode
>>> + *
>>> + * Set the inode->i_ctime to the current value for the inode. Returns
>>> + * the current value that was assigned to i_ctime.
>>> + */
>>> +struct timespec64 inode_ctime_set_current(struct inode *inode)
>>> +{
>>> + struct timespec64 now = current_time(inode);
>>> +
>>> + inode_set_ctime(inode, now);
>>> + return now;
>>> +}
>>> +EXPORT_SYMBOL(inode_ctime_set_current);
>>> +
>>> /**
>>> * in_group_or_capable - check whether caller is CAP_FSETID privileged
>>> * @idmap: idmap of the mount @inode was found from
>>> diff --git a/include/linux/fs.h b/include/linux/fs.h
>>> index 6867512907d6..9afb30606373 100644
>>> --- a/include/linux/fs.h
>>> +++ b/include/linux/fs.h
>>> @@ -1474,7 +1474,58 @@ static inline bool fsuidgid_has_mapping(struct super_block *sb,
>>> kgid_has_mapping(fs_userns, kgid);
>>> }
>>>
>>> -extern struct timespec64 current_time(struct inode *inode);
>>> +struct timespec64 current_time(struct inode *inode);
>>> +struct timespec64 inode_ctime_set_current(struct inode *inode);
>>> +
>>> +/**
>>> + * 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)
>>> +{
>>> + return inode->i_ctime;
>>> +}
>>> +
>>> +/**
>>> + * inode_ctime_set - set the ctime in the inode to the given value
>>> + * @inode: inode in which to set the ctime
>>> + * @ts: timespec value to set the ctime
>>> + *
>>> + * Set the ctime in @inode to @ts.
>>> + */
>>> +static inline struct timespec64 inode_ctime_set(struct inode *inode, struct timespec64 ts)
>>> +{
>>> + inode->i_ctime = ts;
>>> + return ts;
>>> +}
>>> +
>>> +/**
>>> + * inode_ctime_set_sec - set only the tv_sec field in the inode ctime
>>
>> I'm curious about why you choose to split the tv_sec and tv_nsec
>> set_ functions. Do any callers not set them both? Wouldn't a
>> single call enable a more atomic behavior someday?
>>
>> inode_ctime_set_sec_nsec(struct inode *, time64_t, time64_t)
>>
>> (or simply initialize a timespec64 and use inode_ctime_spec() )
>>
>
> Yes, quite a few places set the fields individually. For example, when
> loading a value from disk that doesn't have sufficient granularity to
> set the nsecs field to anything but 0.
Well, they still need to set the tv_nsec so they could just pass 0.
But ok.
> Could I have done it by declaring a local timespec64 variable and just
> use the inode_ctime_set function in these places? Absolutely.
>
> That's a bit more difficult to handle with coccinelle though. If someone
> wants to suggest a way to do that without having to change all of these
> call sites manually, then I'm open to redoing the set.
>
> That might be better left for a later cleanup though.
Acked-by: Tom Talpey <tom@talpey.com>
>>> + * @inode: inode in which to set the ctime
>>> + * @sec: value to set the tv_sec field
>>> + *
>>> + * Set the sec field in the ctime. Returns @sec.
>>> + */
>>> +static inline time64_t inode_ctime_set_sec(struct inode *inode, time64_t sec)
>>> +{
>>> + inode->i_ctime.tv_sec = sec;
>>> + return sec;
>>> +}
>>> +
>>> +/**
>>> + * inode_ctime_set_nsec - set only the tv_nsec field in the inode ctime
>>> + * @inode: inode in which to set the ctime
>>> + * @nsec: value to set the tv_nsec field
>>> + *
>>> + * Set the nsec field in the ctime. Returns @nsec.
>>> + */
>>> +static inline long inode_ctime_set_nsec(struct inode *inode, long nsec)
>>> +{
>>> + inode->i_ctime.tv_nsec = nsec;
>>> + return nsec;
>>> +}
>>>
>>> /*
>>> * Snapshotting support.
>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [f2fs-dev] [PATCH 01/79] fs: add ctime accessors infrastructure
2023-06-21 18:19 ` Tom Talpey
@ 2023-06-21 18:48 ` Jeff Layton
0 siblings, 0 replies; 16+ messages in thread
From: Jeff Layton @ 2023-06-21 18:48 UTC (permalink / raw)
To: Tom Talpey, 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,
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, 2023-06-21 at 14:19 -0400, Tom Talpey wrote:
> On 6/21/2023 2:01 PM, Jeff Layton wrote:
> > On Wed, 2023-06-21 at 13:29 -0400, Tom Talpey wrote:
> > > On 6/21/2023 10:45 AM, 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>
> > > > ---
> > > > fs/inode.c | 16 ++++++++++++++
> > > > include/linux/fs.h | 53 +++++++++++++++++++++++++++++++++++++++++++++-
> > > > 2 files changed, 68 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/fs/inode.c b/fs/inode.c
> > > > index d37fad91c8da..c005e7328fbb 100644
> > > > --- a/fs/inode.c
> > > > +++ b/fs/inode.c
> > > > @@ -2499,6 +2499,22 @@ struct timespec64 current_time(struct inode *inode)
> > > > }
> > > > EXPORT_SYMBOL(current_time);
> > > >
> > > > +/**
> > > > + * inode_ctime_set_current - set the ctime to current_time
> > > > + * @inode: inode
> > > > + *
> > > > + * Set the inode->i_ctime to the current value for the inode. Returns
> > > > + * the current value that was assigned to i_ctime.
> > > > + */
> > > > +struct timespec64 inode_ctime_set_current(struct inode *inode)
> > > > +{
> > > > + struct timespec64 now = current_time(inode);
> > > > +
> > > > + inode_set_ctime(inode, now);
> > > > + return now;
> > > > +}
> > > > +EXPORT_SYMBOL(inode_ctime_set_current);
> > > > +
> > > > /**
> > > > * in_group_or_capable - check whether caller is CAP_FSETID privileged
> > > > * @idmap: idmap of the mount @inode was found from
> > > > diff --git a/include/linux/fs.h b/include/linux/fs.h
> > > > index 6867512907d6..9afb30606373 100644
> > > > --- a/include/linux/fs.h
> > > > +++ b/include/linux/fs.h
> > > > @@ -1474,7 +1474,58 @@ static inline bool fsuidgid_has_mapping(struct super_block *sb,
> > > > kgid_has_mapping(fs_userns, kgid);
> > > > }
> > > >
> > > > -extern struct timespec64 current_time(struct inode *inode);
> > > > +struct timespec64 current_time(struct inode *inode);
> > > > +struct timespec64 inode_ctime_set_current(struct inode *inode);
> > > > +
> > > > +/**
> > > > + * 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)
> > > > +{
> > > > + return inode->i_ctime;
> > > > +}
> > > > +
> > > > +/**
> > > > + * inode_ctime_set - set the ctime in the inode to the given value
> > > > + * @inode: inode in which to set the ctime
> > > > + * @ts: timespec value to set the ctime
> > > > + *
> > > > + * Set the ctime in @inode to @ts.
> > > > + */
> > > > +static inline struct timespec64 inode_ctime_set(struct inode *inode, struct timespec64 ts)
> > > > +{
> > > > + inode->i_ctime = ts;
> > > > + return ts;
> > > > +}
> > > > +
> > > > +/**
> > > > + * inode_ctime_set_sec - set only the tv_sec field in the inode ctime
> > >
> > > I'm curious about why you choose to split the tv_sec and tv_nsec
> > > set_ functions. Do any callers not set them both? Wouldn't a
> > > single call enable a more atomic behavior someday?
> > >
> > > inode_ctime_set_sec_nsec(struct inode *, time64_t, time64_t)
> > >
> > > (or simply initialize a timespec64 and use inode_ctime_spec() )
> > >
> >
> > Yes, quite a few places set the fields individually. For example, when
> > loading a value from disk that doesn't have sufficient granularity to
> > set the nsecs field to anything but 0.
>
> Well, they still need to set the tv_nsec so they could just pass 0.
> But ok.
>
Sure. The difficulty is in trying to do this in an automated way. For
instance, look at the hfsplus patch; it has separate assignments in
place already:
- result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date));
- result->i_ctime.tv_nsec = 0;
+ inode_ctime_set_sec(result,
+ result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)));
+ inode_ctime_set_nsec(result, 0);
Granted the new code is pretty ugly, but it compiles!
Transforming that into what you're suggesting is a tougher proposition
to do with coccinelle. I didn't see a way to conditionally catch cases
like this, declare a new variable in the appropriate spot and then
transform two assignments (that may not be next to one another!) into a
single one.
Maybe it's possible, but my grasp of SMPL is not that great. The docs
and examples (including Kees' vey helpful ones!) cover fairly simple
changes well, but I didn't quite grasp how to do that complex an
evolution.
> > Could I have done it by declaring a local timespec64 variable and just
> > use the inode_ctime_set function in these places? Absolutely.
> >
> > That's a bit more difficult to handle with coccinelle though. If someone
> > wants to suggest a way to do that without having to change all of these
> > call sites manually, then I'm open to redoing the set.
> >
> > That might be better left for a later cleanup though.
>
> Acked-by: Tom Talpey <tom@talpey.com>
>
Many thanks!
> > > > + * @inode: inode in which to set the ctime
> > > > + * @sec: value to set the tv_sec field
> > > > + *
> > > > + * Set the sec field in the ctime. Returns @sec.
> > > > + */
> > > > +static inline time64_t inode_ctime_set_sec(struct inode *inode, time64_t sec)
> > > > +{
> > > > + inode->i_ctime.tv_sec = sec;
> > > > + return sec;
> > > > +}
> > > > +
> > > > +/**
> > > > + * inode_ctime_set_nsec - set only the tv_nsec field in the inode ctime
> > > > + * @inode: inode in which to set the ctime
> > > > + * @nsec: value to set the tv_nsec field
> > > > + *
> > > > + * Set the nsec field in the ctime. Returns @nsec.
> > > > + */
> > > > +static inline long inode_ctime_set_nsec(struct inode *inode, long nsec)
> > > > +{
> > > > + inode->i_ctime.tv_nsec = nsec;
> > > > + return nsec;
> > > > +}
> > > >
> > > > /*
> > > > * Snapshotting support.
> >
--
Jeff Layton <jlayton@kernel.org>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [f2fs-dev] [PATCH 00/79] fs: new accessors for inode->i_ctime
2023-06-21 14:45 [f2fs-dev] [PATCH 00/79] fs: new accessors for inode->i_ctime Jeff Layton
` (2 preceding siblings ...)
2023-06-21 14:49 ` [f2fs-dev] [PATCH 79/79] fs: rename i_ctime field to __i_ctime Jeff Layton
@ 2023-06-21 19:21 ` Steven Rostedt
2023-06-21 19:52 ` Jeff Layton
2023-06-30 22:11 ` Luis Chamberlain
3 siblings, 2 replies; 16+ messages in thread
From: Steven Rostedt @ 2023-06-21 19:21 UTC (permalink / raw)
To: Jeff Layton
Cc: Latchesar Ionkov, Rafael J. Wysocki, Darrick J. Wong,
Anders Larsen, Carlos Llamas, Andrii Nakryiko, Hugh Dickins,
John Johansen, Seth Forshee, Alexander Gordeev, Christoph Hellwig,
Mike Marshall, Paulo Alcantara, linux-xfs, Bart Van Assche,
Michael Ellerman, John Keeping, Zhang Yi, James Morris,
Christophe Leroy, Tyler Hicks, Alan Stern, Christian Borntraeger,
devel, Shyam Prasad N, Jan Harkes, linux-um, Nicholas Piggin,
Alexander Viro, Eric Van Hensbergen, Suren Baghdasaryan,
Trond Myklebust, Anton Altaparmakov, Christian Brauner,
Wolfram Sang, Greg Kroah-Hartman, Stephen Smalley, linux-usb,
linux-kernel, Ronnie Sahlberg, Sergey Senozhatsky,
Luis Chamberlain, Chuck Lever, Sven Schnelle, Jiri Olsa, Jan Kara,
Tejun Heo, Andrew Morton, linux-trace-kernel, linux-hardening,
Dave Kleikamp, Sandeep Dhavale, Tetsuo Handa, Mimi Zohar,
linux-mm, Joel Fernandes, Eric Dumazet, Stanislav Fomichev,
Andrzej Pietrasiewicz, Hangyu Hua, linux-s390, linux-nilfs,
Paul Moore, Leon Romanovsky, John Fastabend,
Arve Hjønnevåg, Minghao Chi, codalist, selinux,
ZhangPeng, Udipto Goswami, Yonghong Song, Iurii Zaikin,
Namjae Jeon, Masami Hiramatsu, ecryptfs, Todd Kjos, Vasily Gorbik,
Yu Zhe, linuxppc-dev, reiserfs-devel, Miklos Szeredi, Yue Hu,
Jaegeuk Kim, Aditya Garg, Martijn Coenen, OGAWA Hirofumi, Hao Luo,
Tony Luck, Theodore Ts'o, Nicolas Pitre, linux-ntfs-dev,
Muchun Song, Roberto Sassu, linux-f2fs-devel,
Guilherme G. Piccoli, Jozef Martiniak, Eric Biederman,
Anna Schumaker, xu xin, Brad Warrum, Mike Kravetz, Jingyu Wang,
linux-efi, Dan Carpenter, Martin Brandenburg, Tom Rix,
Alexei Starovoitov, Chris Mason, linux-mtd,
Matthew Wilcox (Oracle), Marc Dionne, linux-afs, Ian Kent,
Naohiro Aota, Daniel Borkmann, Dennis Dalessandro, linux-rdma,
Linyu Yuan, coda, Viacheslav Dubeyko, Ilya Dryomov, Paolo Abeni,
Alexey Dobriyan, Serge E. Hallyn, Jens Axboe, Zeng Jingxiang,
Kees Cook, Arnd Bergmann, autofs, Yifei Liu, Damien Le Moal,
Eric Paris, ceph-devel, Gao Xiang, Jiangshan Yi, David Howells,
linux-nfs, linux-ext4, Song Liu, samba-technical, Steve French,
Jeremy Kerr, netdev, Bob Peterson, linux-fsdevel, bpf, ntfs3,
linux-erofs, David S. Miller, ocfs2-devel, jfs-discussion,
Dominique Martinet, Christian Schoenebeck, Bob Copeland, KP Singh,
Oleg Kanatov, Konstantin Komarov, Joseph Qi, Yuta Hayama,
Andreas Dilger, Mikulas Patocka, Zhengchao Shao, Chen Zhongjin,
Ard Biesheuvel, Anton Ivanov, Laurent Pinchart,
Andreas Gruenbacher, Richard Weinberger, Mark Fasheh,
Stefan Roesch, cluster-devel, Jason Gunthorpe, Jakub Kicinski,
Rik van Riel, Salah Triki, Evgeniy Dushistov, linux-cifs,
Heiko Carstens, apparmor, Josef Bacik, Liam R. Howlett,
Tom Talpey, Hans de Goede, Tigran A. Aivazian, Dave Chinner,
David Sterba, Xiubo Li, Ryusuke Konishi, Juergen Gross,
Johannes Thumshirn, Ritu Agarwal, Luis de Bethencourt,
Martin KaFai Lau, v9fs, Fabio M. De Francesco, linux-unionfs,
Ruihan Li, linux-security-module, Erez Zadok, Jeffle Xu,
Dr. David Alan Gilbert, Johannes Weiner, Phillip Lougher,
Johannes Berg, Sungjong Seo, David Woodhouse, linux-karma-devel,
linux-btrfs, Joel Becker
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.
-- Steve
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [f2fs-dev] [PATCH 00/79] fs: new accessors for inode->i_ctime
2023-06-21 19:21 ` [f2fs-dev] [PATCH 00/79] fs: new accessors for inode->i_ctime Steven Rostedt
@ 2023-06-21 19:52 ` Jeff Layton
2023-06-23 12:41 ` Christian Brauner
2023-06-30 22:11 ` Luis Chamberlain
1 sibling, 1 reply; 16+ messages in thread
From: Jeff Layton @ 2023-06-21 19:52 UTC (permalink / raw)
To: Steven Rostedt
Cc: Latchesar Ionkov, Rafael J. Wysocki, Darrick J. Wong,
Anders Larsen, Carlos Llamas, Andrii Nakryiko, Hugh Dickins,
John Johansen, Seth Forshee, Alexander Gordeev, Christoph Hellwig,
Mike Marshall, Paulo Alcantara, linux-xfs, Bart Van Assche,
Michael Ellerman, John Keeping, Zhang Yi, James Morris,
Christophe Leroy, Tyler Hicks, Alan Stern, Christian Borntraeger,
devel, Shyam Prasad N, Jan Harkes, linux-um, Nicholas Piggin,
Alexander Viro, Eric Van Hensbergen, Suren Baghdasaryan,
Trond Myklebust, Anton Altaparmakov, Christian Brauner,
Wolfram Sang, Greg Kroah-Hartman, Stephen Smalley, linux-usb,
linux-kernel, Ronnie Sahlberg, Sergey Senozhatsky,
Luis Chamberlain, Chuck Lever, Sven Schnelle, Jiri Olsa, Jan Kara,
Tejun Heo, Andrew Morton, linux-trace-kernel, linux-hardening,
Dave Kleikamp, Sandeep Dhavale, Tetsuo Handa, Mimi Zohar,
linux-mm, Joel Fernandes, Eric Dumazet, Stanislav Fomichev,
Andrzej Pietrasiewicz, Hangyu Hua, linux-s390, linux-nilfs,
Paul Moore, Leon Romanovsky, John Fastabend,
Arve Hjønnevåg, Minghao Chi, codalist, selinux,
ZhangPeng, Udipto Goswami, Yonghong Song, Iurii Zaikin,
Namjae Jeon, Masami Hiramatsu, ecryptfs, Todd Kjos, Vasily Gorbik,
Yu Zhe, linuxppc-dev, reiserfs-devel, Miklos Szeredi, Yue Hu,
Jaegeuk Kim, Aditya Garg, Martijn Coenen, OGAWA Hirofumi, Hao Luo,
Tony Luck, Theodore Ts'o, Nicolas Pitre, linux-ntfs-dev,
Muchun Song, Roberto Sassu, linux-f2fs-devel,
Guilherme G. Piccoli, Jozef Martiniak, Eric Biederman,
Anna Schumaker, xu xin, Brad Warrum, Mike Kravetz, Jingyu Wang,
linux-efi, Dan Carpenter, Martin Brandenburg, Tom Rix,
Alexei Starovoitov, Chris Mason, linux-mtd,
Matthew Wilcox (Oracle), Marc Dionne, linux-afs, Ian Kent,
Naohiro Aota, Daniel Borkmann, Dennis Dalessandro, linux-rdma,
Linyu Yuan, coda, Viacheslav Dubeyko, Ilya Dryomov, Paolo Abeni,
Alexey Dobriyan, Serge E. Hallyn, Jens Axboe, Zeng Jingxiang,
Kees Cook, Arnd Bergmann, autofs, Yifei Liu, Damien Le Moal,
Eric Paris, ceph-devel, Gao Xiang, Jiangshan Yi, David Howells,
linux-nfs, linux-ext4, Song Liu, samba-technical, Steve French,
Jeremy Kerr, netdev, Bob Peterson, linux-fsdevel, bpf, ntfs3,
linux-erofs, David S. Miller, ocfs2-devel, jfs-discussion,
Dominique Martinet, Christian Schoenebeck, Bob Copeland, KP Singh,
Oleg Kanatov, Konstantin Komarov, Joseph Qi, Yuta Hayama,
Andreas Dilger, Mikulas Patocka, Zhengchao Shao, Chen Zhongjin,
Ard Biesheuvel, Anton Ivanov, Laurent Pinchart,
Andreas Gruenbacher, Richard Weinberger, Mark Fasheh,
Stefan Roesch, cluster-devel, Jason Gunthorpe, Jakub Kicinski,
Rik van Riel, Salah Triki, Evgeniy Dushistov, linux-cifs,
Heiko Carstens, apparmor, Josef Bacik, Liam R. Howlett,
Tom Talpey, Hans de Goede, Tigran A. Aivazian, Dave Chinner,
David Sterba, Xiubo Li, Ryusuke Konishi, Juergen Gross,
Johannes Thumshirn, Ritu Agarwal, Luis de Bethencourt,
Martin KaFai Lau, v9fs, Fabio M. De Francesco, linux-unionfs,
Ruihan Li, linux-security-module, Erez Zadok, Jeffle Xu,
Dr. David Alan Gilbert, Johannes Weiner, Phillip Lougher,
Johannes Berg, Sungjong Seo, David Woodhouse, linux-karma-devel,
linux-btrfs, Joel Becker
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)?
------------------------8<------------------------------
@@
expression inode;
@@
- inode->i_ctime = current_time(inode)
+ inode_set_current_ctime(inode)
@@
expression inode;
@@
- inode->i_ctime = inode->i_mtime = current_time(inode)
+ inode->i_mtime = inode_set_current_ctime(inode)
@@
struct inode *inode;
expression value;
@@
- inode->i_ctime = value;
+ inode_set_ctime(inode, value);
@@
struct inode *inode;
expression val;
@@
- inode->i_ctime.tv_sec = val
+ inode_set_ctime_sec(inode, val)
@@
struct inode *inode;
expression val;
@@
- inode->i_ctime.tv_nsec = val
+ inode_set_ctime_nsec(inode, val)
@@
struct inode *inode;
@@
- inode->i_ctime
+ inode_ctime_peek(inode)
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [f2fs-dev] [PATCH 01/79] fs: add ctime accessors infrastructure
2023-06-21 14:45 ` [f2fs-dev] [PATCH 01/79] fs: add ctime accessors infrastructure Jeff Layton
2023-06-21 16:34 ` Jan Kara
2023-06-21 17:29 ` Tom Talpey
@ 2023-06-22 0:46 ` Damien Le Moal
2023-06-22 10:14 ` Jeff Layton
2023-06-30 22:12 ` Luis Chamberlain
3 siblings, 1 reply; 16+ messages in thread
From: Damien Le Moal @ 2023-06-22 0:46 UTC (permalink / raw)
To: 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, 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 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()
? Also, inode_set_ctime() & inode_get_ctime() may be a little more natural. But
no strong opinion about that though.
--
Damien Le Moal
Western Digital Research
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [f2fs-dev] [PATCH 01/79] fs: add ctime accessors infrastructure
2023-06-22 0:46 ` Damien Le Moal
@ 2023-06-22 10:14 ` Jeff Layton
0 siblings, 0 replies; 16+ 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>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [f2fs-dev] [PATCH 00/79] fs: new accessors for inode->i_ctime
2023-06-21 19:52 ` Jeff Layton
@ 2023-06-23 12:41 ` Christian Brauner
0 siblings, 0 replies; 16+ messages in thread
From: Christian Brauner @ 2023-06-23 12:41 UTC (permalink / raw)
To: Jeff Layton
Cc: Latchesar Ionkov, Rafael J. Wysocki, Darrick J. Wong,
Anders Larsen, Carlos Llamas, Andrii Nakryiko, Hugh Dickins,
John Johansen, Seth Forshee, Alexander Gordeev, Christoph Hellwig,
Mike Marshall, Paulo Alcantara, linux-xfs, Bart Van Assche,
Michael Ellerman, John Keeping, Zhang Yi, James Morris,
Christophe Leroy, Tyler Hicks, Alan Stern, Christian Borntraeger,
devel, Shyam Prasad N, Jan Harkes, linux-um, Nicholas Piggin,
Joel Becker, Eric Van Hensbergen, Suren Baghdasaryan,
Trond Myklebust, Anton Altaparmakov, Wolfram Sang,
Greg Kroah-Hartman, Stephen Smalley, linux-usb, linux-kernel,
Ronnie Sahlberg, Sergey Senozhatsky, Luis Chamberlain,
Chuck Lever, Sven Schnelle, Jiri Olsa, Jan Kara, Tejun Heo,
Andrew Morton, linux-trace-kernel, linux-hardening, Dave Kleikamp,
Sandeep Dhavale, Tetsuo Handa, Mimi Zohar, linux-mm,
Joel Fernandes, Eric Dumazet, Stanislav Fomichev,
Andrzej Pietrasiewicz, Hangyu Hua, linux-s390, linux-nilfs,
Paul Moore, Leon Romanovsky, John Fastabend,
Arve Hjønnevåg, Minghao Chi, codalist, selinux,
ZhangPeng, Udipto Goswami, Yonghong Song, Iurii Zaikin,
Namjae Jeon, Masami Hiramatsu, ecryptfs, Todd Kjos, Vasily Gorbik,
Yu Zhe, linuxppc-dev, reiserfs-devel, Miklos Szeredi, Yue Hu,
Jaegeuk Kim, Aditya Garg, Martijn Coenen, OGAWA Hirofumi, Hao Luo,
Tony Luck, Theodore Ts'o, Nicolas Pitre, linux-ntfs-dev,
Muchun Song, Roberto Sassu, linux-f2fs-devel,
Guilherme G. Piccoli, Jozef Martiniak, Eric Biederman,
Anna Schumaker, xu xin, Brad Warrum, Mike Kravetz, Jingyu Wang,
linux-efi, Dan Carpenter, Martin Brandenburg, Tom Rix,
Alexei Starovoitov, Chris Mason, linux-mtd,
Matthew Wilcox (Oracle), Marc Dionne, linux-afs, Ian Kent,
Naohiro Aota, Daniel Borkmann, Dennis Dalessandro, linux-rdma,
Linyu Yuan, coda, Viacheslav Dubeyko, Ilya Dryomov, Paolo Abeni,
Alexey Dobriyan, Serge E. Hallyn, Jens Axboe, Zeng Jingxiang,
Kees Cook, Arnd Bergmann, autofs, Steven Rostedt, Yifei Liu,
Damien Le Moal, Eric Paris, ceph-devel, Gao Xiang, Jiangshan Yi,
David Howells, linux-nfs, linux-ext4, Song Liu, samba-technical,
Steve French, Jeremy Kerr, netdev, Bob Peterson, linux-fsdevel,
bpf, ntfs3, linux-erofs, David S. Miller, ocfs2-devel,
jfs-discussion, Dominique Martinet, Christian Schoenebeck,
Bob Copeland, KP Singh, Oleg Kanatov, Konstantin Komarov,
Joseph Qi, Yuta Hayama, Andreas Dilger, Mikulas Patocka,
Zhengchao Shao, Chen Zhongjin, Ard Biesheuvel, Anton Ivanov,
Laurent Pinchart, Andreas Gruenbacher, Richard Weinberger,
Mark Fasheh, Stefan Roesch, cluster-devel, Jason Gunthorpe,
Jakub Kicinski, Rik van Riel, Salah Triki, Evgeniy Dushistov,
linux-cifs, Heiko Carstens, apparmor, Josef Bacik,
Liam R. Howlett, Tom Talpey, Hans de Goede, Tigran A. Aivazian,
Dave Chinner, David Sterba, Xiubo Li, Ryusuke Konishi,
Juergen Gross, Johannes Thumshirn, Ritu Agarwal,
Luis de Bethencourt, Martin KaFai Lau, v9fs,
Fabio M. De Francesco, linux-unionfs, Ruihan Li,
linux-security-module, Erez Zadok, Jeffle Xu,
Dr. David Alan Gilbert, Johannes Weiner, Phillip Lougher,
Johannes Berg, Sungjong Seo, David Woodhouse, linux-karma-devel,
linux-btrfs, Alexander Viro
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.
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [f2fs-dev] [PATCH 00/79] fs: new accessors for inode->i_ctime
2023-06-21 19:21 ` [f2fs-dev] [PATCH 00/79] fs: new accessors for inode->i_ctime Steven Rostedt
2023-06-21 19:52 ` Jeff Layton
@ 2023-06-30 22:11 ` Luis Chamberlain
1 sibling, 0 replies; 16+ messages in thread
From: Luis Chamberlain @ 2023-06-30 22:11 UTC (permalink / raw)
To: Steven Rostedt, Julia Lawall, Takashi Iwai
Cc: Latchesar Ionkov, Rafael J. Wysocki, Darrick J. Wong,
Anders Larsen, Carlos Llamas, Hugh Dickins, John Johansen,
Seth Forshee, Alexander Gordeev, Christoph Hellwig, Mike Marshall,
Paulo Alcantara, linux-xfs, Bart Van Assche, Michael Ellerman,
John Keeping, Zhang Yi, James Morris, Christophe Leroy,
Tyler Hicks, Alan Stern, Christian Borntraeger, devel,
Shyam Prasad N, Jan Harkes, linux-um, Nicholas Piggin,
Alexander Viro, Eric Van Hensbergen, Suren Baghdasaryan,
Trond Myklebust, Anton Altaparmakov, Christian Brauner,
Wolfram Sang, Greg Kroah-Hartman, Stephen Smalley, linux-usb,
linux-kernel, Ronnie Sahlberg, Sergey Senozhatsky,
Arve Hjønnevåg, Chuck Lever, Sven Schnelle, Jiri Olsa,
Jan Kara, Tejun Heo, Andrew Morton, linux-trace-kernel,
linux-hardening, Dave Kleikamp, Sandeep Dhavale, Tetsuo Handa,
samba-technical, Mimi Zohar, linux-mm, Joel Fernandes,
Eric Dumazet, Stanislav Fomichev, Andrzej Pietrasiewicz,
Hangyu Hua, linux-s390, linux-nilfs, Paul Moore, Leon Romanovsky,
John Fastabend, Andrii Nakryiko, Minghao Chi, codalist, selinux,
ZhangPeng, Udipto Goswami, Yonghong Song, Iurii Zaikin,
Namjae Jeon, Masami Hiramatsu, ecryptfs, Todd Kjos, Vasily Gorbik,
Yu Zhe, linuxppc-dev, reiserfs-devel, Miklos Szeredi, Yue Hu,
Jaegeuk Kim, Aditya Garg, Martijn Coenen, OGAWA Hirofumi, Hao Luo,
Tony Luck, Theodore Ts'o, Nicolas Pitre, linux-ntfs-dev,
Muchun Song, Roberto Sassu, linux-f2fs-devel,
Guilherme G. Piccoli, Jozef Martiniak, Eric Biederman,
Anna Schumaker, xu xin, Brad Warrum, Mike Kravetz, Jingyu Wang,
linux-efi, Dan Carpenter, Martin Brandenburg, Tom Rix,
Alexei Starovoitov, Chris Mason, linux-mtd,
Matthew Wilcox (Oracle), Marc Dionne, linux-afs, Ian Kent,
Naohiro Aota, Daniel Borkmann, Dennis Dalessandro, linux-rdma,
Linyu Yuan, coda, Viacheslav Dubeyko, Ilya Dryomov, Paolo Abeni,
Alexey Dobriyan, Serge E. Hallyn, Jens Axboe, Zeng Jingxiang,
Kees Cook, Arnd Bergmann, autofs, Yifei Liu, Damien Le Moal,
Eric Paris, ceph-devel, Gao Xiang, Jiangshan Yi, David Howells,
linux-nfs, linux-ext4, Song Liu, Jeff Layton, Steve French,
Jeremy Kerr, netdev, Bob Peterson, linux-fsdevel, bpf, ntfs3,
linux-erofs, David S. Miller, ocfs2-devel, jfs-discussion,
Dominique Martinet, Christian Schoenebeck, Bob Copeland, KP Singh,
Oleg Kanatov, Konstantin Komarov, Joseph Qi, Yuta Hayama,
Andreas Dilger, Mikulas Patocka, Zhengchao Shao, Chen Zhongjin,
Ard Biesheuvel, Anton Ivanov, Laurent Pinchart,
Andreas Gruenbacher, Richard Weinberger, Mark Fasheh,
Stefan Roesch, cluster-devel, Jason Gunthorpe, Jakub Kicinski,
Rik van Riel, Salah Triki, Evgeniy Dushistov, linux-cifs,
Heiko Carstens, apparmor, Josef Bacik, Liam R. Howlett,
Tom Talpey, Hans de Goede, Tigran A. Aivazian, Dave Chinner,
David Sterba, Xiubo Li, Ryusuke Konishi, Juergen Gross,
Johannes Thumshirn, Ritu Agarwal, Luis de Bethencourt,
Martin KaFai Lau, v9fs, Fabio M. De Francesco, linux-unionfs,
Ruihan Li, linux-security-module, Erez Zadok, Jeffle Xu,
Dr. David Alan Gilbert, Johannes Weiner, Phillip Lougher,
Johannes Berg, Sungjong Seo, David Woodhouse, linux-karma-devel,
linux-btrfs, Joel Becker
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
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [f2fs-dev] [PATCH 01/79] fs: add ctime accessors infrastructure
2023-06-21 14:45 ` [f2fs-dev] [PATCH 01/79] fs: add ctime accessors infrastructure Jeff Layton
` (2 preceding siblings ...)
2023-06-22 0:46 ` Damien Le Moal
@ 2023-06-30 22:12 ` Luis Chamberlain
3 siblings, 0 replies; 16+ messages in thread
From: Luis Chamberlain @ 2023-06-30 22:12 UTC (permalink / raw)
To: Jeff Layton
Cc: Latchesar Ionkov, Rafael J. Wysocki, Darrick J. Wong,
Anders Larsen, Carlos Llamas, Hugh Dickins, John Johansen,
Seth Forshee, Alexander Gordeev, Christoph Hellwig, Mike Marshall,
Paulo Alcantara, linux-xfs, Bart Van Assche, Michael Ellerman,
John Keeping, Zhang Yi, James Morris, Christophe Leroy,
Tyler Hicks, Alan Stern, Christian Borntraeger, devel,
Shyam Prasad N, Jan Harkes, linux-um, Nicholas Piggin,
Alexander Viro, Eric Van Hensbergen, Suren Baghdasaryan,
Trond Myklebust, Anton Altaparmakov, Christian Brauner,
Wolfram Sang, Greg Kroah-Hartman, Stephen Smalley, linux-usb,
linux-kernel, Ronnie Sahlberg, Sergey Senozhatsky,
Arve Hjønnevåg, Chuck Lever, Sven Schnelle, Jiri Olsa,
Jan Kara, Tejun Heo, Andrew Morton, linux-trace-kernel,
linux-hardening, Dave Kleikamp, Sandeep Dhavale, Tetsuo Handa,
Mimi Zohar, linux-mm, Joel Fernandes, Eric Dumazet,
Stanislav Fomichev, Andrzej Pietrasiewicz, Hangyu Hua, linux-s390,
linux-nilfs, Paul Moore, Leon Romanovsky, John Fastabend,
Andrii Nakryiko, Minghao Chi, codalist, selinux, ZhangPeng,
Udipto Goswami, Yonghong Song, Iurii Zaikin, Namjae Jeon,
Masami Hiramatsu, ecryptfs, Todd Kjos, Vasily Gorbik, Yu Zhe,
linuxppc-dev, reiserfs-devel, Miklos Szeredi, Yue Hu, Jaegeuk Kim,
Aditya Garg, Martijn Coenen, OGAWA Hirofumi, Hao Luo, Tony Luck,
Theodore Ts'o, Nicolas Pitre, linux-ntfs-dev, Muchun Song,
Roberto Sassu, linux-f2fs-devel, Guilherme G. Piccoli,
Jozef Martiniak, Eric Biederman, Anna Schumaker, xu xin,
Brad Warrum, Mike Kravetz, Jingyu Wang, linux-efi, Dan Carpenter,
Martin Brandenburg, Tom Rix, Alexei Starovoitov, Chris Mason,
linux-mtd, Matthew Wilcox (Oracle), Marc Dionne, linux-afs,
Ian Kent, Naohiro Aota, Daniel Borkmann, Dennis Dalessandro,
linux-rdma, Linyu Yuan, coda, Viacheslav Dubeyko, Ilya Dryomov,
Paolo Abeni, Alexey Dobriyan, Serge E. Hallyn, Jens Axboe,
Zeng Jingxiang, Kees Cook, Arnd Bergmann, autofs, Steven Rostedt,
Yifei Liu, Damien Le Moal, Eric Paris, ceph-devel, Gao Xiang,
Jiangshan Yi, David Howells, linux-nfs, linux-ext4, Song Liu,
samba-technical, Steve French, Jeremy Kerr, netdev, Bob Peterson,
linux-fsdevel, bpf, ntfs3, linux-erofs, David S. Miller,
ocfs2-devel, jfs-discussion, Dominique Martinet,
Christian Schoenebeck, Bob Copeland, KP Singh, Oleg Kanatov,
Konstantin Komarov, Joseph Qi, Yuta Hayama, Andreas Dilger,
Mikulas Patocka, Zhengchao Shao, Chen Zhongjin, Ard Biesheuvel,
Anton Ivanov, Laurent Pinchart, Andreas Gruenbacher,
Richard Weinberger, Mark Fasheh, Stefan Roesch, cluster-devel,
Jason Gunthorpe, Jakub Kicinski, Rik van Riel, Salah Triki,
Evgeniy Dushistov, linux-cifs, Heiko Carstens, apparmor,
Josef Bacik, Liam R. Howlett, Tom Talpey, Hans de Goede,
Tigran A. Aivazian, Dave Chinner, David Sterba, Xiubo Li,
Ryusuke Konishi, Juergen Gross, Johannes Thumshirn, Ritu Agarwal,
Luis de Bethencourt, Martin KaFai Lau, v9fs,
Fabio M. De Francesco, linux-unionfs, Ruihan Li,
linux-security-module, Erez Zadok, Jeffle Xu,
Dr. David Alan Gilbert, Johannes Weiner, Phillip Lougher,
Johannes Berg, Sungjong Seo, David Woodhouse, linux-karma-devel,
linux-btrfs, Joel Becker
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
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2023-06-30 22:16 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-21 14:45 [f2fs-dev] [PATCH 00/79] fs: new accessors for inode->i_ctime Jeff Layton
2023-06-21 14:45 ` [f2fs-dev] [PATCH 01/79] fs: add ctime accessors infrastructure Jeff Layton
2023-06-21 16:34 ` Jan Kara
2023-06-21 17:29 ` Tom Talpey
2023-06-21 18:01 ` Jeff Layton
2023-06-21 18:19 ` Tom Talpey
2023-06-21 18:48 ` Jeff Layton
2023-06-22 0:46 ` Damien Le Moal
2023-06-22 10:14 ` Jeff Layton
2023-06-30 22:12 ` Luis Chamberlain
[not found] ` <20230621144735.55953-1-jlayton@kernel.org>
2023-06-21 14:45 ` [f2fs-dev] [PATCH 30/79] f2fs: switch to new ctime accessors Jeff Layton
2023-06-21 14:49 ` [f2fs-dev] [PATCH 79/79] fs: rename i_ctime field to __i_ctime Jeff Layton
2023-06-21 19:21 ` [f2fs-dev] [PATCH 00/79] fs: new accessors for inode->i_ctime Steven Rostedt
2023-06-21 19:52 ` Jeff Layton
2023-06-23 12:41 ` Christian Brauner
2023-06-30 22:11 ` Luis Chamberlain
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).