linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: trond.myklebust@netapp.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH] Declare modalias for nfs4filelayout to support auto-loading of modules.
Date: Mon, 16 May 2011 11:10:30 +1000	[thread overview]
Message-ID: <20110516111030.55ca84b0@notabene.brown> (raw)


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 <neilb@suse.de>
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 <neilb@suse.de>
---
 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 */
-- 
1.7.3.4


                 reply	other threads:[~2011-05-16  1:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110516111030.55ca84b0@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@netapp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).