[U-Boot] [PATCH v2 2/4] ubifs: Add functions for generic fs use

Stephen Warren
2015-09-01T19:57:27Z

On 08/22/2015 11:04 AM, Hans de Goede wrote:
> Implement the necessary functions for implementing generic fs support
> for ubifs.

> diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c

> +int ubifs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info)
> +{
> + /* Check that ubifs is mounted and that we are not being a blkdev */
> + if (!ubifs_mounted) {
> + printf("UBIFS not mounted, use ubifsmount to mount volume first!\n");
> + return -1;
> + }
> +
> + if (rbdd) {
> + printf("UBIFS cannot be used with normal block devices\n");
> + return -1;
> + }
> +
> + return 0;
> +}

I think those printf() should be debug(). Otherwise, if (a) someone
attempts to run generic filesystem commands on a device with no
filesystem or (b) we add new filesystems into fstypes[] after ubifs,
those prints are going to happen even though a user didn't do something
to explicitly cause a ubifs-related issue.