Merge branch 'rmobile' of git://git.denx.de/u-boot-sh
[oweals/u-boot.git] / fs / ext4 / ext4_write.c
index f7c52cc4cc1493c81d4a2467a67196a3df6eaf07..e027916763f9b52937c7fe13f1698b67b94eb901 100644 (file)
@@ -23,6 +23,7 @@
 
 
 #include <common.h>
+#include <memalign.h>
 #include <linux/stat.h>
 #include <div64.h>
 #include "ext4_common.h"
@@ -986,24 +987,18 @@ int ext4_write_file(const char *filename, void *buf, loff_t offset,
                return -1;
        }
 
-       /* mount the filesystem */
-       if (!ext4fs_mount(0)) {
-               printf("** Error Bad ext4 partition **\n");
-               goto fail;
-       }
-
        ret = ext4fs_write(filename, buf, len);
-
        if (ret) {
                printf("** Error ext4fs_write() **\n");
                goto fail;
        }
-       ext4fs_close();
+
+       *actwrite = len;
 
        return 0;
 
 fail:
-       ext4fs_close();
+       *actwrite = 0;
 
        return -1;
 }