login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
August
»
1
Re: [PATCH 000 of 35] Refactor block layer to improve support for stacked devices.
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Tejun Heo <teheo@...>
To: Avi Kivity <avi@...>
Cc: NeilBrown <neilb@...>, <linux-kernel@...>
Subject:
Re: [PATCH 000 of 35] Refactor block layer to improve support for stacked devices.
Date: Wednesday, August 1, 2007 - 10:37 am
Avi Kivity wrote:
quoted text
> NeilBrown wrote: >> To achieve this, the "for_each" macros are now somewhat more complex. >> For example, rq_for_each_segment is: >> >> #define bio_for_each_segment_offset(bv, bio, _i, offs, _size) \ >> for (_i.i = 0, _i.offset = (bio)->bi_offset + offs, \ >> _i.size = min_t(int, _size, (bio)->bi_size - offs); \ >> _i.i < (bio)->bi_vcnt && _i.size > 0; \ >> _i.i++) \ >> if (bv = *bio_iovec_idx((bio), _i.i), \ >> bv.bv_offset += _i.offset, \ >> bv.bv_len <= _i.offset \ >> ? (_i.offset -= bv.bv_len, 0) \ >> : (bv.bv_len -= _i.offset, \ >> _i.offset = 0, \ >> bv.bv_len < _i.size \ >> ? (_i.size -= bv.bv_len, 1) \ >> : (bv.bv_len = _i.size, \ >> _i.size = 0, \ >> bv.bv_len > 0))) >> >> #define bio_for_each_segment(bv, bio, __i) \ >> bio_for_each_segment_offset(bv, bio, __i, 0, (bio)->bi_size) >> >> It does some with some explanatory text in a comment, but it is still >> a bit daunting. Any suggestions on making this more approachable >> would be very welcome. >> >> > > Well, I hesitate to state the obvious, but how about: > > #define bio_for_each_segment_offset(bv, bio, _i, offs, _size) \ > for (bio_iterator_init(&_i, ...); bio_iterator_cont(&_i, ...); > bio_iterator_advance(&_i, ...)) \ > if (bio_iterator_want_segment(&_i, ...)) > > While this doesn't remove the complexity, at least it's readable.
Violently seconded. -- tejun -
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 000 of 35] Refactor block layer to improve support fo...
, NeilBrown
, (Mon Jul 30, 10:15 pm)
Re: [PATCH 000 of 35] Refactor block layer to improve suppor...
, Avi Kivity
, (Tue Jul 31, 11:28 am)
Re: [PATCH 000 of 35] Refactor block layer to improve suppor...
, Tejun Heo
, (Wed Aug 1, 10:37 am)
Re: [PATCH 000 of 35] Refactor block layer to improve suppor...
, John Stoffel
, (Wed Aug 1, 11:52 am)
Re: [PATCH 000 of 35] Refactor block layer to improve suppor...
, Tejun Heo
, (Wed Aug 1, 11:59 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg KH
[GIT PATCH] driver core patches against 2.6.24
david
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
David Woodhouse
[PATCH 1/3] firmware: allow firmware files to be built into kernel image
Peter Zijlstra
[PATCH 00/23] per device dirty throttling -v8
git
:
linux-netdev
:
Jarek Poplawski
[PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Gerrit Renker
[PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side)
Josip Rodin
bnx2_poll panicking kernel
Patrick McHardy
Re: [GIT]: Networking
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
0 users
and
703 guests
online.
Syndicate