> +#ifndef CONFIG_INOTIFY1
> +/* Assumes that children, if any, have been already freed */
> +static void usb_mtp_object_free_one(MTPState *s, MTPObject *o)
> +{
> + assert(o->nchildren == 0);
> + QTAILQ_REMOVE(&s->objects, o, next);
> + g_free(o->name);
> + g_free(o->path);
> + g_free(o);
> +}
> +#endif
I'd suggest to move the #ifdef into the function, so it can be called
unconditinally. Also #else /* not needed with inotify because ... */
would be nice.
> +#ifndef CONFIG_INOTIFY1
> + usb_mtp_object_free_one(s, o);
> +#endif
These ifdefs can be dropped then.
> + /* Mark store as RW */
> + s->flags |= (1 << MTP_FLAG_WRITABLE);
Do we want a property to enable write support?
cheers,
Gerd