Re: [PATCH v5 1/2] NFSD: delay unmount source's export after inter-server copy completed.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 5/18/21 10:21 AM, J. Bruce Fields wrote:
On Tue, May 18, 2021 at 01:04:56PM -0400, J. Bruce Fields wrote:
On Mon, May 17, 2021 at 06:43:29PM -0400, Dai Ngo wrote:
+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;
Also: doesn't look like nsu_expire is actually used.  Am I missing
something, or is this a leftover from the conversion to the using the
laundromat thread?

Yes, will be cleaned up in v6.

-Dai


--b.

+	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.



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux