Why use plain numbers and totals rather than predef'd constants for RPC sizes?

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

 



Viacheslav Dubeyko <Slava.Dubeyko@xxxxxxx> wrote:

> > -	dbuf = ceph_databuf_reply_alloc(1, 8 + sizeof(struct ceph_timespec), GFP_NOIO);
> > -	if (!dbuf)
> > +	request = ceph_databuf_reply_alloc(1, 8 + sizeof(struct ceph_timespec), GFP_NOIO);
> 
> Ditto. Why do we have 8 + sizeof(struct ceph_timespec) here?

Because that's the size of the composite protocol element.

As to why it's using a total of plain integers and sizeofs rather than
constant macros, Ilya is the person to ask according to git blame;-).

I would probably prefer sizeof(__le64) here over 8, but I didn't want to
change it too far from the existing code.

If you want macro constants for these sorts of things, someone else who knows
the protocol better needs to do that.  You could probably write something to
generate them (akin to rpcgen).

David






[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux