lkml.org 
[lkml]   [2009]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 02/21] ceph: on-wire types
From
Date
On Tue, 2009-09-22 at 10:38 -0700, Sage Weil wrote:
> These headers describe the types used to exchange messages between the
> Ceph client and various servers. All types are little-endian and
> packed.
[]
> diff --git a/fs/ceph/ceph_fs.h b/fs/ceph/ceph_fs.h
> new file mode 100644
> index 0000000..15150fc
> --- /dev/null
> +++ b/fs/ceph/ceph_fs.h
[]
> +static inline __u32 frag_make(__u32 b, __u32 v)
> +{
> + return (b << 24) |
> + (v & (0xffffffu << (24-b)) & 0xffffffu);
> +}

frag_<foo> inlines might have a conflict with ipv6

> +static inline const char *ceph_mds_state_name(int s)
> +{
> + switch (s) {
[]
> + case CEPH_MDS_STATE_STOPPING: return "up:stopping";
> + default: return "";
> + }
> + return NULL;
> +}

inline?

It's probably better not to use inlines here
as the strings could be duplicated unnecessarily.

> +static inline const char *ceph_mds_op_name(int op)
> +{
> + switch (op) {
[]
> + default: return "???";
> + }
> +}

inline again and a couple of different styles for these
switch blocks are used as well. Perhaps remove the
default: case and use return ""; as the last statement.

> +static inline const char *ceph_cap_op_name(int op)
> +{
> +}
> +static inline const char *ceph_lease_op_name(int o)
> +static inline const char *ceph_snap_op_name(int o)
> --- /dev/null
> +++ b/fs/ceph/rados.h
> +static inline const char *ceph_osd_op_name(int op)

more inlines.



\
 
 \ /
  Last update: 2009-09-22 20:03    [W:0.169 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site