@@ -67,14 +67,16 @@ nfs4_deviceid_hash(const struct nfs4_deviceid *id)
6767}
6868
6969static struct nfs4_deviceid_node *
70- _lookup_deviceid (const struct nfs_client * clp , const struct nfs4_deviceid * id ,
70+ _lookup_deviceid (const struct pnfs_layoutdriver_type * ld ,
71+ const struct nfs_client * clp , const struct nfs4_deviceid * id ,
7172 long hash )
7273{
7374 struct nfs4_deviceid_node * d ;
7475 struct hlist_node * n ;
7576
7677 hlist_for_each_entry_rcu (d , n , & nfs4_deviceid_cache [hash ], node )
77- if (d -> nfs_client == clp && !memcmp (& d -> deviceid , id , sizeof (* id ))) {
78+ if (d -> ld == ld && d -> nfs_client == clp &&
79+ !memcmp (& d -> deviceid , id , sizeof (* id ))) {
7880 if (atomic_read (& d -> ref ))
7981 return d ;
8082 else
@@ -90,23 +92,25 @@ _lookup_deviceid(const struct nfs_client *clp, const struct nfs4_deviceid *id,
9092 * @id deviceid to look up
9193 */
9294struct nfs4_deviceid_node *
93- _find_get_deviceid (const struct nfs_client * clp , const struct nfs4_deviceid * id ,
95+ _find_get_deviceid (const struct pnfs_layoutdriver_type * ld ,
96+ const struct nfs_client * clp , const struct nfs4_deviceid * id ,
9497 long hash )
9598{
9699 struct nfs4_deviceid_node * d ;
97100
98101 rcu_read_lock ();
99- d = _lookup_deviceid (clp , id , hash );
102+ d = _lookup_deviceid (ld , clp , id , hash );
100103 if (d && !atomic_inc_not_zero (& d -> ref ))
101104 d = NULL ;
102105 rcu_read_unlock ();
103106 return d ;
104107}
105108
106109struct nfs4_deviceid_node *
107- nfs4_find_get_deviceid (const struct nfs_client * clp , const struct nfs4_deviceid * id )
110+ nfs4_find_get_deviceid (const struct pnfs_layoutdriver_type * ld ,
111+ const struct nfs_client * clp , const struct nfs4_deviceid * id )
108112{
109- return _find_get_deviceid (clp , id , nfs4_deviceid_hash (id ));
113+ return _find_get_deviceid (ld , clp , id , nfs4_deviceid_hash (id ));
110114}
111115EXPORT_SYMBOL_GPL (nfs4_find_get_deviceid );
112116
@@ -119,13 +123,14 @@ EXPORT_SYMBOL_GPL(nfs4_find_get_deviceid);
119123 * @ret the unhashed node, if found and dereferenced to zero, NULL otherwise.
120124 */
121125struct nfs4_deviceid_node *
122- nfs4_unhash_put_deviceid (const struct nfs_client * clp , const struct nfs4_deviceid * id )
126+ nfs4_unhash_put_deviceid (const struct pnfs_layoutdriver_type * ld ,
127+ const struct nfs_client * clp , const struct nfs4_deviceid * id )
123128{
124129 struct nfs4_deviceid_node * d ;
125130
126131 spin_lock (& nfs4_deviceid_lock );
127132 rcu_read_lock ();
128- d = _lookup_deviceid (clp , id , nfs4_deviceid_hash (id ));
133+ d = _lookup_deviceid (ld , clp , id , nfs4_deviceid_hash (id ));
129134 rcu_read_unlock ();
130135 if (!d ) {
131136 spin_unlock (& nfs4_deviceid_lock );
@@ -150,11 +155,12 @@ EXPORT_SYMBOL_GPL(nfs4_unhash_put_deviceid);
150155 * @id deviceid to delete
151156 */
152157void
153- nfs4_delete_deviceid (const struct nfs_client * clp , const struct nfs4_deviceid * id )
158+ nfs4_delete_deviceid (const struct pnfs_layoutdriver_type * ld ,
159+ const struct nfs_client * clp , const struct nfs4_deviceid * id )
154160{
155161 struct nfs4_deviceid_node * d ;
156162
157- d = nfs4_unhash_put_deviceid (clp , id );
163+ d = nfs4_unhash_put_deviceid (ld , clp , id );
158164 if (!d )
159165 return ;
160166 d -> ld -> free_deviceid_node (d );
@@ -194,7 +200,7 @@ nfs4_insert_deviceid_node(struct nfs4_deviceid_node *new)
194200
195201 spin_lock (& nfs4_deviceid_lock );
196202 hash = nfs4_deviceid_hash (& new -> deviceid );
197- d = _find_get_deviceid (new -> nfs_client , & new -> deviceid , hash );
203+ d = _find_get_deviceid (new -> ld , new -> nfs_client , & new -> deviceid , hash );
198204 if (d ) {
199205 spin_unlock (& nfs4_deviceid_lock );
200206 return d ;
0 commit comments