Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1536511
| From | Oleg Drokin <oleg.drokin@intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 04/22] staging: lustre: osc: handle osc eviction correctly |
| Date | 2016-12-06 00:10 +0100 |
| Message-ID | <sLayu-2sU-21@gated-at.bofh.it> (permalink) |
| References | <sK6Qi-2BA-3@gated-at.bofh.it> <sK6Qi-2BA-15@gated-at.bofh.it> <sL8wG-Xr-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Dec 5, 2016, at 3:55 PM, Dan Carpenter wrote:
> On Fri, Dec 02, 2016 at 07:53:11PM -0500, James Simmons wrote:
>> @@ -3183,8 +3182,10 @@ static int discard_cb(const struct lu_env *env, struct cl_io *io,
>> /* page is top page. */
>> info->oti_next_index = osc_index(ops) + 1;
>> if (cl_page_own(env, io, page) == 0) {
>> - KLASSERT(ergo(page->cp_type == CPT_CACHEABLE,
>> - !PageDirty(cl_page_vmpage(page))));
>> + if (!ergo(page->cp_type == CPT_CACHEABLE,
>> + !PageDirty(cl_page_vmpage(page))))
>> + CL_PAGE_DEBUG(D_ERROR, env, page,
>> + "discard dirty page?\n");
>
>
> I don't understand the point of the ergo macro. There are way too many
> double negatives (some of them hidden for my small brain). How is that
> simpler than just writing it out:
>
> if (page->cp_type == CPT_CACHEABLE &&
> PageDirty(cl_page_vmpage(page))
> CL_PAGE_DEBUG(D_ERROR, env, page, "discard dirty page?\n");
I guess it makes it sound chic or something?
I am not a huge fan of it either, esp. in a case like this, though
it might be somewhat more convenient in assertions (where this is converted from).
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 04/22] staging: lustre: osc: handle osc eviction correctly James Simmons <jsimmons@infradead.org> - 2016-12-03 02:00 +0100
Re: [PATCH 04/22] staging: lustre: osc: handle osc eviction correctly Dan Carpenter <dan.carpenter@oracle.com> - 2016-12-05 22:00 +0100
Re: [PATCH 04/22] staging: lustre: osc: handle osc eviction correctly Oleg Drokin <oleg.drokin@intel.com> - 2016-12-06 00:10 +0100
Re: [PATCH 04/22] staging: lustre: osc: handle osc eviction correctly James Simmons <jsimmons@infradead.org> - 2016-12-08 00:20 +0100
csiph-web