diff mbox

[v2,17/35] ubifs: export read_block() from file.c

Message ID 1438235311-23788-18-git-send-email-yangds.fnst@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yang Dongsheng July 30, 2015, 5:48 a.m. UTC
We want to use read_block to read quota file bypass the page cache.
So export it from file.c, then we can use it in somewhere else.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
---
 fs/ubifs/file.c  | 4 ++--
 fs/ubifs/ubifs.h | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Richard Weinberger Aug. 3, 2015, 9:13 p.m. UTC | #1
Am 30.07.2015 um 07:48 schrieb Dongsheng Yang:
> We want to use read_block to read quota file bypass the page cache.
> So export it from file.c, then we can use it in somewhere else.
> 
> Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
> ---
>  fs/ubifs/file.c  | 4 ++--
>  fs/ubifs/ubifs.h | 2 ++
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
> index 554d7b9..f307e86 100644
> --- a/fs/ubifs/file.c
> +++ b/fs/ubifs/file.c
> @@ -54,7 +54,7 @@
>  #include <linux/namei.h>
>  #include <linux/slab.h>
>  
> -static int read_block(struct inode *inode, void *addr, unsigned int block,
> +int ubifs_read_block(struct inode *inode, void *addr, unsigned int block,
>  		      struct ubifs_data_node *dn)
>  {
>  	struct ubifs_info *c = inode->i_sb->s_fs_info;
> @@ -141,7 +141,7 @@ static int do_readpage(struct page *page)
>  			err = -ENOENT;
>  			memset(addr, 0, UBIFS_BLOCK_SIZE);
>  		} else {
> -			ret = read_block(inode, addr, block, dn);
> +			ret = ubifs_read_block(inode, addr, block, dn);
>  			if (ret) {
>  				err = ret;
>  				if (err != -ENOENT)
> diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
> index 71b79b5..c48fb41 100644
> --- a/fs/ubifs/ubifs.h
> +++ b/fs/ubifs/ubifs.h
> @@ -1749,6 +1749,8 @@ const struct ubifs_lprops *ubifs_fast_find_frdi_idx(struct ubifs_info *c);
>  int ubifs_calc_dark(const struct ubifs_info *c, int spc);
>  
>  /* file.c */
> +int ubifs_read_block(struct inode *inode, void *addr, unsigned int block,
> +		      struct ubifs_data_node *dn);
>  int ubifs_fsync(struct file *file, loff_t start, loff_t end, int datasync);
>  int ubifs_setattr(struct dentry *dentry, struct iattr *attr);
>  int ubifs_update_time(struct inode *inode, struct timespec *time, int flags);

Reviewed-by: Richard Weinberger <richard@nod.at>

Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Richard Weinberger Aug. 3, 2015, 9:29 p.m. UTC | #2
Am 03.08.2015 um 23:13 schrieb Richard Weinberger:
> Am 30.07.2015 um 07:48 schrieb Dongsheng Yang:
>> We want to use read_block to read quota file bypass the page cache.
>> So export it from file.c, then we can use it in somewhere else.
>>
>> Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
>> ---
>>  fs/ubifs/file.c  | 4 ++--
>>  fs/ubifs/ubifs.h | 2 ++
>>  2 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
>> index 554d7b9..f307e86 100644
>> --- a/fs/ubifs/file.c
>> +++ b/fs/ubifs/file.c
>> @@ -54,7 +54,7 @@
>>  #include <linux/namei.h>
>>  #include <linux/slab.h>
>>  
>> -static int read_block(struct inode *inode, void *addr, unsigned int block,
>> +int ubifs_read_block(struct inode *inode, void *addr, unsigned int block,
>>  		      struct ubifs_data_node *dn)

Forgot one minor comment, as the function is now public please document the
parameters.

Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yang Dongsheng Aug. 7, 2015, 3:15 a.m. UTC | #3
On 08/04/2015 05:29 AM, Richard Weinberger wrote:
> Am 03.08.2015 um 23:13 schrieb Richard Weinberger:
>> Am 30.07.2015 um 07:48 schrieb Dongsheng Yang:
>>> We want to use read_block to read quota file bypass the page cache.
>>> So export it from file.c, then we can use it in somewhere else.
>>>
>>> Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
>>> ---
>>>   fs/ubifs/file.c  | 4 ++--
>>>   fs/ubifs/ubifs.h | 2 ++
>>>   2 files changed, 4 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
>>> index 554d7b9..f307e86 100644
>>> --- a/fs/ubifs/file.c
>>> +++ b/fs/ubifs/file.c
>>> @@ -54,7 +54,7 @@
>>>   #include <linux/namei.h>
>>>   #include <linux/slab.h>
>>>
>>> -static int read_block(struct inode *inode, void *addr, unsigned int block,
>>> +int ubifs_read_block(struct inode *inode, void *addr, unsigned int block,
>>>   		      struct ubifs_data_node *dn)
>
> Forgot one minor comment, as the function is now public please document the
> parameters.

Thanx, will update it in next verison.

Yang
>
> Thanks,
> //richard
> .
>

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index 554d7b9..f307e86 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -54,7 +54,7 @@ 
 #include <linux/namei.h>
 #include <linux/slab.h>
 
-static int read_block(struct inode *inode, void *addr, unsigned int block,
+int ubifs_read_block(struct inode *inode, void *addr, unsigned int block,
 		      struct ubifs_data_node *dn)
 {
 	struct ubifs_info *c = inode->i_sb->s_fs_info;
@@ -141,7 +141,7 @@  static int do_readpage(struct page *page)
 			err = -ENOENT;
 			memset(addr, 0, UBIFS_BLOCK_SIZE);
 		} else {
-			ret = read_block(inode, addr, block, dn);
+			ret = ubifs_read_block(inode, addr, block, dn);
 			if (ret) {
 				err = ret;
 				if (err != -ENOENT)
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
index 71b79b5..c48fb41 100644
--- a/fs/ubifs/ubifs.h
+++ b/fs/ubifs/ubifs.h
@@ -1749,6 +1749,8 @@  const struct ubifs_lprops *ubifs_fast_find_frdi_idx(struct ubifs_info *c);
 int ubifs_calc_dark(const struct ubifs_info *c, int spc);
 
 /* file.c */
+int ubifs_read_block(struct inode *inode, void *addr, unsigned int block,
+		      struct ubifs_data_node *dn);
 int ubifs_fsync(struct file *file, loff_t start, loff_t end, int datasync);
 int ubifs_setattr(struct dentry *dentry, struct iattr *attr);
 int ubifs_update_time(struct inode *inode, struct timespec *time, int flags);