Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753982AbXFCS4X (ORCPT ); Sun, 3 Jun 2007 14:56:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751534AbXFCS4D (ORCPT ); Sun, 3 Jun 2007 14:56:03 -0400 Received: from lazybastard.de ([212.112.238.170]:58121 "EHLO longford.lazybastard.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751427AbXFCS4A (ORCPT ); Sun, 3 Jun 2007 14:56:00 -0400 Date: Sun, 3 Jun 2007 20:51:21 +0200 From: =?utf-8?B?SsO2cm4=?= Engel To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org Cc: akpm@osdl.org, Sam Ravnborg , John Stoffel , David Woodhouse , Jamie Lokier , Artem Bityutskiy , CaT , Jan Engelhardt , Evgeniy Polyakov , David Weinehall , Arnd Bergmann , Willy Tarreau , Kyle Moffett , Dongjun Shin , Pavel Machek , Bill Davidsen , Thomas Gleixner , Albert Cahalan , Pekka Enberg , Roland Dreier , Ondrej Zajicek , Ulisses Furquim Subject: [Patch 18/18] fs/logfs/Locking Message-ID: <20070603185121.GS8952@lazybastard.org> References: <20070603183845.GA8952@lazybastard.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20070603183845.GA8952@lazybastard.org> User-Agent: Mutt/1.5.9i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1672 Lines: 53 --- /dev/null 2007-03-13 19:15:28.862769062 +0100 +++ linux-2.6.21logfs/fs/logfs/Locking 2007-06-03 19:18:57.000000000 +0200 @@ -0,0 +1,45 @@ +Locks: + +s_victim_mutex +Protects victim inode for create, unlink, mkdir, rmdir, mknod, link, +symlink and one variant of rename. Only one victim inode may exist at +a time. In case of unclean unmount, victim inode has to be deleted +before next read-writable mount. + +s_rename_mutex +Protects victim dd for rename. Only one victim dd may exist at a +time. In case of unclean unmount, victim dd has to be deleted before +next read-writable mount. + +s_write_inode_mutex +Taken when writing an inode. Deleted inodes can be locked, preventing +further iget operations during writeout. Logfs may need to iget the +inode for garbage collection, so the inode in question needs to be +stored in the superblock and used directly without calling iget. + +s_log_sem +Used for allocating space in journal. + +s_r_sem +Protects the memory required for reads from the filesystem. + +s_w_sem +Protects the memory required for writes to the filesystem. + +s_ino_lock +Protects s_last_ino. + + +Lock order: +s_rename_mutex --> s_victim_mutex +s_rename_mutex --> s_write_inode_mutex +s_rename_mutex --> s_w_sem + +s_victim_mutex --> s_write_inode_mutex +s_victim_mutex --> s_w_sem +s_victim_mutex --> s_ino_lock + +s_write_inode_mutex --> s_w_sem + +s_w_sem --> s_log_sem +s_w_sem --> s_r_sem - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/