From owner-freebsd-arch@FreeBSD.ORG Sat Aug 29 02:37:24 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AF6A106564A for ; Sat, 29 Aug 2009 02:37:24 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-bw0-f206.google.com (mail-bw0-f206.google.com [209.85.218.206]) by mx1.freebsd.org (Postfix) with ESMTP id 1B7618FC08 for ; Sat, 29 Aug 2009 02:37:23 +0000 (UTC) Received: by bwz2 with SMTP id 2so1790410bwz.43 for ; Fri, 28 Aug 2009 19:37:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=wKUaQWmLAFs9dH4V0cKeRcp39DQrKTO4bIxRYikp0P4=; b=sNkX4xc9j+QlcQzmY7kN1Myr94nPMrIrfbiEPiQFTboUNk5Nkce/lzp9vsR0mVB66T OdLR5g8hNfm++U8UytEIlW/3s6pp5c2U0xrDEeoaPBY+BK4q+lc8wfpRdko58FB2WNoQ j6R0zOInO3B6fBeG7b9JD3uwdzcIhNw9atgM8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; b=QhhfC8JQV/QRSV1ZGbMR+R60DKw+Uo08azb51/yLdaBDPzlJOqgS0hTkq6r3RkeYh1 lfNF4dJvAF/8hcT44zemzv/YDzdc5xMtYejithoAsXeDiib5a6oDvwvniRClMbqfOQEe xcQ8hDFi+lwkmvI+j+iVWdbi4XfzCsfgfW7DA= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.144.70 with SMTP id y6mr827188fau.12.1251511495714; Fri, 28 Aug 2009 19:04:55 -0700 (PDT) Date: Sat, 29 Aug 2009 04:04:55 +0200 X-Google-Sender-Auth: b7928ec1a477e258 Message-ID: <3bbf2fe10908281904l6f8119a5l2daa301016eac8ef@mail.gmail.com> From: Attilio Rao To: freebsd-arch@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: Konstantin Belousov Subject: [PATCH] VFS KPI/API versioning X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2009 02:37:24 -0000 Often I found as it would have been useful to verify, mostly at run-time, of a feature of the VFS was supported and I quickly thought that having a run-time check for VFS versioning would not be a bad idea. In order to do that, I made the following patch: http://www.freebsd.org/~attilio/vfs_modload.diff which basically builds the vfs layer as a module adding a version number that can be checked for filesystems/modules willing to load in order to see if a specific feature is supported. Obviously I didn't add an entry in the modules/ neither possibility to unload/shutdown the module because we would not be willing to have such operations (or a run-time load of the vfs). Something that concerned me is also the mis-usage of the VFS_VERSION macro, which can be easilly used at compile time in order to determine if a feature is present or not. Basically, I have no idea by when it doesn't get updated and if it has ever been checked in our codes. It seems to use a random number as the start count, while it could have been handled differently. Maybe it would be the case to start taking care of that too, which can be an interesting tool. Can you comment on the patch? If you think it is a good idea I will commit right away on -CURRENT and STABLE_8. Attilio -- Peace can only be achieved by understanding - A. Einstein