All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@tonian.com>
To: Tigran Mkrtchyan <kofemann@googlemail.com>
Cc: linux-nfs@vger.kernel.org, bfields@fieldses.org,
	Tigran Mkrtchyan <kofemann@gmail.com>
Subject: Re: [PATH v8 10/10] nfsd41: use current stateid by value
Date: Mon, 13 Feb 2012 10:25:08 +0200	[thread overview]
Message-ID: <4F38C8E4.6080901@tonian.com> (raw)
In-Reply-To: <1328461679-4108-11-git-send-email-tigran.mkrtchyan@desy.de>

Sorry for the late response...
If not committed yet, please fix the macros below.

Otherwise

Benny

On 2012-02-05 19:07, Tigran Mkrtchyan wrote:
> diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h
> index 2ae378e..4ee102a 100644
> --- a/fs/nfsd/xdr4.h
> +++ b/fs/nfsd/xdr4.h
> @@ -43,6 +43,13 @@
>  #define NFSD4_MAX_TAGLEN	128
>  #define XDR_LEN(n)                     (((n) + 3) & ~3)
>  
> +#define CURRENT_STATE_ID_FLAG 1
> +#define SAVED_STATE_ID_FLAG 2

while at it, I'd rather define the flags as (1 << 0), (1 << 1)
to stress the fact they are bit values.

> +
> +#define SET_STATE_ID(c, f) (c->sid_flags |= f)
> +#define HAS_STATE_ID(c, f) (c->sid_flags & f)
> +#define CLEAR_STATE_ID(c, f) (c->sid_flags &=  ~f)

parenthesis must be used when using the macro arguments
(important mainly for the last one, using the unary operator on the arg)

+#define SET_STATE_ID(c, f) ((c)->sid_flags |= (f))
+#define HAS_STATE_ID(c, f) ((c)->sid_flags & (f))
+#define CLEAR_STATE_ID(c, f) ((c)->sid_flags &= ~(f))

or just use the set_bit() test_bit() clear_bit() interface :)

Benny

  reply	other threads:[~2012-02-13  8:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-05 17:07 [PATH v8 00/10] handle curruent stateid Tigran Mkrtchyan
2012-02-05 17:07 ` [PATH v8 01/10] nfsd4: initialize current stateid at compile time Tigran Mkrtchyan
2012-02-05 17:07 ` [PATH v8 02/10] nfsd41: handle current stateid in open and close Tigran Mkrtchyan
2012-02-05 17:07 ` [PATH v8 03/10] nfsd41: handle current stateid on lock and locku Tigran Mkrtchyan
2012-02-05 17:07 ` [PATH v8 04/10] nfsd41: consume current stateid on read and write Tigran Mkrtchyan
2012-02-05 17:07 ` [PATH v8 05/10] nfsd41: mark PUTFH, PUTPUBFH and PUTROOTFH to clear current stateid Tigran Mkrtchyan
2012-02-05 17:07 ` [PATH v8 06/10] nfsd41: save and restore current stateid with current fh Tigran Mkrtchyan
2012-02-05 17:07 ` [PATH v8 07/10] nfsd41: mark LOOKUP, LOOKUPP and CREATE to invalidate current stateid Tigran Mkrtchyan
2012-02-05 17:07 ` [PATH v8 08/10] nfsd41: handle current stateid in SETATTR and FREE_STATEID Tigran Mkrtchyan
2012-02-05 17:07 ` [PATH v8 09/10] nfsd41: consume current stateid on DELEGRETURN and OPENDOWNGRADE Tigran Mkrtchyan
2012-02-05 17:07 ` [PATH v8 10/10] nfsd41: use current stateid by value Tigran Mkrtchyan
2012-02-13  8:25   ` Benny Halevy [this message]
2012-02-14 14:02     ` Tigran Mkrtchyan
2012-02-17 22:05 ` [PATH v8 00/10] handle curruent stateid J. Bruce Fields

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=4F38C8E4.6080901@tonian.com \
    --to=bhalevy@tonian.com \
    --cc=bfields@fieldses.org \
    --cc=kofemann@gmail.com \
    --cc=kofemann@googlemail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.