@@ -63,7 +63,6 @@ struct nfsd4_client_tracking_ops {
6363
6464/* Globals */
6565static char user_recovery_dirname [PATH_MAX ] = "/var/lib/nfs/v4recovery" ;
66- static struct nfsd4_client_tracking_ops * client_tracking_ops ;
6766
6867static int
6968nfs4_save_creds (const struct cred * * original_creds )
@@ -1262,25 +1261,26 @@ nfsd4_client_tracking_init(struct net *net)
12621261{
12631262 int status ;
12641263 struct path path ;
1264+ struct nfsd_net * nn = net_generic (net , nfsd_net_id );
12651265
12661266 /* just run the init if it the method is already decided */
1267- if (client_tracking_ops )
1267+ if (nn -> client_tracking_ops )
12681268 goto do_init ;
12691269
12701270 /*
12711271 * First, try a UMH upcall. It should succeed or fail quickly, so
12721272 * there's little harm in trying that first.
12731273 */
1274- client_tracking_ops = & nfsd4_umh_tracking_ops ;
1275- status = client_tracking_ops -> init (net );
1274+ nn -> client_tracking_ops = & nfsd4_umh_tracking_ops ;
1275+ status = nn -> client_tracking_ops -> init (net );
12761276 if (!status )
12771277 return status ;
12781278
12791279 /*
12801280 * See if the recoverydir exists and is a directory. If it is,
12811281 * then use the legacy ops.
12821282 */
1283- client_tracking_ops = & nfsd4_legacy_tracking_ops ;
1283+ nn -> client_tracking_ops = & nfsd4_legacy_tracking_ops ;
12841284 status = kern_path (nfs4_recoverydir (), LOOKUP_FOLLOW , & path );
12851285 if (!status ) {
12861286 status = S_ISDIR (path .dentry -> d_inode -> i_mode );
@@ -1290,58 +1290,66 @@ nfsd4_client_tracking_init(struct net *net)
12901290 }
12911291
12921292 /* Finally, try to use nfsdcld */
1293- client_tracking_ops = & nfsd4_cld_tracking_ops ;
1293+ nn -> client_tracking_ops = & nfsd4_cld_tracking_ops ;
12941294 printk (KERN_WARNING "NFSD: the nfsdcld client tracking upcall will be "
12951295 "removed in 3.10. Please transition to using "
12961296 "nfsdcltrack.\n" );
12971297do_init :
1298- status = client_tracking_ops -> init (net );
1298+ status = nn -> client_tracking_ops -> init (net );
12991299 if (status ) {
13001300 printk (KERN_WARNING "NFSD: Unable to initialize client "
13011301 "recovery tracking! (%d)\n" , status );
1302- client_tracking_ops = NULL ;
1302+ nn -> client_tracking_ops = NULL ;
13031303 }
13041304 return status ;
13051305}
13061306
13071307void
13081308nfsd4_client_tracking_exit (struct net * net )
13091309{
1310- if (client_tracking_ops ) {
1311- if (client_tracking_ops -> exit )
1312- client_tracking_ops -> exit (net );
1313- client_tracking_ops = NULL ;
1310+ struct nfsd_net * nn = net_generic (net , nfsd_net_id );
1311+
1312+ if (nn -> client_tracking_ops ) {
1313+ if (nn -> client_tracking_ops -> exit )
1314+ nn -> client_tracking_ops -> exit (net );
1315+ nn -> client_tracking_ops = NULL ;
13141316 }
13151317}
13161318
13171319void
13181320nfsd4_client_record_create (struct nfs4_client * clp )
13191321{
1320- if (client_tracking_ops )
1321- client_tracking_ops -> create (clp );
1322+ struct nfsd_net * nn = net_generic (clp -> net , nfsd_net_id );
1323+
1324+ if (nn -> client_tracking_ops )
1325+ nn -> client_tracking_ops -> create (clp );
13221326}
13231327
13241328void
13251329nfsd4_client_record_remove (struct nfs4_client * clp )
13261330{
1327- if (client_tracking_ops )
1328- client_tracking_ops -> remove (clp );
1331+ struct nfsd_net * nn = net_generic (clp -> net , nfsd_net_id );
1332+
1333+ if (nn -> client_tracking_ops )
1334+ nn -> client_tracking_ops -> remove (clp );
13291335}
13301336
13311337int
13321338nfsd4_client_record_check (struct nfs4_client * clp )
13331339{
1334- if (client_tracking_ops )
1335- return client_tracking_ops -> check (clp );
1340+ struct nfsd_net * nn = net_generic (clp -> net , nfsd_net_id );
1341+
1342+ if (nn -> client_tracking_ops )
1343+ return nn -> client_tracking_ops -> check (clp );
13361344
13371345 return - EOPNOTSUPP ;
13381346}
13391347
13401348void
13411349nfsd4_record_grace_done (struct nfsd_net * nn , time_t boot_time )
13421350{
1343- if (client_tracking_ops )
1344- client_tracking_ops -> grace_done (nn , boot_time );
1351+ if (nn -> client_tracking_ops )
1352+ nn -> client_tracking_ops -> grace_done (nn , boot_time );
13451353}
13461354
13471355static int
0 commit comments