mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
NFSD: delay unmount source's export after inter-server copy completed.
Currently the source's export is mounted and unmounted on every inter-server copy operation. This patch is an enhancement to delay the unmount of the source export for a certain period of time to eliminate the mount and unmount overhead on subsequent copy operations. After a copy operation completes, a work entry is added to the delayed unmount list with an expiration time. This list is serviced by the laundromat thread to unmount the export of the expired entries. Each time the export is being used again, its expiration time is extended and the entry is re-inserted to the tail of the list. The unmount task and the mount operation of the copy request are synced to make sure the export is not unmounted while it's being used. Signed-off-by: Dai Ngo <dai.ngo@oracle.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
parent
eac0b17a77
commit
f4e44b3933
6 changed files with 229 additions and 4 deletions
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/nfs_fs.h>
|
||||
#include <linux/sunrpc/svc.h>
|
||||
|
||||
extern struct nfs_ssc_client_ops_tbl nfs_ssc_client_tbl;
|
||||
|
||||
|
@ -52,6 +53,19 @@ static inline void nfs42_ssc_close(struct file *filep)
|
|||
if (nfs_ssc_client_tbl.ssc_nfs4_ops)
|
||||
(*nfs_ssc_client_tbl.ssc_nfs4_ops->sco_close)(filep);
|
||||
}
|
||||
|
||||
struct nfsd4_ssc_umount_item {
|
||||
struct list_head nsui_list;
|
||||
bool nsui_busy;
|
||||
/*
|
||||
* nsui_refcnt inited to 2, 1 on list and 1 for consumer. Entry
|
||||
* is removed when refcnt drops to 1 and nsui_expire expires.
|
||||
*/
|
||||
refcount_t nsui_refcnt;
|
||||
unsigned long nsui_expire;
|
||||
struct vfsmount *nsui_vfsmount;
|
||||
char nsui_ipaddr[RPC_MAX_ADDRBUFLEN];
|
||||
};
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue