Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3058069pxb; Tue, 12 Jan 2021 05:27:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7SyQjWFu2LBa2Gb2IL5JeG5ctCZlpm7G5y1Em0nXsUlwnYqU7EFOKXSpQBugkCsag5QK/ X-Received: by 2002:a50:b746:: with SMTP id g64mr3446639ede.33.1610458034151; Tue, 12 Jan 2021 05:27:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610458034; cv=none; d=google.com; s=arc-20160816; b=apLjlZp88m9KDOw5D8szvqQAi7XzG2M91ogrqL+p3p7q+s2ntVTKXMVrfEV5lwSbZK O5MerRYgjoPyh1PR2Wsx6J8Nq+Gaf2MXmPGYn3dyVRVooBmDEu5lnKIiiuIHkCkpKhR4 xiZYsBvj3JNVLuhs/we5kJ5gxgGDnlcvXoPmnwz63WZtAnjHTJTYhSh15OW5l+ZPFRR8 ZAGDVxd7VdYotO1f8EnhJRl/r60VE/oI+l6UqGy9282sQn2tS98C+DZny2940bpWIg+D grBf1aIuF/Hez4by6cz6GlaXzcvsTCnscVeLU6RY8MycQVXk01LcsMkFOKZbUCAsbT3a P25A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ohjhUAmEGPJC4BcqI1gjkDSNtKuZBC2S/xaU2E56EaI=; b=WjS1DdZpWgtEy5G5NH600GCjQ0GC4IMcIN4xYLastTLtdmd3r0a9YhZYYYjVPy4kuh z2iyph1XGhdMfXBvs8p127tJe44nIQOhquoDLFYW9rOGfvkmOv0vy2Yw1lZvGlN2y5aj x32jQzX8vVLeHKBugPoDyrurZUBG5CyHTLm790mW+VKqoxKRof78ON2wTN/a7XLNs511 MDOkL5QGUmgCKup8+MSPPi9M1bzuBjwhdXg4tNv8P079bGWhUsM90yeQI1Ebguiw3TU6 7+vAjbt5acmlCe1fxH3fgqzNrAHFRGoBi1pRGWADOrxpCV6nghpZg4nFp/77DYKnAm2t dguQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w11si1249586ejc.31.2021.01.12.05.26.50; Tue, 12 Jan 2021 05:27:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728967AbhALN0G (ORCPT + 99 others); Tue, 12 Jan 2021 08:26:06 -0500 Received: from verein.lst.de ([213.95.11.211]:55540 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727895AbhALN0F (ORCPT ); Tue, 12 Jan 2021 08:26:05 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 5AC0A68B02; Tue, 12 Jan 2021 14:25:21 +0100 (CET) Date: Tue, 12 Jan 2021 14:25:21 +0100 From: Christoph Hellwig To: Eric Biggers Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Theodore Ts'o Subject: Re: [PATCH v2 11/12] ext4: simplify i_state checks in __ext4_update_other_inode_time() Message-ID: <20210112132521.GB13780@lst.de> References: <20210109075903.208222-1-ebiggers@kernel.org> <20210109075903.208222-12-ebiggers@kernel.org> <20210111105342.GE2502@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Jan 11, 2021 at 12:23:40PM -0800, Eric Biggers wrote: > > I think a descriptively named inline helper in fs.h would really improve > > this.. > > Do you want this even though it is specific to how ext4 opportunisticly updates > other inodes in the same inode block as the inode being updated? That's the > only reason that I_FREEING|I_WILL_FREE|I_NEW need to be checked; everywhere else > justs want I_DIRTY_TIME. > > We could add: > > static inline bool other_inode_has_dirtytime(struct inode *inode) > { > return (inode->state & (I_FREEING | I_WILL_FREE | > I_NEW | I_DIRTY_TIME)) == I_DIRTY_TIME; > } > > But it seems a bit weird when it's specific to ext4 at the moment. > > Are you thinking that other filesystems will implement the same sort of > opportunistic update, so we should add the helper now? For my taste these checks for flags is way too much black magic and will trivially break when people add new flags. So having a helper next to the definition of the I_* flags that is well documented would be very, very helpful. My preferred naming would be something along the lines of 'inode_is_dirty_lazytime_only()'.