From: andros@netapp.com
To: bfields@fieldses.org
Cc: linux-nfs@vger.kernel.org, Andy Adamson <andros@netapp.com>
Subject: [PATCH 1/1] pnfsd: fix dlm device naming
Date: Fri, 11 Jun 2010 12:45:34 -0400 [thread overview]
Message-ID: <1276274734-4996-2-git-send-email-andros@netapp.com> (raw)
In-Reply-To: <1276274734-4996-1-git-send-email-andros@netapp.com>
From: Andy Adamson <andros@netapp.com>
Signed-off-by: Andy Adamson <andros@netapp.com>
---
fs/nfsd/nfs4pnfsdlm.c | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/fs/nfsd/nfs4pnfsdlm.c b/fs/nfsd/nfs4pnfsdlm.c
index 1cf1b69..ae46126 100644
--- a/fs/nfsd/nfs4pnfsdlm.c
+++ b/fs/nfsd/nfs4pnfsdlm.c
@@ -47,12 +47,15 @@ struct dlm_device_entry {
};
static struct dlm_device_entry *
-nfsd4_find_pnfs_dlm_device(char *disk_name)
+_nfsd4_find_pnfs_dlm_device(char *disk_name)
{
struct dlm_device_entry *dlm_pdev;
+ dprintk("--> %s disk name %s\n", __func__, disk_name);
spin_lock(&dlm_device_list_lock);
list_for_each_entry(dlm_pdev, &dlm_device_list, dlm_dev_list) {
+ dprintk("%s Look for dlm_pdev %s\n", __func__,
+ dlm_pdev->disk_name);
if (!memcmp(dlm_pdev->disk_name, disk_name, strlen(disk_name))) {
spin_unlock(&dlm_device_list_lock);
return dlm_pdev;
@@ -62,6 +65,14 @@ nfsd4_find_pnfs_dlm_device(char *disk_name)
return NULL;
}
+static struct dlm_device_entry *
+nfsd4_find_pnfs_dlm_device(struct super_block *sb) {
+ char dname[BDEVNAME_SIZE];
+
+ bdevname(sb->s_bdev, dname);
+ return _nfsd4_find_pnfs_dlm_device(dname);
+}
+
ssize_t
nfsd4_get_pnfs_dlm_device_list(char *buf, ssize_t buflen)
{
@@ -150,7 +161,7 @@ nfsd4_set_pnfs_dlm_device(char *pnfs_dlm_device, int len)
dprintk("%s disk_name %s num_ds %d ds_list %s\n", __func__,
new->disk_name, new->num_ds, new->ds_list);
- found = nfsd4_find_pnfs_dlm_device(new->disk_name);
+ found = _nfsd4_find_pnfs_dlm_device(new->disk_name);
if (found) {
/* FIXME: should compare found->ds_list with new->ds_list
* and if it is different, kick off a CB_NOTIFY change
@@ -243,7 +254,7 @@ static int nfsd4_pnfs_dlm_getdevinfo(struct super_block *sb,
/*
* If the DS list has not been established, return -EINVAL
*/
- dlm_pdev = nfsd4_find_pnfs_dlm_device(sb->s_bdev->bd_disk->disk_name);
+ dlm_pdev = nfsd4_find_pnfs_dlm_device(sb);
if (!dlm_pdev) {
dprintk("%s: DEBUG: disk %s Not Found\n", __func__,
sb->s_bdev->bd_disk->disk_name);
@@ -339,7 +350,7 @@ static int dlm_ino_hash(struct inode *ino)
/* If can't find the inode block device in the pnfs_dlm_deivce list
* then don't hand out a layout
*/
- de = nfsd4_find_pnfs_dlm_device(ino->i_sb->s_bdev->bd_disk->disk_name);
+ de = nfsd4_find_pnfs_dlm_device(ino->i_sb);
if (!de)
return -1;
hash_mask = de->num_ds - 1;
--
1.6.6
next prev parent reply other threads:[~2010-06-11 16:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-11 16:45 [PATCH 0/1] pnfsd fix dlm device naming andros
2010-06-11 16:45 ` andros [this message]
2010-06-12 20:42 ` [PATCH 1/1] pnfsd: " Benny Halevy
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=1276274734-4996-2-git-send-email-andros@netapp.com \
--to=andros@netapp.com \
--cc=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
/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