{
int ret;
- if ( !leaf->content )
+ if ( !leaf->u.content )
ret = -EINVAL;
else
ret = add_entry(parent, &leaf->e);
l = container_of(entry, const struct hypfs_entry_leaf, e);
- return copy_to_guest(uaddr, l->content, entry->size) ? -EFAULT: 0;
+ return copy_to_guest(uaddr, l->u.content, entry->size) ? -EFAULT: 0;
}
static int hypfs_read(const struct hypfs_entry *entry,
goto out;
ret = 0;
- memcpy(leaf->write_ptr, buf, ulen);
+ memcpy(leaf->u.write_ptr, buf, ulen);
leaf->e.size = ulen;
out:
if ( copy_from_guest(&buf, uaddr, ulen) )
return -EFAULT;
- *(bool *)leaf->write_ptr = buf;
+ *(bool *)leaf->u.write_ptr = buf;
return 0;
}
union {
const void *content;
void *write_ptr;
- };
+ } u;
};
struct hypfs_entry_dir {
static inline void hypfs_string_set_reference(struct hypfs_entry_leaf *leaf,
const char *str)
{
- leaf->content = str;
+ leaf->u.content = str;
leaf->e.size = strlen(str) + 1;
}
.e.max_size = (wr) ? sizeof(contvar) : 0, \
.e.read = hypfs_read_leaf, \
.e.write = (wr), \
- .content = &(contvar), \
+ .u.content = &(contvar), \
}
#define HYPFS_UINT_INIT(var, nam, contvar) \