On Tue, May 17, 2011 at 8:43 PM, Venkateswararao Jujjuri (JV) <jv...@linux.vnet.ibm.com> wrote: > -/* Size of each dirent on the wire: size of qid (13) + size of offset (8) > +/* > + * Size of each dirent on the wire: size of qid (13) + size of offset (8) > * size of type (1) + size of name.size (2) + strlen(name.data) > */ > -#define V9_READDIR_DATA_SZ (24 + strlen(vs->name.data)) > +#define V9_READDIR_DATA_SZ (24 + strlen(name.data))
This should look like a function, not like a constant: static size_t v9fs_readdir_data_size(V9fsString *name) { /* * Size of each dirent on the wire: size of qid (13) + size of offset (8) * size of type (1) + size of name.size (2) + strlen(name.data) */ return 24 + v9fs_string_size(name); } Stefan