diff for duplicates of <20220211213628.GA1919658@xavier-xps> diff --git a/a/1.txt b/N1/1.txt index 963da44..5519925 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -2,34 +2,47 @@ Various filesystems (including ext4) now support file creation time. This patch adds such support for tmpfs-based filesystems. Signed-off-by: Xavier Roche <xavier.roche@algolia.com> +Signed-off-by: Hugh Dickins <hughd@google.com> +Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Tested-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Jean Delvare <jdelvare@suse.de> +Cc: Xavier Roche <xavier.roche@algolia.com> +Cc: Jean Delvare <jdelvare@suse.de> --- include/linux/shmem_fs.h | 1 + mm/shmem.c | 11 +++++++++++ 2 files changed, 12 insertions(+) -diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h -index e65b80ed09e7..29787767c3b9 100644 ---- a/include/linux/shmem_fs.h -+++ b/include/linux/shmem_fs.h -@@ -25,6 +25,7 @@ struct shmem_inode_info { +Index: linux/include/linux/shmem_fs.h +=================================================================== +--- linux.orig/include/linux/shmem_fs.h ++++ linux/include/linux/shmem_fs.h +@@ -24,6 +24,7 @@ struct shmem_inode_info { + struct shared_policy policy; /* NUMA memory alloc policy */ struct simple_xattrs xattrs; /* list of xattrs */ atomic_t stop_eviction; /* hold when working on inode */ - struct inode vfs_inode; + struct timespec64 i_crtime; /* file creation time */ + struct inode vfs_inode; }; - struct shmem_sb_info { -diff --git a/mm/shmem.c b/mm/shmem.c -index a09b29ec2b45..5a3907712c4f 100644 ---- a/mm/shmem.c -+++ b/mm/shmem.c -@@ -1061,6 +1061,12 @@ static int shmem_getattr(struct user_namespace *mnt_userns, +Index: linux/mm/shmem.c +=================================================================== +--- linux.orig/mm/shmem.c ++++ linux/mm/shmem.c +@@ -476,6 +476,8 @@ bool shmem_is_huge(struct vm_area_struct + { + loff_t i_size; + ++ if (!S_ISREG(inode->i_mode)) ++ return false; + if (shmem_huge == SHMEM_HUGE_DENY) + return false; + if (vma && ((vma->vm_flags & VM_NOHUGEPAGE) || +@@ -1061,6 +1063,12 @@ static int shmem_getattr(struct user_nam if (shmem_is_huge(NULL, inode, 0)) stat->blksize = HPAGE_PMD_SIZE; -+ if ((request_mask & STATX_BTIME)) { ++ if (request_mask & STATX_BTIME) { + stat->result_mask |= STATX_BTIME; + stat->btime.tv_sec = info->i_crtime.tv_sec; + stat->btime.tv_nsec = info->i_crtime.tv_nsec; @@ -38,7 +51,17 @@ index a09b29ec2b45..5a3907712c4f 100644 return 0; } -@@ -2265,6 +2271,7 @@ static struct inode *shmem_get_inode(struct super_block *sb, const struct inode +@@ -1854,9 +1862,6 @@ repeat: + return 0; + } + +- /* Never use a huge page for shmem_symlink() */ +- if (S_ISLNK(inode->i_mode)) +- goto alloc_nohuge; + if (!shmem_is_huge(vma, inode, index)) + goto alloc_nohuge; + +@@ -2265,6 +2270,7 @@ static struct inode *shmem_get_inode(str atomic_set(&info->stop_eviction, 0); info->seals = F_SEAL_SEAL; info->flags = flags & VM_NORESERVE; @@ -46,7 +69,7 @@ index a09b29ec2b45..5a3907712c4f 100644 INIT_LIST_HEAD(&info->shrinklist); INIT_LIST_HEAD(&info->swaplist); simple_xattrs_init(&info->xattrs); -@@ -3196,6 +3203,7 @@ static ssize_t shmem_listxattr(struct dentry *dentry, char *buffer, size_t size) +@@ -3196,6 +3202,7 @@ static ssize_t shmem_listxattr(struct de #endif /* CONFIG_TMPFS_XATTR */ static const struct inode_operations shmem_short_symlink_operations = { @@ -54,7 +77,7 @@ index a09b29ec2b45..5a3907712c4f 100644 .get_link = simple_get_link, #ifdef CONFIG_TMPFS_XATTR .listxattr = shmem_listxattr, -@@ -3203,6 +3211,7 @@ static const struct inode_operations shmem_short_symlink_operations = { +@@ -3203,6 +3210,7 @@ static const struct inode_operations shm }; static const struct inode_operations shmem_symlink_inode_operations = { @@ -62,7 +85,7 @@ index a09b29ec2b45..5a3907712c4f 100644 .get_link = shmem_get_link, #ifdef CONFIG_TMPFS_XATTR .listxattr = shmem_listxattr, -@@ -3790,6 +3799,7 @@ static const struct inode_operations shmem_inode_operations = { +@@ -3790,6 +3798,7 @@ static const struct inode_operations shm static const struct inode_operations shmem_dir_inode_operations = { #ifdef CONFIG_TMPFS @@ -70,7 +93,7 @@ index a09b29ec2b45..5a3907712c4f 100644 .create = shmem_create, .lookup = simple_lookup, .link = shmem_link, -@@ -3811,6 +3821,7 @@ static const struct inode_operations shmem_dir_inode_operations = { +@@ -3811,6 +3820,7 @@ static const struct inode_operations shm }; static const struct inode_operations shmem_special_inode_operations = { @@ -78,5 +101,3 @@ index a09b29ec2b45..5a3907712c4f 100644 #ifdef CONFIG_TMPFS_XATTR .listxattr = shmem_listxattr, #endif --- -2.25.1 diff --git a/a/content_digest b/N1/content_digest index fde00dd..8d81852 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,8 +1,9 @@ "From\0Xavier Roche <xavier.roche@algolia.com>\0" - "Subject\0[PATCH v2] tmpfs: support for file creation time\0" - "Date\0Fri, 11 Feb 2022 22:36:28 +0100\0" - "To\0linux-kernel@vger.kernel.org\0" - "Cc\0Hugh Dickins <hughd@google.com>" + "Subject\0[PATCH v3] tmpfs: support for file creation time\0" + "Date\0Mon, 28 Feb 2022 09:43:01 +0100\0" + "To\0torvalds@linux-foundation.org\0" + "Cc\0linux-kernel@vger.kernel.org" + Hugh Dickins <hughd@google.com> Andrew Morton <akpm@linux-foundation.org> Jean Delvare <jdelvare@suse.de> Xavier Roche <xavier.roche@algolia.com> @@ -13,34 +14,47 @@ "This patch adds such support for tmpfs-based filesystems.\n" "\n" "Signed-off-by: Xavier Roche <xavier.roche@algolia.com>\n" + "Signed-off-by: Hugh Dickins <hughd@google.com>\n" + "Signed-off-by: Andrew Morton <akpm@linux-foundation.org>\n" "Tested-by: Jean Delvare <jdelvare@suse.de>\n" "Reviewed-by: Jean Delvare <jdelvare@suse.de>\n" + "Cc: Xavier Roche <xavier.roche@algolia.com>\n" + "Cc: Jean Delvare <jdelvare@suse.de>\n" "---\n" " include/linux/shmem_fs.h | 1 +\n" " mm/shmem.c | 11 +++++++++++\n" " 2 files changed, 12 insertions(+)\n" "\n" - "diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h\n" - "index e65b80ed09e7..29787767c3b9 100644\n" - "--- a/include/linux/shmem_fs.h\n" - "+++ b/include/linux/shmem_fs.h\n" - "@@ -25,6 +25,7 @@ struct shmem_inode_info {\n" + "Index: linux/include/linux/shmem_fs.h\n" + "===================================================================\n" + "--- linux.orig/include/linux/shmem_fs.h\n" + "+++ linux/include/linux/shmem_fs.h\n" + "@@ -24,6 +24,7 @@ struct shmem_inode_info {\n" + " \tstruct shared_policy\tpolicy;\t\t/* NUMA memory alloc policy */\n" " \tstruct simple_xattrs\txattrs;\t\t/* list of xattrs */\n" " \tatomic_t\t\tstop_eviction;\t/* hold when working on inode */\n" - " \tstruct inode\t\tvfs_inode;\n" "+\tstruct timespec64\ti_crtime;\t/* file creation time */\n" + " \tstruct inode\t\tvfs_inode;\n" " };\n" " \n" - " struct shmem_sb_info {\n" - "diff --git a/mm/shmem.c b/mm/shmem.c\n" - "index a09b29ec2b45..5a3907712c4f 100644\n" - "--- a/mm/shmem.c\n" - "+++ b/mm/shmem.c\n" - "@@ -1061,6 +1061,12 @@ static int shmem_getattr(struct user_namespace *mnt_userns,\n" + "Index: linux/mm/shmem.c\n" + "===================================================================\n" + "--- linux.orig/mm/shmem.c\n" + "+++ linux/mm/shmem.c\n" + "@@ -476,6 +476,8 @@ bool shmem_is_huge(struct vm_area_struct\n" + " {\n" + " \tloff_t i_size;\n" + " \n" + "+\tif (!S_ISREG(inode->i_mode))\n" + "+\t\treturn false;\n" + " \tif (shmem_huge == SHMEM_HUGE_DENY)\n" + " \t\treturn false;\n" + " \tif (vma && ((vma->vm_flags & VM_NOHUGEPAGE) ||\n" + "@@ -1061,6 +1063,12 @@ static int shmem_getattr(struct user_nam\n" " \tif (shmem_is_huge(NULL, inode, 0))\n" " \t\tstat->blksize = HPAGE_PMD_SIZE;\n" " \n" - "+\tif ((request_mask & STATX_BTIME)) {\n" + "+\tif (request_mask & STATX_BTIME) {\n" "+\t\tstat->result_mask |= STATX_BTIME;\n" "+\t\tstat->btime.tv_sec = info->i_crtime.tv_sec;\n" "+\t\tstat->btime.tv_nsec = info->i_crtime.tv_nsec;\n" @@ -49,7 +63,17 @@ " \treturn 0;\n" " }\n" " \n" - "@@ -2265,6 +2271,7 @@ static struct inode *shmem_get_inode(struct super_block *sb, const struct inode\n" + "@@ -1854,9 +1862,6 @@ repeat:\n" + " \t\treturn 0;\n" + " \t}\n" + " \n" + "-\t/* Never use a huge page for shmem_symlink() */\n" + "-\tif (S_ISLNK(inode->i_mode))\n" + "-\t\tgoto alloc_nohuge;\n" + " \tif (!shmem_is_huge(vma, inode, index))\n" + " \t\tgoto alloc_nohuge;\n" + " \n" + "@@ -2265,6 +2270,7 @@ static struct inode *shmem_get_inode(str\n" " \t\tatomic_set(&info->stop_eviction, 0);\n" " \t\tinfo->seals = F_SEAL_SEAL;\n" " \t\tinfo->flags = flags & VM_NORESERVE;\n" @@ -57,7 +81,7 @@ " \t\tINIT_LIST_HEAD(&info->shrinklist);\n" " \t\tINIT_LIST_HEAD(&info->swaplist);\n" " \t\tsimple_xattrs_init(&info->xattrs);\n" - "@@ -3196,6 +3203,7 @@ static ssize_t shmem_listxattr(struct dentry *dentry, char *buffer, size_t size)\n" + "@@ -3196,6 +3202,7 @@ static ssize_t shmem_listxattr(struct de\n" " #endif /* CONFIG_TMPFS_XATTR */\n" " \n" " static const struct inode_operations shmem_short_symlink_operations = {\n" @@ -65,7 +89,7 @@ " \t.get_link\t= simple_get_link,\n" " #ifdef CONFIG_TMPFS_XATTR\n" " \t.listxattr\t= shmem_listxattr,\n" - "@@ -3203,6 +3211,7 @@ static const struct inode_operations shmem_short_symlink_operations = {\n" + "@@ -3203,6 +3210,7 @@ static const struct inode_operations shm\n" " };\n" " \n" " static const struct inode_operations shmem_symlink_inode_operations = {\n" @@ -73,7 +97,7 @@ " \t.get_link\t= shmem_get_link,\n" " #ifdef CONFIG_TMPFS_XATTR\n" " \t.listxattr\t= shmem_listxattr,\n" - "@@ -3790,6 +3799,7 @@ static const struct inode_operations shmem_inode_operations = {\n" + "@@ -3790,6 +3798,7 @@ static const struct inode_operations shm\n" " \n" " static const struct inode_operations shmem_dir_inode_operations = {\n" " #ifdef CONFIG_TMPFS\n" @@ -81,15 +105,13 @@ " \t.create\t\t= shmem_create,\n" " \t.lookup\t\t= simple_lookup,\n" " \t.link\t\t= shmem_link,\n" - "@@ -3811,6 +3821,7 @@ static const struct inode_operations shmem_dir_inode_operations = {\n" + "@@ -3811,6 +3820,7 @@ static const struct inode_operations shm\n" " };\n" " \n" " static const struct inode_operations shmem_special_inode_operations = {\n" "+\t.getattr\t= shmem_getattr,\n" " #ifdef CONFIG_TMPFS_XATTR\n" " \t.listxattr\t= shmem_listxattr,\n" - " #endif\n" - "-- \n" - 2.25.1 + #endif -0689d7c6a14f0d587c72d871b6ec4df6ddeb286777644e2ef343daec58379da6 +76f50ece664af43b0d02bc9a7a3e43b4ebda98053a20a048f6744a6fb4f0bcfd
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox