Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/libblockdev-sections.txt
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,18 @@ BD_LOOP_ERROR
BDLoopError
BDLoopInfo
bd_loop_info
bd_loop_info_from_fd
bd_loop_info_copy
bd_loop_info_free
bd_loop_get_loop_name
bd_loop_setup
bd_loop_setup_from_fd
bd_loop_teardown
bd_loop_teardown_from_fd
bd_loop_set_autoclear
bd_loop_set_autoclear_from_fd
bd_loop_set_capacity
bd_loop_set_capacity_from_fd
BDLoopTech
BDLoopTechMode
bd_loop_is_tech_avail
Expand Down
50 changes: 50 additions & 0 deletions src/lib/plugin_apis/loop.api
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,18 @@ GType bd_loop_info_get_type () {
*/
BDLoopInfo* bd_loop_info (const gchar *loop, GError **error);

/**
* bd_loop_info_from_fd:
* @fd: file descriptor of an open loop device to get information about
* @error: (out) (optional): place to store error (if any)
*
* Returns: (transfer full): information about the loop device represented by @fd
* or %NULL in case of error
*
* Tech category: %BD_LOOP_TECH_LOOP-%BD_LOOP_TECH_MODE_QUERY
*/
BDLoopInfo* bd_loop_info_from_fd (gint fd, GError **error);

/**
* bd_loop_get_loop_name:
* @file: path of the backing file to get loop name for
Expand Down Expand Up @@ -174,6 +186,17 @@ gboolean bd_loop_setup_from_fd (gint fd, guint64 offset, guint64 size, gboolean
*/
gboolean bd_loop_teardown (const gchar *loop, GError **error);

/**
* bd_loop_teardown_from_fd:
* @fd: file descriptor of an open loop device to tear down
* @error: (out) (optional): place to store error (if any)
*
* Returns: whether the loop device represented by @fd was successfully torn down or not
*
* Tech category: %BD_LOOP_TECH_LOOP-%BD_LOOP_TECH_MODE_DESTROY
*/
gboolean bd_loop_teardown_from_fd (gint fd, GError **error);

/**
* bd_loop_set_autoclear:
* @loop: path or name of the loop device
Expand All @@ -186,6 +209,19 @@ gboolean bd_loop_teardown (const gchar *loop, GError **error);
*/
gboolean bd_loop_set_autoclear (const gchar *loop, gboolean autoclear, GError **error);

/**
* bd_loop_set_autoclear_from_fd:
* @fd: file descriptor of an open loop device
* @autoclear: whether to set or unset the autoclear flag
* @error: (out) (optional): place to store error (if any)
*
* Returns: whether the autoclear flag was successfully set on the loop device
* represented by @fd or not
*
* Tech category: %BD_LOOP_TECH_LOOP-%BD_LOOP_TECH_MODE_MODIFY
*/
gboolean bd_loop_set_autoclear_from_fd (gint fd, gboolean autoclear, GError **error);

/**
* bd_loop_set_capacity:
* @loop: path or name of the loop device
Expand All @@ -200,4 +236,18 @@ gboolean bd_loop_set_autoclear (const gchar *loop, gboolean autoclear, GError **
*/
gboolean bd_loop_set_capacity (const gchar *loop, GError **error);

/**
* bd_loop_set_capacity_from_fd:
* @fd: file descriptor of an open loop device
* @error: (out) (optional): place to store error (if any)
*
* Force the loop driver to reread the size of the file associated with the loop
* device represented by @fd.
*
* Returns: whether the LOOP_SET_CAPACITY ioctl was successfully issued or not.
*
* Tech category: %BD_LOOP_TECH_LOOP-%BD_LOOP_TECH_MODE_MODIFY
*/
gboolean bd_loop_set_capacity_from_fd (gint fd, GError **error);

#endif /* BD_LOOP_API */
Loading
Loading