From owner-freebsd-hackers Sat Aug 28 12:19:16 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from hda.hda.com (hda-bicnet.bicnet.net [209.244.238.132]) by hub.freebsd.org (Postfix) with ESMTP id 0331914D08 for ; Sat, 28 Aug 1999 12:19:04 -0700 (PDT) (envelope-from dufault@hda.hda.com) Received: (from dufault@localhost) by hda.hda.com (8.8.5/8.8.5) id PAA09116; Sat, 28 Aug 1999 15:16:29 -0400 (EDT) From: Peter Dufault Message-Id: <199908281916.PAA09116@hda.hda.com> Subject: Re: locking revisited In-Reply-To: <19990828125241.G13904@freebie.lemis.com> from Greg Lehey at "Aug 28, 99 12:52:42 pm" To: grog@lemis.com (Greg Lehey) Date: Sat, 28 Aug 1999 15:16:28 -0400 (EDT) Cc: hackers@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL25 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > As a result, I argue that we should implement locking. The questions > are: how? I'd suggest three methods which can be individually enabled > via sysctls: > > - System V style. We need this for compatibility with System V. The > choice of mandatory or advisory locking depends on the file > permissions. > > - Only mandatory locking. fcntl works as before, but locks are > always mandatory, not advisory. I'm sure that this won't be > popular, at least initially, but if you don't like it, you don't > have to use it.y > > - Via separate calls to fcntl. fcntl currently has the following > command values: > > #define F_DUPFD 0 /* duplicate file descriptor */ > #define F_GETFD 1 /* get file descriptor flags */ > #define F_SETFD 2 /* set file descriptor flags */ > #define F_GETFL 3 /* get file status flags */ > #define F_SETFL 4 /* set file status flags */ > #define F_GETOWN 5 /* get SIGIO/SIGURG proc/pgrp */ > #define F_SETOWN 6 /* set SIGIO/SIGURG proc/pgrp */ > #define F_GETLK 7 /* get record locking information */ > #define F_SETLK 8 /* set record locking information */ > #define F_SETLKW 9 /* F_SETLK; wait if blocked */ > > We could add a F_SETMANDLOCK or some such. > > Any thoughts? (I'm following up only on -hackers because I personally hate discussions in -commit.) Yes - 1. Isn't vinum a device? Isn't this file-level locking irrelevant? Shouldn't all locking for maintenance be done at the device level? 2. I'll bet there are some standards, at least in development. Have you done a few searches? I have other opinions, some that I hold strongly, but since they have to do with lack of definition of boundary conditions then I won't bring them up until (2.) is answered. Peter -- Peter Dufault (dufault@hda.com) Realtime development, Machine control, HD Associates, Inc. Safety critical systems, Agency approval To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message