common: Drop uuid.h from common header
[oweals/u-boot.git] / fs / btrfs / btrfs.c
index 4140e2bc206bd819c30de2eb838b2a83ac963a4b..2e3985e38556795f1c324d45a3e43d8b527d139f 100644 (file)
@@ -1,14 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * BTRFS filesystem implementation for U-Boot
  *
  * 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include "btrfs.h"
 #include <config.h>
 #include <malloc.h>
+#include <uuid.h>
 #include <linux/time.h>
 
 struct btrfs_info btrfs_info;
@@ -120,17 +120,17 @@ int btrfs_ls(const char *path)
 
        if (inr == -1ULL) {
                printf("Cannot lookup path %s\n", path);
-               return 1;
+               return -1;
        }
 
        if (type != BTRFS_FT_DIR) {
                printf("Not a directory: %s\n", path);
-               return 1;
+               return -1;
        }
 
        if (btrfs_readdir(&root, inr, readdir_callback)) {
                printf("An error occured while listing directory %s\n", path);
-               return 1;
+               return -1;
        }
 
        return 0;
@@ -159,12 +159,12 @@ int btrfs_size(const char *file, loff_t *size)
 
        if (inr == -1ULL) {
                printf("Cannot lookup file %s\n", file);
-               return 1;
+               return -1;
        }
 
        if (type != BTRFS_FT_REG_FILE) {
                printf("Not a regular file: %s\n", file);
-               return 1;
+               return -1;
        }
 
        *size = inode.size;
@@ -184,12 +184,12 @@ int btrfs_read(const char *file, void *buf, loff_t offset, loff_t len,
 
        if (inr == -1ULL) {
                printf("Cannot lookup file %s\n", file);
-               return 1;
+               return -1;
        }
 
        if (type != BTRFS_FT_REG_FILE) {
                printf("Not a regular file: %s\n", file);
-               return 1;
+               return -1;
        }
 
        if (!len)
@@ -201,7 +201,7 @@ int btrfs_read(const char *file, void *buf, loff_t offset, loff_t len,
        rd = btrfs_file_read(&root, inr, offset, len, buf);
        if (rd == -1ULL) {
                printf("An error occured while reading file %s\n", file);
-               return 1;
+               return -1;
        }
 
        *actread = rd;
@@ -221,7 +221,3 @@ int btrfs_uuid(char *uuid_str)
 #endif
        return -ENOSYS;
 }
-
-/*
-               btrfs_list_subvols();
-*/