Skip to content

Commit

Permalink
do_mounts: only enable PARTUUID for CONFIG_BLOCK
Browse files Browse the repository at this point in the history
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: Randy Dunlap <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Jens Axboe committed Sep 17, 2010
1 parent 01ea506 commit 6d0aed7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions init/do_mounts.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand All @@ -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;
Expand Down

0 comments on commit 6d0aed7

Please sign in to comment.