[OpenWrt-Devel,fstools] blockd: report "target" path as "mount" for autofs available mounts
diff mbox series

Message ID 20191227120911.9236-1-zajec5@gmail.com
State Under Review
Delegated to: Rafał Miłecki
Headers show
Series
  • [OpenWrt-Devel,fstools] blockd: report "target" path as "mount" for autofs available mounts
Related show

Commit Message

Rafał Miłecki Dec. 27, 2019, 12:09 p.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

Devices handled with autofs should be seen as available even if
currently unmounted. Mounting is handled on demand and transparently for
users.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 blockd.c | 2 ++
 1 file changed, 2 insertions(+)

Patch
diff mbox series

diff --git a/blockd.c b/blockd.c
index e07530c..ba4afdd 100644
--- a/blockd.c
+++ b/blockd.c
@@ -283,6 +283,8 @@  block_info(struct ubus_context *ctx, struct ubus_object *obj,
 		if (mp) {
 			blobmsg_add_string(&bb, "mount", mp);
 			free(mp);
+		} else if (device->autofs && device->target) {
+			blobmsg_add_string(&bb, "mount", device->target);
 		}
 		blobmsg_close_table(&bb, t);
 	}