diff mbox

[v1,2/8] block: make 'struct bvec_iter' not depend on CONFIG_BLOCK

Message ID 1459354637-17415-3-git-send-email-ming.lei@canonical.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ming Lei March 30, 2016, 4:17 p.m. UTC
We will use bvec iterator to implement iterate_bvec(): lib/iov_iter.c.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
 include/linux/blk_types.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Christoph Hellwig March 30, 2016, 5:19 p.m. UTC | #1
On Thu, Mar 31, 2016 at 12:17:11AM +0800, Ming Lei wrote:
> We will use bvec iterator to implement iterate_bvec(): lib/iov_iter.c.
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Ming Lei <ming.lei@canonical.com>
> ---
>  include/linux/blk_types.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
> index 86a38ea..fd8527b 100644
> --- a/include/linux/blk_types.h
> +++ b/include/linux/blk_types.h
> @@ -26,8 +26,6 @@ struct bio_vec {
>  	unsigned int	bv_offset;
>  };
>  
> -#ifdef CONFIG_BLOCK
> -
>  struct bvec_iter {
>  	sector_t		bi_sector;	/* device address in 512 byte
>  						   sectors */
> @@ -39,6 +37,8 @@ struct bvec_iter {
>  						   current bvec */
>  };

I didn't catch this earlier, but shouldn't this also move to
bvec_iter.h? Or maybe just create a linux/bvec.h for the bvec, bvec_iter
and bvec iter macros given that those are the types used outside the
block layer as well.
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ming Lei March 31, 2016, 1:02 a.m. UTC | #2
On Thu, Mar 31, 2016 at 1:19 AM, Christoph Hellwig <hch@infradead.org> wrote:
> On Thu, Mar 31, 2016 at 12:17:11AM +0800, Ming Lei wrote:
>> We will use bvec iterator to implement iterate_bvec(): lib/iov_iter.c.
>>
>> Reviewed-by: Christoph Hellwig <hch@lst.de>
>> Signed-off-by: Ming Lei <ming.lei@canonical.com>
>> ---
>>  include/linux/blk_types.h | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
>> index 86a38ea..fd8527b 100644
>> --- a/include/linux/blk_types.h
>> +++ b/include/linux/blk_types.h
>> @@ -26,8 +26,6 @@ struct bio_vec {
>>       unsigned int    bv_offset;
>>  };
>>
>> -#ifdef CONFIG_BLOCK
>> -
>>  struct bvec_iter {
>>       sector_t                bi_sector;      /* device address in 512 byte
>>                                                  sectors */
>> @@ -39,6 +37,8 @@ struct bvec_iter {
>>                                                  current bvec */
>>  };
>
> I didn't catch this earlier, but shouldn't this also move to
> bvec_iter.h? Or maybe just create a linux/bvec.h for the bvec, bvec_iter
> and bvec iter macros given that those are the types used outside the
> block layer as well.

That way may cause trouble to blk_type.h because it needs bvec_iter,
then looks not good to always include bvec_iter.h into blk_type.h.

Thanks,
Ming
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig March 31, 2016, 7:52 a.m. UTC | #3
On Thu, Mar 31, 2016 at 09:02:59AM +0800, Ming Lei wrote:
> That way may cause trouble to blk_type.h because it needs bvec_iter,
> then looks not good to always include bvec_iter.h into blk_type.h.

I'd expect bvec.h to be always included in blk_types.h, and replace
the inclusion of blk_types.h in fs.h eventually.
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ming Lei April 1, 2016, 12:31 a.m. UTC | #4
On Thu, Mar 31, 2016 at 3:52 PM, Christoph Hellwig <hch@infradead.org> wrote:
> On Thu, Mar 31, 2016 at 09:02:59AM +0800, Ming Lei wrote:
>> That way may cause trouble to blk_type.h because it needs bvec_iter,
>> then looks not good to always include bvec_iter.h into blk_type.h.
>
> I'd expect bvec.h to be always included in blk_types.h, and replace

That should be fine, but blk_types.h will become more fat.

> the inclusion of blk_types.h in fs.h eventually.

I guess it can't be done because fs.h need 'struct bio'.

thanks,
Ming
--
To unsubscribe from this list: send the line "unsubscribe linux-block" 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/include/linux/blk_types.h b/include/linux/blk_types.h
index 86a38ea..fd8527b 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -26,8 +26,6 @@  struct bio_vec {
 	unsigned int	bv_offset;
 };
 
-#ifdef CONFIG_BLOCK
-
 struct bvec_iter {
 	sector_t		bi_sector;	/* device address in 512 byte
 						   sectors */
@@ -39,6 +37,8 @@  struct bvec_iter {
 						   current bvec */
 };
 
+#ifdef CONFIG_BLOCK
+
 /*
  * main unit of I/O for the block layer and lower layers (ie drivers and
  * stacking drivers)