Re: [PATCH] f2fs: reduce unncessary locking pages during read

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

 



>
> -	err = f2fs_readpage(sbi, page, dn.data_blkaddr, READ_SYNC);
> -	if (err) {
> -		f2fs_put_page(page, 1);
> -		return ERR_PTR(err);
> +	if (PageUptodate(page)) {
> +		unlock_page(page);
> +		return page;
>  	}
> -	unlock_page(page);
Hi Jaegeuk.
> +
> +	err = f2fs_readpage(sbi, page, dn.data_blkaddr, READ_SYNC);
> +	wait_on_page_locked(page);
> +	if (!PageUptodate(page))
> +		return ERR_PTR(-EIO);
We don't need to release page before returning EIO ?

>  	return page;
>  }
>
> @@ -241,9 +244,13 @@ struct page *get_lock_data_page(struct inode *inode,
> pgoff_t index)
>  	BUG_ON(dn.data_blkaddr == NULL_ADDR);
>
>  	err = f2fs_readpage(sbi, page, dn.data_blkaddr, READ_SYNC);
> -	if (err) {
> -		f2fs_put_page(page, 1);
> +	if (err)
>  		return ERR_PTR(err);
Here is also same. We don't need to release page in case of err ?

Thanks.
> +
> +	lock_page(page);
> +	if (!PageUptodate(page)) {
> +		f2fs_put_page(page, 1);
> +		return ERR_PTR(-EIO);
>  	}
>  	return page;
>  }
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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