From patchwork Mon May 16 01:10:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 786972 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4G1Aglx018876 for ; Mon, 16 May 2011 01:10:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752211Ab1EPBKk (ORCPT ); Sun, 15 May 2011 21:10:40 -0400 Received: from cantor.suse.de ([195.135.220.2]:32983 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751603Ab1EPBKj convert rfc822-to-8bit (ORCPT ); Sun, 15 May 2011 21:10:39 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id EEEE1947EC; Mon, 16 May 2011 03:10:38 +0200 (CEST) Date: Mon, 16 May 2011 11:10:30 +1000 From: NeilBrown To: trond.myklebust@netapp.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH] Declare modalias for nfs4filelayout to support auto-loading of modules. Message-ID: <20110516111030.55ca84b0@notabene.brown> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.1; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 16 May 2011 01:10:42 +0000 (UTC) Hi, I had a brief look at configuring pnfs recently and wondered why http://wiki.linux-nfs.org/wiki/index.php/PNFS_Setup_Instructions suggested that the layout module should be explicitly 'modprobe'd when that sort of thing is normally automatic. pnfs.c makes the appropriate 'request-module' call, but there is no MODULE_ALIAS to link the relevant module with the requested name. This patch adds the required MODULE_ALIAS. It has only been compile-tested (my interest is as yet only theoretical :-) Thanks, NeilBrown From 1f87c7a913fd7d4caf8b464761e44d109512aad6 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 16 May 2011 10:55:57 +1000 Subject: [PATCH] Declare modalias for nfs4filelayout to support auto-loading of modules. pnfs.c uses 'request_module' with the name nfs-layouttype4-1 when it actually wants nfs4filelayout so give the latter a "MODULE_ALIAS" so it can be found with the former name. This avoids needing to add an alais to /etc/modprobe.d/... Signed-off-by: NeilBrown --- fs/nfs/nfs4filelayout.c | 1 + fs/nfs/pnfs.h | 2 ++ 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c index be79dc9..86c2f5f 100644 --- a/fs/nfs/nfs4filelayout.c +++ b/fs/nfs/nfs4filelayout.c @@ -873,6 +873,7 @@ static struct pnfs_layoutdriver_type filelayout_type = { .read_pagelist = filelayout_read_pagelist, .write_pagelist = filelayout_write_pagelist, }; +NFSV4_LAYOUT_MODULE_ALIAS(LAYOUT_NFSV4_1_FILES); static int __init nfs4filelayout_init(void) { diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h index 0c015ba..1c2a1f1 100644 --- a/fs/nfs/pnfs.h +++ b/fs/nfs/pnfs.h @@ -55,6 +55,8 @@ enum pnfs_try_status { #ifdef CONFIG_NFS_V4_1 #define LAYOUT_NFSV4_1_MODULE_PREFIX "nfs-layouttype4" +#define NFSV4_LAYOUT_MODULE_ALIAS(id) \ + MODULE_ALIAS(LAYOUT_NFSV4_1_MODULE_PREFIX "-" #id) enum { NFS_LAYOUT_RO_FAILED = 0, /* get ro layout failed stop trying */