Re: [External] Re: [RFC PATCH 2/5] cachefiles: extract ondemand info field from cachefiles_object

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

 





在 2022/10/8 17:06, JeffleXu 写道:


On 8/18/22 9:52 PM, Jia Zhu wrote:

  /*
   * Backing file state.
   */
@@ -67,8 +73,7 @@ struct cachefiles_object {
  	unsigned long			flags;
  #define CACHEFILES_OBJECT_USING_TMPFILE	0		/* Have an unlinked tmpfile */
  #ifdef CONFIG_CACHEFILES_ONDEMAND
-	int				ondemand_id;
-	enum cachefiles_object_state	state;
+	void				*private;
  #endif
  };

Personally I would prefer

	struct cachefiles_object {
		...
	#ifdef CONFIG_CACHEFILES_ONDEMAND
		struct cachefiles_ondemand_info *private;
	#endif
	}

and

@@ -88,6 +93,7 @@ void cachefiles_put_object(struct cachefiles_object
*object,
  		ASSERTCMP(object->file, ==, NULL);

  		kfree(object->d_name);
+ #ifdef CONFIG_CACHEFILES_ONDEMAND
+		kfree(object->private);
+ #endif

  		cache = object->volume->cache->cache;
  		fscache_put_cookie(object->cookie,

so that we can get rid of CACHEFILES_ONDEMAND_OBJINFO() stuff, to make
the code more readable.
Hi JingBo. Thanks for your review. I'll revise it in next version.






[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux