libubi: add volume flags to ubi_mkvol_request
authorQuentin Schulz <quentin.schulz@bootlin.com>
Thu, 28 Jun 2018 07:43:42 +0000 (09:43 +0200)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Thu, 28 Jun 2018 08:21:51 +0000 (10:21 +0200)
Now that we have per-UBI volume flags (for instance for skipping CRC
check when opening it) from the Linux header, let's add it to the
ubi_mkvol_request in libubi and assign the flags to ubi_mkvol_req from
the Linux header from ubi_mkvol.

Suggested-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
include/libubi.h
lib/libubi.c

index 4d6a7ee191a8f5e13d9e4be1d83a0620f294a1d4..46596a308f9e59c290000f8482ec604dab746f7c 100644 (file)
@@ -69,6 +69,7 @@ struct ubi_attach_request
  * @bytes: volume size in bytes
  * @vol_type: volume type (%UBI_DYNAMIC_VOLUME or %UBI_STATIC_VOLUME)
  * @name: volume name
+ * @flags: volume flags
  */
 struct ubi_mkvol_request
 {
@@ -77,6 +78,7 @@ struct ubi_mkvol_request
        long long bytes;
        int vol_type;
        const char *name;
+       uint8_t flags;
 };
 
 /**
index 978b433e46975c005c3259762832369969573a9a..4322a19e6859826e0b9013eb1a5ca1a26d4ec8d3 100644 (file)
@@ -1000,6 +1000,7 @@ int ubi_mkvol(libubi_t desc, const char *node, struct ubi_mkvol_request *req)
        r.alignment = req->alignment;
        r.bytes = req->bytes;
        r.vol_type = req->vol_type;
+       r.flags = req->flags;
 
        n = strlen(req->name);
        if (n > UBI_MAX_VOLUME_NAME)