lkml.org 
[lkml]   [2016]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/22] staging: lustre: osc: handle osc eviction correctly

> 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).

Not a fan either. Resubmitted patch with ergo removed.

\
 
 \ /
  Last update: 2016-12-08 00:17    [W:0.511 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site