From patchwork Wed Oct 26 22:43:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ahelenia_Ziemia=C5=84ska?= X-Patchwork-Id: 11457 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp519663wru; Wed, 26 Oct 2022 15:46:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6QnbztfdgSnwi8Ei6VttNkSc2Z9AotYWDQUtV0X5NoqVMnaFo7FnQ5gCTR1dJQMgXYwJFc X-Received: by 2002:a17:907:3d9e:b0:791:8933:f9fc with SMTP id he30-20020a1709073d9e00b007918933f9fcmr40224767ejc.111.1666824372266; Wed, 26 Oct 2022 15:46:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666824372; cv=none; d=google.com; s=arc-20160816; b=VpPEAHZ3Y5Vk6ZleAqLjOhzGjeeMFtayhRihEKgOoDwc/mo1JB6eTEk+l3bU8hy7mB pl442NrbGdaSep5E15tE0rV/U5+qQ4P56g8kBHzVdGTFSsunQxXwYiltJHdSjItohTyB Slemb5QqGUvQ1KfmYCPI/qyYyglqF2uSnw2Z2HbOKwzoQuCNtJVeHbyghCf0Wu+u8MMj rcxFopw6/fbuqSatqMlz46AlEeELcofA/tObFOm3vi3YoemsSoI4OQcT5gXbztAKV0gI l+xeSGHksKdbXaIXnhht7k/PJQKVnZmDl5u0hufT5AVBSJmxkz80WBcs+rP8lTNBiKSC aSfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:from:date :dkim-signature; bh=ikHZtfa91RDXjgRgiwdf2WejDcuG511v/2LpcxDAjls=; b=UxOkYRb2fLOCbCKdzeg3r2pVbvHYeUVKq2Nsvg/BmpLLKNgW0vQAFhChVqVsq89Rg5 ApFs8qjOHaM9VTFNeT+Cbk7VPSnZFjpkiUvJ1T1u6WWwy9ZMXA461SJ1OA2X38hzDM7A dmSqYX7Ug8vr1HDX+3lom+bHFC4mFk36atymvjTeQ8bLBK1AzNzMC7BP4z4WUSP+Z+/A x4dJ2xpFsQfgYs4i3pmE2WGysx5f+GpFHnMPrrs5xnqS2B0KYS/kDKYtKRoQnzNXUrvo Gk8do4txh7gukQJQ3IOE5wdMdSJEH34NGIt9fu1yLG4xedN5PUlLbU4Y2T/3JuVUZB0K SQXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=XTAoIpUx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k27-20020a17090627db00b007ab349af9f9si5896085ejc.158.2022.10.26.15.45.48; Wed, 26 Oct 2022 15:46:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202205 header.b=XTAoIpUx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233607AbiJZWof (ORCPT + 99 others); Wed, 26 Oct 2022 18:44:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233924AbiJZWny (ORCPT ); Wed, 26 Oct 2022 18:43:54 -0400 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 88003F53E2; Wed, 26 Oct 2022 15:43:38 -0700 (PDT) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id D4AD54B1C; Thu, 27 Oct 2022 00:43:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202205; t=1666824217; bh=e8NfwyZk0kVFMKWCFjNMasZpKgncxX76xLaXCy/oYY0=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=XTAoIpUxPq5YEl9T/pU3mjCQ6HPWUXpwp5jl5pro9rDRJWH1P+ceKNvhpSjxhCKOo 10SzcEgbzTHbjCdtJv5LxLjihtg0fqgVgrTF3M9wP4qtvakcGnotbC7VV1GSBMZH/4 sIOFQG/qRjB8W9xHBwz+IqlzSqgmIWhBocFi+/7xzxgM7rpm2CUOP1PvXlXbgjbgTe l+xpaqlEnC1Es8qOfpGz4uExohagoay9E+qnYnTfjgssB8f/LZ8JjBVeNSv7qdHpnd akaZeucxguwGb+sfDqS64ZhZa8sML2YoJbDxgLgPqnkRUbvOGkIPRAgO2fN0J1iGmz cGzowGZiBw5zrFo09Ia9AXeps2gWYpg+X+WyQiaN5kwKLIyGdc0QuB9TkkHoVd2aD/ ofNDn9U+WtLCdHNTzbySiK1/fht88lQq9sQtvar945utt+JDVx2+0Z40qWl2qB+J6y bATQGq3b8bHzBdnTabSxmtOEJsTdxxhOwHhfxP/QkcsccWd7XF19VOEUMeppOFNT8q Hg2Q0zDjpiTLYDA1YiAt/svm4RNC49C9SHpSzUE375FJ4jX7Y2G7HAMGp2S/DmNNFM DKURUpaTVa/GW6hIPGD19bClWxcvJBFocRVrM6FQfnWBW1xzR5of+5E8ZkPlv7OUJp IhJjDjXweTWi5frvTdSqs/K0= Date: Thu, 27 Oct 2022 00:43:36 +0200 From: =?utf-8?b?0L3QsNCx?= Cc: Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , Jeff Layton , Chuck Lever , Alexander Viro , Greg Kroah-Hartman , Jiri Slaby , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Subject: [PATCH 13/15] fcntl: remove FASYNC_MAGIC Message-ID: <4729b484174431a57b6bca139fe659f0e27b7e1a.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> References: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9a453437b5c3b4b1887c1bd84455b0cc3d1c40b2.1666822928.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20220429 X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, MISSING_HEADERS,PDS_OTHER_BAD_TLD,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747792033462108221?= X-GMAIL-MSGID: =?utf-8?q?1747792033462108221?= We have largely moved away from this approach, and we have better debugging instrumentation nowadays: kill it Ref: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ Signed-off-by: Ahelenia Ziemiańska --- Documentation/process/magic-number.rst | 1 - Documentation/translations/it_IT/process/magic-number.rst | 1 - Documentation/translations/zh_CN/process/magic-number.rst | 1 - Documentation/translations/zh_TW/process/magic-number.rst | 1 - fs/fcntl.c | 6 ------ include/linux/fs.h | 3 --- 6 files changed, 13 deletions(-) diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst index e59c707ec785..6e432917a5a8 100644 --- a/Documentation/process/magic-number.rst +++ b/Documentation/process/magic-number.rst @@ -68,6 +68,5 @@ Changelog:: ===================== ================ ======================== ========================================== Magic Name Number Structure File ===================== ================ ======================== ========================================== -FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/it_IT/process/magic-number.rst b/Documentation/translations/it_IT/process/magic-number.rst index 37a539867b6f..7d4c117ac626 100644 --- a/Documentation/translations/it_IT/process/magic-number.rst +++ b/Documentation/translations/it_IT/process/magic-number.rst @@ -74,6 +74,5 @@ Registro dei cambiamenti:: ===================== ================ ======================== ========================================== Nome magico Numero Struttura File ===================== ================ ======================== ========================================== -FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst index 8a3a3e872c52..c17e3f20440a 100644 --- a/Documentation/translations/zh_CN/process/magic-number.rst +++ b/Documentation/translations/zh_CN/process/magic-number.rst @@ -57,6 +57,5 @@ Linux 魔术数 ===================== ================ ======================== ========================================== 魔术数名 数字 结构 文件 ===================== ================ ======================== ========================================== -FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/Documentation/translations/zh_TW/process/magic-number.rst b/Documentation/translations/zh_TW/process/magic-number.rst index 7ace7834f7f9..e2eeb74e7192 100644 --- a/Documentation/translations/zh_TW/process/magic-number.rst +++ b/Documentation/translations/zh_TW/process/magic-number.rst @@ -60,6 +60,5 @@ Linux 魔術數 ===================== ================ ======================== ========================================== 魔術數名 數字 結構 文件 ===================== ================ ======================== ========================================== -FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h`` CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c`` ===================== ================ ======================== ========================================== diff --git a/fs/fcntl.c b/fs/fcntl.c index 146c9ab0cd4b..e366a3804108 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -924,7 +924,6 @@ struct fasync_struct *fasync_insert_entry(int fd, struct file *filp, struct fasy } rwlock_init(&new->fa_lock); - new->magic = FASYNC_MAGIC; new->fa_file = filp; new->fa_fd = fd; new->fa_next = *fapp; @@ -988,11 +987,6 @@ static void kill_fasync_rcu(struct fasync_struct *fa, int sig, int band) struct fown_struct *fown; unsigned long flags; - if (fa->magic != FASYNC_MAGIC) { - printk(KERN_ERR "kill_fasync: bad magic number in " - "fasync_struct!\n"); - return; - } read_lock_irqsave(&fa->fa_lock, flags); if (fa->fa_file) { fown = &fa->fa_file->f_owner; diff --git a/include/linux/fs.h b/include/linux/fs.h index e654435f1651..acfd5db5341a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1345,15 +1345,12 @@ static inline int locks_lock_file_wait(struct file *filp, struct file_lock *fl) struct fasync_struct { rwlock_t fa_lock; - int magic; int fa_fd; struct fasync_struct *fa_next; /* singly linked list */ struct file *fa_file; struct rcu_head fa_rcu; }; -#define FASYNC_MAGIC 0x4601 - /* SMP safe fasync helpers: */ extern int fasync_helper(int, struct file *, int, struct fasync_struct **); extern struct fasync_struct *fasync_insert_entry(int, struct file *, struct fasync_struct **, struct fasync_struct *);