Re: [PATCH v5 1/2] NFSD: delay unmount source's export after inter-server copy completed.
From: J. Bruce Fields <hidden>
Date: 2021-05-18 17:05:00
On Mon, May 17, 2021 at 06:43:29PM -0400, Dai Ngo wrote:
quoted hunk ↗ jump to hunk
+struct nfsd4_ssc_umount; enum { /* cache misses due only to checksum comparison failures */@@ -176,6 +177,10 @@ struct nfsd_net { unsigned int longest_chain_cachesize; struct shrinker nfsd_reply_cache_shrinker; + + spinlock_t nfsd_ssc_lock; + struct nfsd4_ssc_umount *nfsd_ssc_umount;
...
+void nfsd4_ssc_init_umount_work(struct nfsd_net *nn)
+{
+ nn->nfsd_ssc_umount = kzalloc(sizeof(struct nfsd4_ssc_umount),
+ GFP_KERNEL);
+ if (!nn->nfsd_ssc_umount)
+ return;Is there any reason this needs to be allocated dynamically? Let's just embed it in nfsd_net. Actually, I'm not convinced the separate structure definition's really that helpful:
+struct nfsd4_ssc_umount {
+ struct list_head nsu_list;
+ unsigned long nsu_expire;
+ wait_queue_head_t nsu_waitq;
+};
How about just:
struct nfsd_net {
...
/* tracking server-to-server copy mounts: */
spinlock_t nfsd_ssc_lock;
struct list_head nfsd_ssc_mount_list;
unsigned long nfsd_ssc_mount_expire;
wait_queeu_head_t nfsd_ssc_mount_waitq;
or something along those lines?
--b.