From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamie Lokier Subject: Re: fcntl method for file_operations Date: Thu, 25 Mar 2004 19:55:15 +0000 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20040325195515.GF11236@mail.shareable.org> References: <1080237894.2380.5.camel@stevef95.austin.ibm.com> <20040325193545.GC25059@parcelfarce.linux.theplanet.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Steve French , linux-cifs-client@cifs.bkbits.net, linux-fsdevel@vger.kernel.org Return-path: Received: from mail.shareable.org ([81.29.64.88]:31377 "EHLO mail.shareable.org") by vger.kernel.org with ESMTP id S263588AbUCYTzW (ORCPT ); Thu, 25 Mar 2004 14:55:22 -0500 To: Matthew Wilcox Content-Disposition: inline In-Reply-To: <20040325193545.GC25059@parcelfarce.linux.theplanet.co.uk> List-Id: linux-fsdevel.vger.kernel.org Matthew Wilcox wrote: > perhaps the right thing to do is just to add the following ops to > file_operations: > > int (*fcntl_setfl)(int fd, struct file *filp, unsigned long arg); > int (*fcntl_getlease)(struct file *filp); > int (*fcntl_setlease)(int fd, struct file *filp, unsigned long arg); > int (*fcntl_dirnotify(int fd, struct file *filp, unsigned long arg); > > comments? I agree that a generic fcntl() doesn't make a lot of sense. However, rather than your suggestion, I'd rather getlease/setlease/dirnotify have more appropriate structure for those operations, be called from a generic lease/dnotify core, and be added as and when they are actually used by a filesystem. Otherwise I can easily see NFS dirnotify being implemented, and dnotify.c being enhanced to support some feature like non-signal results (DN_NOSIGNAL), ->poll() waiting, last writer close, or whatever, and those new features fine *except* on NFS filesystems which has it's own signal delivery code etc. copied from dnotify.c. In other words, for dnotify, the generic dnotify code should always be used so that the API is consistent among filesystems, but it should call the filesystem to do the filesystem-specific part namely registering a callback function to be called when a non-local change is detected. Similarly for leases, and any other wonders that are added in future like mount notifications. -- Jamie