From mboxrd@z Thu Jan 1 00:00:00 1970 From: Trond Myklebust Subject: Re: fcntl method for file_operations Date: Thu, 25 Mar 2004 15:15:58 -0500 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <1080245758.3463.31.camel@lade.trondhjem.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=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Steve French , linux-cifs-client@cifs.bkbits.net, linux-fsdevel@vger.kernel.org Return-path: Received: from dh132.citi.umich.edu ([141.211.133.132]:27520 "EHLO lade.trondhjem.org") by vger.kernel.org with ESMTP id S263606AbUCYUQB convert rfc822-to-8bit (ORCPT ); Thu, 25 Mar 2004 15:16:01 -0500 To: Matthew Wilcox In-Reply-To: <20040325193545.GC25059@parcelfarce.linux.theplanet.co.uk> List-Id: linux-fsdevel.vger.kernel.org P=E5 to , 25/03/2004 klokka 14:35, skreiv Matthew Wilcox: > I don't think we should have an fcntl() method. I'd rather see a typ= ed > set of method calls for whatever set of routines are actually useful. > Something along the lines of ethtool_ops, say ;-) >=20 > perhaps the right thing to do is just to add the following ops to > file_operations: >=20 > 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); >=20 > comments? This was what we first proposed (actually, just the fcntl_setfl() call)= , but akpm prefers the fcntl() method. I can see his point: fcntl() is second only to ioctl() when it comes to interface design. If you want to provide methods/callbacks for each and every overloaded subcase, then your "struct file_operations" can quickl= y turn ugly. Cheers, Trond - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html