From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A5A6E7AD42 for ; Tue, 3 Oct 2023 13:20:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C24F28D0073; Tue, 3 Oct 2023 09:20:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BD50A8D0003; Tue, 3 Oct 2023 09:20:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A75BA8D0073; Tue, 3 Oct 2023 09:20:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 96C698D0003 for ; Tue, 3 Oct 2023 09:20:33 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 5D77340300 for ; Tue, 3 Oct 2023 13:20:33 +0000 (UTC) X-FDA: 81304209546.05.A0628FA Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf23.hostedemail.com (Postfix) with ESMTP id C7654140018 for ; Tue, 3 Oct 2023 13:20:23 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=LX7yAnk1; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=AMJn+HCP; dmarc=none; spf=pass (imf23.hostedemail.com: domain of jack@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=jack@suse.cz ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1696339224; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=xl5gigzuD0h4X4xgTTFSoyDOAJ3zte6LU/Pt2TNQDWg=; b=1fbkbKeTclENLlJIOH8wws4hhWeQsi0g1Hf0AXHlwi6QkXrnjOsJJLTZT6mCX5/RYyyxIN fvW1tHYbUizhVuFub8Q5y9vwVGiIlSptrP5KYq73BQTkvhpz353xl5b4ERRUjIPbxBAq5t A7alIpxxm6hKYOGIVzMZDZl7meZ2azQ= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=LX7yAnk1; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=AMJn+HCP; dmarc=none; spf=pass (imf23.hostedemail.com: domain of jack@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=jack@suse.cz ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696339224; a=rsa-sha256; cv=none; b=B6ZDawETy2ZAPNpUClAfinpwrJPr0vFv1zv4pBmCyGuwsrd4rhwxcz0eXFvbzg5A+1srnP zqpHtY1oz8XNJhDtjOFGLYhcnk2pRszuZdSEjFbuIWeClAFLCICSPyG+Mg04wLTZRkECQJ jYlnlFcGt0jBH0Yck7juROLrpNmSxmo= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 72B761F45B; Tue, 3 Oct 2023 13:20:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1696339222; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xl5gigzuD0h4X4xgTTFSoyDOAJ3zte6LU/Pt2TNQDWg=; b=LX7yAnk1oFogEakJ4UHCjeq0tRQkgtClQkAz2L218mA4W5MaFHK5++w73biAtN7mLUZLQh H1G5Y8oJuNw+5BiS5tbhhHMLlntTaxDJFDcF0bjuDxeQQ6+XufPpBK6qi9Ei/uKKPGoJKa c4hhc3YhvPPAQ1B8qlIoIoVldkZcA7Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1696339222; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xl5gigzuD0h4X4xgTTFSoyDOAJ3zte6LU/Pt2TNQDWg=; b=AMJn+HCPklbH3ujzNdvTB6dcLMkRthFI+c3eRtyAOoRXDNzqOrANM7D0QYVcUCtDmAGzAk sBOIgKQk37IlsoDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 627A5132D4; Tue, 3 Oct 2023 13:20:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 65EJGBYVHGXMNAAAMHmgww (envelope-from ); Tue, 03 Oct 2023 13:20:22 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id E8C1CA07CC; Tue, 3 Oct 2023 15:20:21 +0200 (CEST) Date: Tue, 3 Oct 2023 15:20:21 +0200 From: Jan Kara To: Hugh Dickins Cc: Andrew Morton , Christian Brauner , Carlos Maiolino , Chuck Lever , Jan Kara , Matthew Wilcox , Johannes Weiner , Axel Rasmussen , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 4/8] shmem: trivial tidyups, removing extra blank lines, etc Message-ID: <20231003132021.3l3xe2wjtatwoell@quack3> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: C7654140018 X-Stat-Signature: uoraqsiz9cp73ud1wr5pq7q31n7s5yrt X-HE-Tag: 1696339223-29030 X-HE-Meta: U2FsdGVkX1+V17P/HpBK2AHc071tQT4NEzN3ID8GQu9SDq56Q4rldYQG6Ryo7mnPqq+04miAiteG4JSsy/2UWbc7NmHvvTjKDVlD44QKpivsU8TB4zoviqetB1YiPumLwAYanYLEwL+7vfv6HDZpJB1Xh/rh2a2qBTiLWIuPLO3/BCL0qBMI6VesLjyMPuncTTF1R1HyDoClC7VZGg3it5gKUvLgYsGi+b/pueB8E3EZKkeQXuP6ueFrQZScFllNzhC1092ku8SpDgBZCXxdpzzRUitc0AQe72g9rBgKIA24rhyA1dt076QUmrEipKg+0rV9RtZSr3aCjbVNtMcprgAJF/+X3ZS49TPvbjsWfWQG5jDqdkeamszGbHBKrUR7P/az7501y/Sn+q2ogcfIzDGbLajbqoCYh1MQaE7jTVQGSxbCP0JEu/aSTVS0d6iFZ8b85v0GemjKX5UiM21vJTHjIjvoVFu5XD+Sn2wEpS1kTuSrEw8vKx1fO2yhq2lLMHR7r5IzKFIi2RPWg19SSUHk0JVuPKhd6YbdU2oWUke+Uhx+rPQ7xxHXnJNhCyGqe+W332hjl3t+KO0UCzEUZgJAILblHEFlrBTysR7QwxTvTOTabpTUs0Dkbpf78/1a1B2o2nTaJGV0+lABaw41K8MpeKvlhlDkV1L1qFbQl1PKcq8oQCQeOE8R+im+2j0d1RdaSBwD5Y2BHf8SDaaC6OHvrkJmRurlj7vc57zHQWAzpjHcP9aavUIdUgoI2BfZUuAPNz3/2TB6AVwAgfIK2GHSdgnnn+7tmG5R9BIVCiF/O3y2MqCIeeE/gCN8gZ75AOlLEJyXHLxRu7CsEJHlKoLeGrHeekcRPWVpkJyD6Gr1fZtuJgxVl/RGdWONRVTHqdBoASex/kobSrBVuYoNeu3cYItgtSidLxIYjua6gn4Wx79J/gVXkXTrHO802NaPf1wuiIolB2iLM0iMDZx Vg3+5zd1 CJ9D1Qx0jItmFT5FW7qYbCb6TzKX4y5AVlFWyCHa5LBVMmM97zj3SoR55rJU1tBjo172R7FRL+/u4OCjTnYwLLZK7TJP1lu1XQTqZ/0a1BDIGGgeSzs7Wvk2Puz/Hbpcn3x5Ds7UaVaSYPKD+3V6sj7Zm0/QYbZO3mu7lHjYl4m8w7W0Puf1QFsSxhb+uxvUOZYwwbQhZwI1POBlD96s7v5A7QTt9fiuclN2vKOZb/FWW9EIds6uOpbUZ+nOXAmrmbJjUSJA+X9G672eT1CFM5KwUAQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri 29-09-23 20:28:50, Hugh Dickins wrote: > Mostly removing a few superfluous blank lines, joining short arglines, > imposing some 80-column observance, correcting a couple of comments. > None of it more interesting than deleting a repeated INIT_LIST_HEAD(). > > Signed-off-by: Hugh Dickins Autumn cleaning ;). Feel free to add: Reviewed-by: Jan Kara Honza > --- > mm/shmem.c | 56 ++++++++++++++++++++---------------------------------- > 1 file changed, 21 insertions(+), 35 deletions(-) > > diff --git a/mm/shmem.c b/mm/shmem.c > index 5501a5bc8d8c..caee8ba841f7 100644 > --- a/mm/shmem.c > +++ b/mm/shmem.c > @@ -756,7 +756,7 @@ static unsigned long shmem_unused_huge_shrink(struct shmem_sb_info *sbinfo, > #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ > > /* > - * Like filemap_add_folio, but error if expected item has gone. > + * Somewhat like filemap_add_folio, but error if expected item has gone. > */ > static int shmem_add_to_page_cache(struct folio *folio, > struct address_space *mapping, > @@ -825,7 +825,7 @@ static int shmem_add_to_page_cache(struct folio *folio, > } > > /* > - * Like delete_from_page_cache, but substitutes swap for @folio. > + * Somewhat like filemap_remove_folio, but substitutes swap for @folio. > */ > static void shmem_delete_from_page_cache(struct folio *folio, void *radswap) > { > @@ -887,7 +887,6 @@ unsigned long shmem_partial_swap_usage(struct address_space *mapping, > cond_resched_rcu(); > } > } > - > rcu_read_unlock(); > > return swapped << PAGE_SHIFT; > @@ -1213,7 +1212,6 @@ static int shmem_setattr(struct mnt_idmap *idmap, > if (i_uid_needs_update(idmap, attr, inode) || > i_gid_needs_update(idmap, attr, inode)) { > error = dquot_transfer(idmap, inode, attr); > - > if (error) > return error; > } > @@ -2456,7 +2454,6 @@ static struct inode *__shmem_get_inode(struct mnt_idmap *idmap, > if (err) > return ERR_PTR(err); > > - > inode = new_inode(sb); > if (!inode) { > shmem_free_inode(sb, 0); > @@ -2481,11 +2478,10 @@ static struct inode *__shmem_get_inode(struct mnt_idmap *idmap, > shmem_set_inode_flags(inode, info->fsflags); > INIT_LIST_HEAD(&info->shrinklist); > INIT_LIST_HEAD(&info->swaplist); > - INIT_LIST_HEAD(&info->swaplist); > - if (sbinfo->noswap) > - mapping_set_unevictable(inode->i_mapping); > simple_xattrs_init(&info->xattrs); > cache_no_acl(inode); > + if (sbinfo->noswap) > + mapping_set_unevictable(inode->i_mapping); > mapping_set_large_folios(inode->i_mapping); > > switch (mode & S_IFMT) { > @@ -2697,7 +2693,6 @@ shmem_write_begin(struct file *file, struct address_space *mapping, > } > > ret = shmem_get_folio(inode, index, &folio, SGP_WRITE); > - > if (ret) > return ret; > > @@ -3229,8 +3224,7 @@ shmem_mknod(struct mnt_idmap *idmap, struct inode *dir, > error = simple_acl_create(dir, inode); > if (error) > goto out_iput; > - error = security_inode_init_security(inode, dir, > - &dentry->d_name, > + error = security_inode_init_security(inode, dir, &dentry->d_name, > shmem_initxattrs, NULL); > if (error && error != -EOPNOTSUPP) > goto out_iput; > @@ -3259,14 +3253,11 @@ shmem_tmpfile(struct mnt_idmap *idmap, struct inode *dir, > int error; > > inode = shmem_get_inode(idmap, dir->i_sb, dir, mode, 0, VM_NORESERVE); > - > if (IS_ERR(inode)) { > error = PTR_ERR(inode); > goto err_out; > } > - > - error = security_inode_init_security(inode, dir, > - NULL, > + error = security_inode_init_security(inode, dir, NULL, > shmem_initxattrs, NULL); > if (error && error != -EOPNOTSUPP) > goto out_iput; > @@ -3303,7 +3294,8 @@ static int shmem_create(struct mnt_idmap *idmap, struct inode *dir, > /* > * Link a file.. > */ > -static int shmem_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) > +static int shmem_link(struct dentry *old_dentry, struct inode *dir, > + struct dentry *dentry) > { > struct inode *inode = d_inode(old_dentry); > int ret = 0; > @@ -3334,7 +3326,7 @@ static int shmem_link(struct dentry *old_dentry, struct inode *dir, struct dentr > inode_inc_iversion(dir); > inc_nlink(inode); > ihold(inode); /* New dentry reference */ > - dget(dentry); /* Extra pinning count for the created dentry */ > + dget(dentry); /* Extra pinning count for the created dentry */ > d_instantiate(dentry, inode); > out: > return ret; > @@ -3354,7 +3346,7 @@ static int shmem_unlink(struct inode *dir, struct dentry *dentry) > inode_set_ctime_current(inode)); > inode_inc_iversion(dir); > drop_nlink(inode); > - dput(dentry); /* Undo the count from "create" - this does all the work */ > + dput(dentry); /* Undo the count from "create" - does all the work */ > return 0; > } > > @@ -3464,7 +3456,6 @@ static int shmem_symlink(struct mnt_idmap *idmap, struct inode *dir, > > inode = shmem_get_inode(idmap, dir->i_sb, dir, S_IFLNK | 0777, 0, > VM_NORESERVE); > - > if (IS_ERR(inode)) > return PTR_ERR(inode); > > @@ -3518,8 +3509,7 @@ static void shmem_put_link(void *arg) > folio_put(arg); > } > > -static const char *shmem_get_link(struct dentry *dentry, > - struct inode *inode, > +static const char *shmem_get_link(struct dentry *dentry, struct inode *inode, > struct delayed_call *done) > { > struct folio *folio = NULL; > @@ -3593,8 +3583,7 @@ static int shmem_fileattr_set(struct mnt_idmap *idmap, > * Callback for security_inode_init_security() for acquiring xattrs. > */ > static int shmem_initxattrs(struct inode *inode, > - const struct xattr *xattr_array, > - void *fs_info) > + const struct xattr *xattr_array, void *fs_info) > { > struct shmem_inode_info *info = SHMEM_I(inode); > struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb); > @@ -3778,7 +3767,6 @@ static struct dentry *shmem_find_alias(struct inode *inode) > return alias ?: d_find_any_alias(inode); > } > > - > static struct dentry *shmem_fh_to_dentry(struct super_block *sb, > struct fid *fid, int fh_len, int fh_type) > { > @@ -4362,8 +4350,8 @@ static int shmem_fill_super(struct super_block *sb, struct fs_context *fc) > } > #endif /* CONFIG_TMPFS_QUOTA */ > > - inode = shmem_get_inode(&nop_mnt_idmap, sb, NULL, S_IFDIR | sbinfo->mode, 0, > - VM_NORESERVE); > + inode = shmem_get_inode(&nop_mnt_idmap, sb, NULL, > + S_IFDIR | sbinfo->mode, 0, VM_NORESERVE); > if (IS_ERR(inode)) { > error = PTR_ERR(inode); > goto failed; > @@ -4666,11 +4654,9 @@ static ssize_t shmem_enabled_show(struct kobject *kobj, > > for (i = 0; i < ARRAY_SIZE(values); i++) { > len += sysfs_emit_at(buf, len, > - shmem_huge == values[i] ? "%s[%s]" : "%s%s", > - i ? " " : "", > - shmem_format_huge(values[i])); > + shmem_huge == values[i] ? "%s[%s]" : "%s%s", > + i ? " " : "", shmem_format_huge(values[i])); > } > - > len += sysfs_emit_at(buf, len, "\n"); > > return len; > @@ -4767,8 +4753,9 @@ EXPORT_SYMBOL_GPL(shmem_truncate_range); > #define shmem_acct_size(flags, size) 0 > #define shmem_unacct_size(flags, size) do {} while (0) > > -static inline struct inode *shmem_get_inode(struct mnt_idmap *idmap, struct super_block *sb, struct inode *dir, > - umode_t mode, dev_t dev, unsigned long flags) > +static inline struct inode *shmem_get_inode(struct mnt_idmap *idmap, > + struct super_block *sb, struct inode *dir, > + umode_t mode, dev_t dev, unsigned long flags) > { > struct inode *inode = ramfs_get_inode(sb, dir, mode, dev); > return inode ? inode : ERR_PTR(-ENOSPC); > @@ -4778,8 +4765,8 @@ static inline struct inode *shmem_get_inode(struct mnt_idmap *idmap, struct supe > > /* common code */ > > -static struct file *__shmem_file_setup(struct vfsmount *mnt, const char *name, loff_t size, > - unsigned long flags, unsigned int i_flags) > +static struct file *__shmem_file_setup(struct vfsmount *mnt, const char *name, > + loff_t size, unsigned long flags, unsigned int i_flags) > { > struct inode *inode; > struct file *res; > @@ -4798,7 +4785,6 @@ static struct file *__shmem_file_setup(struct vfsmount *mnt, const char *name, l > > inode = shmem_get_inode(&nop_mnt_idmap, mnt->mnt_sb, NULL, > S_IFREG | S_IRWXUGO, 0, flags); > - > if (IS_ERR(inode)) { > shmem_unacct_size(flags, size); > return ERR_CAST(inode); > -- > 2.35.3 > -- Jan Kara SUSE Labs, CR