From owner-freebsd-hackers Tue Aug 24 20: 1:24 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from patriot.wipinfo.soft.net (patriot.wipinfo.soft.net [164.164.6.21]) by hub.freebsd.org (Postfix) with ESMTP id 5B93514BF2 for ; Tue, 24 Aug 1999 20:01:09 -0700 (PDT) (envelope-from bee@wipinfo.soft.net) Received: from vayu.wipinfo.soft.net (root@vayu [192.168.200.170]) by patriot.wipinfo.soft.net (8.9.3/8.9.3) with ESMTP id IAA14721 for ; Wed, 25 Aug 1999 08:31:21 -0500 (GMT) Received: from wipro.tcpn.com ([172.31.41.11]) by vayu.wipinfo.soft.net (8.9.3/8.9.3) with ESMTP id IAA11573 for ; Wed, 25 Aug 1999 08:49:08 +0530 Received: from keeravani (keeravani.wipro.tcpn.com [172.31.41.136]) by wipro.tcpn.com (8.9.3/8.9.3) with SMTP id IAA14290 for ; Wed, 25 Aug 1999 08:32:58 +0530 (IST) Reply-To: From: "Biju Susmer" To: "'FreeBSD Hackers'" Subject: RE: Mandatory locking? Date: Wed, 25 Aug 1999 08:31:23 +0530 Message-ID: <000301beeea6$1ea898a0$88291fac@wipro.tcpn.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: <19990824214523.A11992@ppp18415.on.bellglobal.com> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Importance: Normal Disposition-Notification-To: "Biju Susmer" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG All the files under Tandem's NSK has mandatory locking. The file cannot be opened if another process has it opened. some thing like * if the file is opened for reading, any one can open it for reading but opening for writing gives error * if the file is open for writing, it can't be opened for read/write * if the process holding the file is killed, the lock is gone * it is possible to get the pid of the process(es) which has a given file open (like which process has file "xyz" open? kind of query). btw, is there any way to get this info now in FBSD? Also, file need not be explicitly locked. Opening a file puts proper lock. A file which is open can't be deleted also ;) This kind of locking will solve most of the problems which are pointed out. Mandatory locking on a part of the file is in no way better than advisory locking. All the files need not have this option. there must be a way to specify that "this file needs mandatory locking" to the kernel. I don't know what all changes are needed in the kernel.. but I'm thinking about dup() and fork().. What is the fate of the lock if the process does a fork()? I hope this makes sense.. -Biju To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message