Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965857AbWKEIfq (ORCPT ); Sun, 5 Nov 2006 03:35:46 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S965858AbWKEIfq (ORCPT ); Sun, 5 Nov 2006 03:35:46 -0500 Received: from 1wt.eu ([62.212.114.60]:50436 "EHLO 1wt.eu") by vger.kernel.org with ESMTP id S965857AbWKEIfp (ORCPT ); Sun, 5 Nov 2006 03:35:45 -0500 Date: Sun, 5 Nov 2006 09:34:16 +0100 From: Willy Tarreau To: Mikulas Patocka Cc: Linus Torvalds , linux-kernel@vger.kernel.org Subject: Re: New filesystem for Linux Message-ID: <20061105083416.GA2246@1wt.eu> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2579 Lines: 61 On Sun, Nov 05, 2006 at 05:14:06AM +0100, Mikulas Patocka wrote: > On Sat, 4 Nov 2006, Linus Torvalds wrote: > >- you have a _very_ confusing usage of upper-case. Not only are a lot of > > functions upper-case, some filenames are also upper-case. What would > > otherwise be more readable just ends up being hard to read because it's > > so odd and unexpected. > > > > I'm sure there is some logic to it, but it escapes me. > > I'm used to this. I usually make important functions with uppercase > letters and nonimportant temporary functions with lowercase letters. > > But I see that it contradicts general kernel coding style, so I can change > it. We're more used to have uppercase for macros (or enums) and lowercase for the rest. That way, when you read NULL, KERN_WARNING, PAGE_CACHE_SIZE, INIT_LIST_HEAD..., you know that you're dealing with a macro, which is very convenient. > BTW do you find uppercase typedefs like > typedef struct { > ... > } SPADFNODE; > confusing too? Yes for the reason above. Also, we don't much use type definitions for structures, because it's easier to understand "struct spadfnode *node" in a function declaration than "SPADFNODE *node". Take a look at other file systems. You'll see lots of "struct inode", "struct buffer_head". Sometimes, you'll find some types suffixed with "_t", such as "handle_t" or "spinlock_t". Generally, they are used for very commonly used data (such as spinlocks), or opaque data which are passed between functions without any interpretation. But it's more from observation than a rule. > Uppercase filenames are there because the files are taken from another > (not yet released) project. But the kernel driver does not share any code > except definitions of disk structures, I saw how badly an attempt to share > kernel code affected XFS. It's better to avoid uppercases in file names. I recently had to help a user who could not build his kernel because of strange errors. I finally found out that he was building from "entry.s" instead of "entry.S", which suggested he copied the tree on a FAT. He confirmed having used a vfat-formatted USB stick to copy his tree. Such errors are very annoying to debug. (...) > I placed some benchmark on > http://artax.karlin.mff.cuni.cz/~mikulas/spadfs/benchmarks/ Not bad at all it seems ! Regards, Willy - 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/