Btrfs-progs: fix compile warning in is_ssd()
mkfs.c: In function ‘is_ssd’: mkfs.c:1168:26: warning: ignoring return value of ‘blkid_devno_to_wholedisk’, declared with attribute warn_unused_result [-Wunused-result] blkid_devno_to_wholedisk(devno, wholedisk, sizeof(wholedisk), NULL); Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This commit is contained in:
parent
cdbc107292
commit
36dcac288e
8
mkfs.c
8
mkfs.c
|
@ -1150,6 +1150,7 @@ static int is_ssd(const char *file)
|
|||
dev_t devno;
|
||||
int fd;
|
||||
char rotational;
|
||||
int ret;
|
||||
|
||||
probe = blkid_new_probe_from_filename(file);
|
||||
if (!probe)
|
||||
|
@ -1161,7 +1162,12 @@ static int is_ssd(const char *file)
|
|||
return 0;
|
||||
|
||||
/* Get whole disk name (not full path) for this devno */
|
||||
blkid_devno_to_wholedisk(devno, wholedisk, sizeof(wholedisk), NULL);
|
||||
ret = blkid_devno_to_wholedisk(devno,
|
||||
wholedisk, sizeof(wholedisk), NULL);
|
||||
if (ret) {
|
||||
blkid_free_probe(probe);
|
||||
return 0;
|
||||
}
|
||||
|
||||
snprintf(sysfs_path, PATH_MAX, "/sys/block/%s/queue/rotational",
|
||||
wholedisk);
|
||||
|
|
Loading…
Reference in New Issue