summaryrefslogtreecommitdiff
path: root/fs/ext4/ext4_write.c
diff options
context:
space:
mode:
authorSuriyan Ramasami <suriyan.r@gmail.com>2014-11-17 14:39:36 -0800
committerTom Rini <trini@ti.com>2014-11-23 06:49:04 -0500
commit9f12cd0e062614e19734b2ab37842d387457c5e5 (patch)
tree81a892f216918c8a7904cd8adcc5a485f4f23288 /fs/ext4/ext4_write.c
parent1ad0b98a067a133c0e8a182649a76a4afd739594 (diff)
ext4: Prepare API change for files greater than 2GB
Change the internal EXT4 functions to use loff_t for offsets. Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com> Acked-by: Simon Glass <sjg@chromium.org> [trini: Update common/spl/spl_ext.c] Signed-off-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'fs/ext4/ext4_write.c')
-rw-r--r--fs/ext4/ext4_write.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/fs/ext4/ext4_write.c b/fs/ext4/ext4_write.c
index 648a59672c..f7c52cc4cc 100644
--- a/fs/ext4/ext4_write.c
+++ b/fs/ext4/ext4_write.c
@@ -975,3 +975,35 @@ fail:
return -1;
}
+
+int ext4_write_file(const char *filename, void *buf, loff_t offset,
+ loff_t len, loff_t *actwrite)
+{
+ int ret;
+
+ if (offset != 0) {
+ printf("** Cannot support non-zero offset **\n");
+ 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();
+
+ return 0;
+
+fail:
+ ext4fs_close();
+
+ return -1;
+}