1 /* Part of libvboxfs - (c) 2012, D.C. van Moolenbroek */
6 * Get or set file information.
9 vboxfs_getset_info(vboxfs_handle_t handle
, u32_t flags
, void *data
,
12 vbox_param_t param
[5];
14 vbox_set_u32(¶m
[0], vboxfs_root
);
15 vbox_set_u64(¶m
[1], handle
);
16 vbox_set_u32(¶m
[2], flags
);
17 vbox_set_u32(¶m
[3], size
);
18 vbox_set_ptr(¶m
[4], data
, size
, VBOX_DIR_INOUT
);
20 return vbox_call(vboxfs_conn
, VBOXFS_CALL_INFO
, param
, 5, NULL
);
24 * Query volume information.
27 vboxfs_query_vol(char *path
, vboxfs_volinfo_t
*volinfo
)
32 if ((r
= vboxfs_open_file(path
, O_RDONLY
, 0, &h
, NULL
)) != OK
)
35 r
= vboxfs_getset_info(h
, VBOXFS_INFO_GET
| VBOXFS_INFO_VOLUME
,
36 volinfo
, sizeof(*volinfo
));
44 * Query volume information.
47 vboxfs_queryvol(char *path
, u64_t
*free
, u64_t
*total
)
49 vboxfs_volinfo_t volinfo
;
52 if ((r
= vboxfs_query_vol(path
, &volinfo
)) != OK
)
56 *total
= volinfo
.total
;