nfs4recover.c (8a60d42d26d31df8121b251c2b5c56eb24e729f1) nfs4recover.c (97e47fa11deae10ae72aa1109e700565c57152f5)
1/*
2* Copyright (c) 2004 The Regents of the University of Michigan.
3* Copyright (c) 2012 Jeff Layton <jlayton@redhat.com>
4* All rights reserved.
5*
6* Andy Adamson <andros@citi.umich.edu>
7*
8* Redistribution and use in source and binary forms, with or without

--- 371 unchanged lines hidden (view full) ---

380{
381 int status;
382
383 if (nfs4_has_reclaimed_state(child->d_name.name, nn))
384 return 0;
385
386 status = vfs_rmdir(parent->d_inode, child);
387 if (status)
1/*
2* Copyright (c) 2004 The Regents of the University of Michigan.
3* Copyright (c) 2012 Jeff Layton <jlayton@redhat.com>
4* All rights reserved.
5*
6* Andy Adamson <andros@citi.umich.edu>
7*
8* Redistribution and use in source and binary forms, with or without

--- 371 unchanged lines hidden (view full) ---

380{
381 int status;
382
383 if (nfs4_has_reclaimed_state(child->d_name.name, nn))
384 return 0;
385
386 status = vfs_rmdir(parent->d_inode, child);
387 if (status)
388 printk("failed to remove client recovery directory %s\n",
389 child->d_name.name);
388 printk("failed to remove client recovery directory %pd\n",
389 child);
390 /* Keep trying, success or failure: */
391 return 0;
392}
393
394static void
395nfsd4_recdir_purge_old(struct nfsd_net *nn, time_t boot_time)
396{
397 int status;

--- 7 unchanged lines hidden (view full) ---

405 status = nfsd4_list_rec_dir(purge_old, nn);
406 if (status == 0)
407 vfs_fsync(nn->rec_file, 0);
408 mnt_drop_write_file(nn->rec_file);
409out:
410 nfs4_release_reclaim(nn);
411 if (status)
412 printk("nfsd4: failed to purge old clients from recovery"
390 /* Keep trying, success or failure: */
391 return 0;
392}
393
394static void
395nfsd4_recdir_purge_old(struct nfsd_net *nn, time_t boot_time)
396{
397 int status;

--- 7 unchanged lines hidden (view full) ---

405 status = nfsd4_list_rec_dir(purge_old, nn);
406 if (status == 0)
407 vfs_fsync(nn->rec_file, 0);
408 mnt_drop_write_file(nn->rec_file);
409out:
410 nfs4_release_reclaim(nn);
411 if (status)
412 printk("nfsd4: failed to purge old clients from recovery"
413 " directory %s\n", nn->rec_file->f_path.dentry->d_name.name);
413 " directory %pD\n", nn->rec_file);
414}
415
416static int
417load_recdir(struct dentry *parent, struct dentry *child, struct nfsd_net *nn)
418{
419 if (child->d_name.len != HEXDIR_LEN - 1) {
414}
415
416static int
417load_recdir(struct dentry *parent, struct dentry *child, struct nfsd_net *nn)
418{
419 if (child->d_name.len != HEXDIR_LEN - 1) {
420 printk("nfsd4: illegal name %s in recovery directory\n",
421 child->d_name.name);
420 printk("nfsd4: illegal name %pd in recovery directory\n",
421 child);
422 /* Keep trying; maybe the others are OK: */
423 return 0;
424 }
425 nfs4_client_to_reclaim(child->d_name.name, nn);
426 return 0;
427}
428
429static int
430nfsd4_recdir_load(struct net *net) {
431 int status;
432 struct nfsd_net *nn = net_generic(net, nfsd_net_id);
433
434 if (!nn->rec_file)
435 return 0;
436
437 status = nfsd4_list_rec_dir(load_recdir, nn);
438 if (status)
439 printk("nfsd4: failed loading clients from recovery"
422 /* Keep trying; maybe the others are OK: */
423 return 0;
424 }
425 nfs4_client_to_reclaim(child->d_name.name, nn);
426 return 0;
427}
428
429static int
430nfsd4_recdir_load(struct net *net) {
431 int status;
432 struct nfsd_net *nn = net_generic(net, nfsd_net_id);
433
434 if (!nn->rec_file)
435 return 0;
436
437 status = nfsd4_list_rec_dir(load_recdir, nn);
438 if (status)
439 printk("nfsd4: failed loading clients from recovery"
440 " directory %s\n", nn->rec_file->f_path.dentry->d_name.name);
440 " directory %pD\n", nn->rec_file);
441 return status;
442}
443
444/*
445 * Hold reference to the recovery directory.
446 */
447
448static int

--- 970 unchanged lines hidden ---
441 return status;
442}
443
444/*
445 * Hold reference to the recovery directory.
446 */
447
448static int

--- 970 unchanged lines hidden ---