fs: API changes enabling extra parameter to return size of type loff_t

The sandbox/ext4/fat/generic fs commands do not gracefully deal with files
greater than 2GB. Negative values are returned in such cases.

To handle this, the fs functions have been modified to take an additional
parameter of type "* loff_t" which is then populated. The return value
of the fs functions are used only for error conditions.

Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
[trini: Update board/gdsys/p1022/controlcenterd-id.c,
drivers/fpga/zynqpl.c for changes]
Signed-off-by: Tom Rini <trini@ti.com>
diff --git a/fs/ext4/ext4fs.c b/fs/ext4/ext4fs.c
index d82266f..943b5bc 100644
--- a/fs/ext4/ext4fs.c
+++ b/fs/ext4/ext4fs.c
@@ -184,16 +184,9 @@
 	return ret == 0;
 }
 
-int ext4fs_size(const char *filename)
+int ext4fs_size(const char *filename, loff_t *size)
 {
-	loff_t	size;
-	int ret;
-
-	ret = ext4fs_open(filename, &size);
-	if (ret)
-		return ret;
-	else
-		return size;
+	return ext4fs_open(filename, size);
 }
 
 int ext4fs_read(char *buf, loff_t len, loff_t *actread)
@@ -217,10 +210,10 @@
 	return 0;
 }
 
-int ext4_read_file(const char *filename, void *buf, int offset, int len)
+int ext4_read_file(const char *filename, void *buf, loff_t offset, loff_t len,
+		   loff_t *len_read)
 {
 	loff_t file_len;
-	loff_t len_read;
 	int ret;
 
 	if (offset != 0) {
@@ -237,12 +230,7 @@
 	if (len == 0)
 		len = file_len;
 
-	ret = ext4fs_read(buf, len, &len_read);
-
-	if (ret)
-		return ret;
-	else
-		return len_read;
+	return ext4fs_read(buf, len, len_read);
 }
 
 int ext4fs_uuid(char *uuid_str)