Re: [PATCH V4 3/6] erofs: introduce fscache-based domain

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

 




On 9/15/22 8:42 PM, Jia Zhu wrote:

>  struct erofs_fscache *erofs_fscache_register_cookie(struct super_block *sb,
>  						     char *name, bool need_inode)
>  {
> @@ -481,27 +578,18 @@ void erofs_fscache_unregister_cookie(struct erofs_fscache *ctx)
>  int erofs_fscache_register_fs(struct super_block *sb)
>  {
>  	struct erofs_sb_info *sbi = EROFS_SB(sb);
> -	struct fscache_volume *volume;
>  	struct erofs_fscache *fscache;
> -	char *name;
> -	int ret = 0;
> -
> -	name = kasprintf(GFP_KERNEL, "erofs,%s", sbi->opt.fsid);
> -	if (!name)
> -		return -ENOMEM;
> -
> -	volume = fscache_acquire_volume(name, NULL, NULL, 0);
> -	if (IS_ERR_OR_NULL(volume)) {
> -		erofs_err(sb, "failed to register volume for %s", name);
> -		kfree(name);
> -		return volume ? PTR_ERR(volume) : -EOPNOTSUPP;
> -	}
> +	int ret;
>  
> -	sbi->volume = volume;
> -	kfree(name);
> +	if (sbi->opt.domain_id)
> +		ret = erofs_fscache_register_domain(sb);
> +	else
> +		ret = erofs_fscache_register_volume(sb);
> +	if (ret)
> +		return ret;
>  
> +	/* acquired domain/volume will be relinquished in kill_sb() if error occurs */

"... in kill_sb() on error" is better to make this line within 80 chars
length.


>  	fscache = erofs_fscache_register_cookie(sb, sbi->opt.fsid, true);
> -	/* acquired volume will be relinquished in kill_sb() */
>  	if (IS_ERR(fscache))
>  		return PTR_ERR(fscache);
>  


-- 
Thanks,
Jingbo



[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