From: Florian Weimer Subject: Proposal for a new lock type Date: Sun, 15 Aug 2010 17:06:58 +0200 Message-ID: <871v9zkj8t.fsf@mid.deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: linux-fsdevel@vger.kernel.org Return-path: Received: from ka.mail.enyo.de ([87.106.162.201]:56010 "EHLO ka.mail.enyo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932070Ab0HOQKP (ORCPT ); Sun, 15 Aug 2010 12:10:15 -0400 Received: from [172.17.135.4] (helo=deneb.enyo.de) by ka.mail.enyo.de with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) id 1Okena-0002qo-Sf for linux-fsdevel@vger.kernel.org; Sun, 15 Aug 2010 17:06:58 +0200 Received: from fw by deneb.enyo.de with local (Exim 4.72) (envelope-from ) id 1Okena-0004by-LJ for linux-fsdevel@vger.kernel.org; Sun, 15 Aug 2010 17:06:58 +0200 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: It seems that it might be useful to have a locally shared, globally exclusive file lock. "Local" is defined as "when the file is mapped shared, memory accesses follow the architecture memory model across threads and processes, and shared POSIX mutexes work". This could be used to make the new WAL code in SQLite 3.7 more foolproof, but there are other applications which would benefit as well. It seems to me that this would not need changes to network file systems because you can implement it by acquring a traditional fcntl()-style exclusive lock on the network side, without creating a corresponding local lock.