Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d0aed7a authored by Jens Axboe's avatar Jens Axboe
Browse files

do_mounts: only enable PARTUUID for CONFIG_BLOCK



When CONFIG_BLOCK is not enabled:

init/do_mounts.c:71: error: implicit declaration of function 'dev_to_part'
init/do_mounts.c:71: warning: initialization makes pointer from integer without a cast
init/do_mounts.c:73: error: dereferencing pointer to incomplete type
init/do_mounts.c:76: error: dereferencing pointer to incomplete type
init/do_mounts.c:76: error: dereferencing pointer to incomplete type
init/do_mounts.c:102: error: implicit declaration of function 'part_pack_uuid'
init/do_mounts.c:104: error: 'block_class' undeclared (first use in this function)

Reported-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
parent 01ea5063
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ static int __init readwrite(char *str)
__setup("ro", readonly);
__setup("rw", readwrite);

#ifdef CONFIG_BLOCK
/**
 * match_dev_by_uuid - callback for finding a partition using its uuid
 * @dev:	device passed in by the caller
@@ -111,6 +112,7 @@ static dev_t __init devt_from_partuuid(char *uuid_str)
done:
	return res;
}
#endif

/*
 *	Convert a name into device number.  We accept the following variants:
@@ -138,6 +140,7 @@ dev_t name_to_dev_t(char *name)
	dev_t res = 0;
	int part;

#ifdef CONFIG_BLOCK
	if (strncmp(name, "PARTUUID=", 9) == 0) {
		name += 9;
		if (strlen(name) != 36)
@@ -147,6 +150,7 @@ dev_t name_to_dev_t(char *name)
			goto fail;
		goto done;
	}
#endif

	if (strncmp(name, "/dev/", 5) != 0) {
		unsigned maj, min;