linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@tonian.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Benny Halevy <benny@tonian.com>, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 03/13] pnfsd-block: reverse boolean_t values so they make sense
Date: Wed, 07 Dec 2011 14:45:36 +0200	[thread overview]
Message-ID: <4EDF5FF0.90904@tonian.com> (raw)
In-Reply-To: <20111206115606.GA8474@fieldses.org>

On 2011-12-06 13:56, J. Bruce Fields wrote:
> On Tue, Dec 06, 2011 at 01:27:53PM +0200, Benny Halevy wrote:
>> On 2011-12-06 04:10, J. Bruce Fields wrote:
>>> On Sun, Dec 04, 2011 at 03:48:16PM +0200, Benny Halevy wrote:
>>>> From: Benny Halevy <bhalevy@tonian.com>
>>>>
>>>> Signed-off-by: Benny Halevy <bhalevy@tonian.com>
>>>> ---
>>>>  fs/nfsd/bl_ops.c |    2 +-
>>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>>
>>>> diff --git a/fs/nfsd/bl_ops.c b/fs/nfsd/bl_ops.c
>>>> index 89249c4..4d2939e 100644
>>>> --- a/fs/nfsd/bl_ops.c
>>>> +++ b/fs/nfsd/bl_ops.c
>>>> @@ -57,7 +57,7 @@
>>>>  #endif
>>>>  
>>>>  
>>>> -typedef enum {True, False} boolean_t;
>>>> +typedef enum {False = 0, True = !False} boolean_t;
>>>
>>> Shouldn't we just use "bool"?
>>
>> Yes, in some cases. In others, the boolean status doesn't make sense
>> and I'd like to replace it with an integer.
> 
> I believe casts from bools to integers are defined to convert false and
> true to 0 and 1 respectively, so you should be fine.

True, but in several cases like layout_cache_fill_from* or extents_get
a single status bit hides errors I'd rather percolate up the stack.

I'm not diving into this right now because this code needs a overhaul
to allow memory allocation outside the lock.
I'm thinking of a dual pass implementation, doing a pass under the lock
to calculate how many items to allocate.  Doing the allocation after
releasing the (now mutex but better be spin) lock, and then running
through the list again under lock using the allocated memory.
The hard parts in this scheme are if the state of the layout changes and
we need more memory in the second pass.  In this case we'll need yet another
iteration for the remainder, rinse, wash, repeat.

Benny

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

  reply	other threads:[~2011-12-07 12:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-04 13:46 [PATCH 0/13] misc pnfsd patches Benny Halevy
2011-12-04 13:47 ` [PATCH 01/13] SQUASHME: pnfsd: add missing nfs4_unlock_state in nfs4_pnfs_return_layout Benny Halevy
2011-12-04 13:48 ` [PATCH 02/13] DEBUG: pnfsd: printouts Benny Halevy
2011-12-04 13:48 ` [PATCH 03/13] pnfsd-block: reverse boolean_t values so they make sense Benny Halevy
2011-12-06  2:10   ` J. Bruce Fields
2011-12-06 11:27     ` Benny Halevy
2011-12-06 11:56       ` J. Bruce Fields
2011-12-07 12:45         ` Benny Halevy [this message]
2011-12-04 13:48 ` [PATCH 04/13] pnfsd-block: mv include/linux/nfsd4_block.h include/linux/nfsd/ Benny Halevy
2011-12-06  2:12   ` J. Bruce Fields
2011-12-06 11:28     ` Benny Halevy
2011-12-04 13:48 ` [PATCH 05/13] pnfsd-block: do not override s_pnfs_op Benny Halevy
2011-12-04 13:48 ` [PATCH 06/13] pnfsd-block: change blr_lock to mutex Benny Halevy
2011-12-04 13:49 ` [PATCH 07/13] pnfsd-block: dprint fiemap rval Benny Halevy
2011-12-04 13:49 ` [PATCH 08/13] pnfsd-block: allow positive " Benny Halevy
2011-12-04 13:49 ` [PATCH 09/13] pnfsd-block: use SECT_SIZE helper macros Benny Halevy
2011-12-04 13:49 ` [PATCH 10/13] pnfsd-block: undo dependence on spnfs Benny Halevy
2011-12-04 13:50 ` [PATCH 11/13] pnfsd-block: set the sbid part of the deviceid Benny Halevy
2011-12-04 13:50 ` [PATCH 12/13] DEBUG: pnfs: printouts Benny Halevy
2011-12-04 13:50 ` [PATCH 13/13] DEBUG: pnfsblock: add devid debug printouts Benny Halevy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EDF5FF0.90904@tonian.com \
    --to=bhalevy@tonian.com \
    --cc=benny@tonian.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).