Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294494
b: refs/heads/master
c: e9dbca8
h: refs/heads/master
v: v3
  • Loading branch information
Stanislav Kinsbursky authored and Trond Myklebust committed Feb 27, 2012
1 parent 99cfcd6 commit 0bd18c6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: da3b462296e421e8f54b54b7d2706488661c36e2
refs/heads/master: e9dbca8d732e20b8d31a3094a8669c014e7ee262
30 changes: 24 additions & 6 deletions trunk/fs/nfs/idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,23 +553,41 @@ static int __rpc_pipefs_event(struct nfs_client *clp, unsigned long event,
return err;
}

static int rpc_pipefs_event(struct notifier_block *nb, unsigned long event,
void *ptr)
static struct nfs_client *nfs_get_client_for_event(struct net *net, int event)
{
struct super_block *sb = ptr;
struct nfs_net *nn = net_generic(sb->s_fs_info, nfs_net_id);
struct nfs_net *nn = net_generic(net, nfs_net_id);
struct dentry *cl_dentry;
struct nfs_client *clp;
int error = 0;

spin_lock(&nn->nfs_client_lock);
list_for_each_entry(clp, &nn->nfs_client_list, cl_share_link) {
if (clp->rpc_ops != &nfs_v4_clientops)
continue;
cl_dentry = clp->cl_idmap->idmap_pipe->dentry;
if (((event == RPC_PIPEFS_MOUNT) && cl_dentry) ||
((event == RPC_PIPEFS_UMOUNT) && !cl_dentry))
continue;
atomic_inc(&clp->cl_count);
spin_unlock(&nn->nfs_client_lock);
return clp;
}
spin_unlock(&nn->nfs_client_lock);
return NULL;
}

static int rpc_pipefs_event(struct notifier_block *nb, unsigned long event,
void *ptr)
{
struct super_block *sb = ptr;
struct nfs_client *clp;
int error = 0;

while ((clp = nfs_get_client_for_event(sb->s_fs_info, event))) {
error = __rpc_pipefs_event(clp, event, sb);
nfs_put_client(clp);
if (error)
break;
}
spin_unlock(&nn->nfs_client_lock);
return error;
}

Expand Down

0 comments on commit 0bd18c6

Please sign in to comment.