Re: [PATH v8 10/10] nfsd41: use current stateid by value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 13, 2012 at 9:25 AM, Benny Halevy <bhalevy@xxxxxxxxxx> wrote:
> 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 :)
set_bit() test_bit() clear_bit() operates on unsigned long int * which
is not the case here.

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


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux