From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C0871BC3A; Mon, 5 Feb 2024 12:20:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707135609; cv=none; b=M32jxlRBK1Bi6wxXjgj0BBINnZRF+0XWhCWaPp07HLb/BetPSDkJOdLJmkcIX7VlL4f220jhISRmeH8R/FLdg6b9419pi7nlunMMpombtN0j2qbXUEK/d0e3+/yX0lKqLBXB5cyDoR5flBKYLy7aNXijhr7YuKqVUjboV68h8mM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707135609; c=relaxed/simple; bh=7//g9J4D+ZXpm9UU4QExrEcw6hVi83+PWFQfkzUzwQg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=umu2cF5gD4dIt1c6IXxfxrL2lFRXkhDJf4rB+/onymC6e20b4ahpfIMNUpr5g3Q7WkAYNyTFtOQYuUMfUE6BOjITaSf91ZfIMovJJEPpDwdp8fYIgFPylIW4u3e6r3G0mXkaWakEFpuxdOtDDSZgz/E0iM0JaKHoCQ6AGdDhn/w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NI3CgvHq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NI3CgvHq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6DC7C433F1; Mon, 5 Feb 2024 12:19:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707135609; bh=7//g9J4D+ZXpm9UU4QExrEcw6hVi83+PWFQfkzUzwQg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NI3CgvHqbCduKOUG55PcantMhEuO6cn+Q82WktDz/McB8+xXuzAr9oWfxBNRDlJIq EUGGrhAl14I7YROetxKLGMcqGt8Ru+AmVB9bfDoQy4MxBuJTscGI6an5jXX1a1UxlY iH0tINjNfz+a+kl3LaOWdJAlnwQq7npi5RyjBS1soNm/JRgw9c+6hBFsGgc/vYpFgs dev0mLv7LL+uzC+/lrHORqWInlmNXxUEGlfF+z82l0aWpZ8rLwcWppSKbu1HoVVCxo MqPT8nFMBRA5HdSKbdJcN8lFf+Y1tStm+kUjtpb43bBeSysyW23YnK908iHBQqL4uI oEI2OhqzX3GkA== Date: Mon, 5 Feb 2024 13:19:57 +0100 From: Christian Brauner To: Jeff Layton Cc: Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Chuck Lever , Alexander Viro , Jan Kara , Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck , David Howells , Marc Dionne , Xiubo Li , Ilya Dryomov , Alexander Aring , David Teigland , Andreas Gruenbacher , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Trond Myklebust , Anna Schumaker , Mark Fasheh , Joel Becker , Joseph Qi , Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Namjae Jeon , Sergey Senozhatsky , Miklos Szeredi , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, v9fs@lists.linux.dev, linux-afs@lists.infradead.org, ceph-devel@vger.kernel.org, gfs2@lists.linux.dev, linux-nfs@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-cifs@vger.kernel.org Subject: Re: [PATCH v3 04/47] filelock: add some new helper functions Message-ID: <20240205-fragil-begraben-4b78fd1b5981@brauner> References: <20240131-flsplit-v3-0-c6129007ee8d@kernel.org> <20240131-flsplit-v3-4-c6129007ee8d@kernel.org> <20240205-wegschauen-unappetitlich-2b0926023605@brauner> <20240205-laufen-hosen-38578e076df5@brauner> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Mon, Feb 05, 2024 at 07:06:00AM -0500, Jeff Layton wrote: > On Mon, 2024-02-05 at 12:57 +0100, Christian Brauner wrote: > > On Mon, Feb 05, 2024 at 06:55:44AM -0500, Jeff Layton wrote: > > > On Mon, 2024-02-05 at 12:36 +0100, Christian Brauner wrote: > > > > > diff --git a/include/linux/filelock.h b/include/linux/filelock.h > > > > > index 085ff6ba0653..a814664b1053 100644 > > > > > --- a/include/linux/filelock.h > > > > > +++ b/include/linux/filelock.h > > > > > @@ -147,6 +147,29 @@ int fcntl_setlk64(unsigned int, struct file *, unsigned int, > > > > >  int fcntl_setlease(unsigned int fd, struct file *filp, int arg); > > > > >  int fcntl_getlease(struct file *filp); > > > > >   > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > +static inline bool lock_is_unlock(struct file_lock *fl) > > > > > +{ > > > > > + return fl->fl_type == F_UNLCK; > > > > > +} > > > > > + > > > > > +static inline bool lock_is_read(struct file_lock *fl) > > > > > +{ > > > > > + return fl->fl_type == F_RDLCK; > > > > > +} > > > > > + > > > > > +static inline bool lock_is_write(struct file_lock *fl) > > > > > +{ > > > > > + return fl->fl_type == F_WRLCK; > > > > > +} > > > > > + > > > > > +static inline void locks_wake_up(struct file_lock *fl) > > > > > +{ > > > > > + wake_up(&fl->fl_wait); > > > > > +} > > > > > + > > > > > +/* for walking lists of file_locks linked by fl_list */ > > > > > +#define for_each_file_lock(_fl, _head) list_for_each_entry(_fl, _head, fl_list) > > > > > + > > > > > > > > This causes a build warning for fs/ceph/ and fs/afs when > > > > !CONFIG_FILE_LOCKING. I'm about to fold the following diff into this > > > > patch. The diff looks a bit wonky but essentially I've moved > > > > lock_is_unlock(), lock_is_{read,write}(), locks_wake_up() and > > > > for_each_file_lock() out of the ifdef CONFIG_FILE_LOCKING: > > > > > > > > > > I sent a patch for this problem yesterday. Did you not get it? > > > > Whoops, probably missed it on the trip back from fosdem. > > I'll double check now. > > No worries. If you choose to go with your version, you can add: No, I took yours. :)