reiserfs-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brandon Berhent <cheater1034@gmail.com>
To: reiserfs-devel@vger.kernel.org
Subject: Fix reiser4 compile warnings
Date: Sat, 12 Sep 2009 23:34:00 -0400	[thread overview]
Message-ID: <9bb377710909122034mb8da551x299032990230efe0@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 853 bytes --]

Please check the attached patch for correctness

It fixes the following warnings on compile:
  CC      fs/reiser4/plugin/compress/compress.o
fs/reiser4/plugin/compress/compress.c: In function ‘lzo1_compress’:
fs/reiser4/plugin/compress/compress.c:289: warning: passing argument 4
of ‘lzo1x_1_compress’ from incompatible pointer type
fs/reiser4/plugin/compress/compress.c: In function ‘lzo1_decompress’:
fs/reiser4/plugin/compress/compress.c:313: warning: passing argument 4
of ‘lzo1x_decompress_safe’ from incompatible pointer type
  CC      fs/reiser4/plugin/item/item.o
fs/reiser4/plugin/item/item.c:556: warning: initialization from
incompatible pointer type
fs/reiser4/plugin/item/item.c:609: warning: initialization from
incompatible pointer type

I am not the original other of this patch, please consider it if it is
correct :)

[-- Attachment #2: r4-fix-compile-warnings.diff --]
[-- Type: text/x-diff, Size: 4423 bytes --]

diff --git a/fs/reiser4/plugin/compress/compress.c b/fs/reiser4/plugin/compress/compress.c
index 99f3107..8284e36 100644
--- a/fs/reiser4/plugin/compress/compress.c
+++ b/fs/reiser4/plugin/compress/compress.c
@@ -122,8 +122,8 @@ static int gzip1_min_size_deflate(void)
 }
 
 static void
-gzip1_compress(coa_t coa, __u8 * src_first, unsigned src_len,
-	       __u8 * dst_first, unsigned *dst_len)
+gzip1_compress(coa_t coa, __u8 * src_first, size_t src_len,
+	       __u8 * dst_first, size_t *dst_len)
 {
 #if REISER4_ZLIB
 	int ret = 0;
@@ -166,8 +166,8 @@ gzip1_compress(coa_t coa, __u8 * src_first, unsigned src_len,
 }
 
 static void
-gzip1_decompress(coa_t coa, __u8 * src_first, unsigned src_len,
-		 __u8 * dst_first, unsigned *dst_len)
+gzip1_decompress(coa_t coa, __u8 * src_first, size_t src_len,
+		 __u8 * dst_first, size_t *dst_len)
 {
 #if REISER4_ZLIB
 	int ret = 0;
@@ -278,8 +278,8 @@ static int lzo1_min_size_deflate(void)
 }
 
 static void
-lzo1_compress(coa_t coa, __u8 * src_first, unsigned src_len,
-	      __u8 * dst_first, unsigned *dst_len)
+lzo1_compress(coa_t coa, __u8 * src_first, size_t src_len,
+	      __u8 * dst_first, size_t *dst_len)
 {
 	int result;
 
@@ -302,8 +302,8 @@ lzo1_compress(coa_t coa, __u8 * src_first, unsigned src_len,
 }
 
 static void
-lzo1_decompress(coa_t coa, __u8 * src_first, unsigned src_len,
-		__u8 * dst_first, unsigned *dst_len)
+lzo1_decompress(coa_t coa, __u8 * src_first, size_t src_len,
+		__u8 * dst_first, size_t *dst_len)
 {
 	int result;
 
diff --git a/fs/reiser4/plugin/file/cryptcompress.c b/fs/reiser4/plugin/file/cryptcompress.c
index d7a9101..35a6833 100644
--- a/fs/reiser4/plugin/file/cryptcompress.c
+++ b/fs/reiser4/plugin/file/cryptcompress.c
@@ -1014,7 +1014,7 @@ int reiser4_deflate_cluster(struct cluster_handle * clust, struct inode * inode)
 	coplug = inode_compression_plugin(inode);
 	if (should_compress(tc, clust->index, inode)) {
 		/* try to compress, discard bad results */
-		__u32 dst_len;
+		size_t dst_len;
 		compression_mode_plugin * mplug =
 			inode_compression_mode_plugin(inode);
 		assert("edward-602", coplug != NULL);
@@ -1164,7 +1164,7 @@ int reiser4_inflate_cluster(struct cluster_handle * clust, struct inode * inode)
 		transformed = 1;
 	}
 	if (need_inflate(clust, inode, 0)) {
-		unsigned dst_len = inode_cluster_size(inode);
+		size_t dst_len = inode_cluster_size(inode);
 		if(transformed)
 			alternate_streams(tc);
 
diff --git a/fs/reiser4/plugin/file/file_conversion.c b/fs/reiser4/plugin/file/file_conversion.c
index bd6ea15..36a6d08 100644
--- a/fs/reiser4/plugin/file/file_conversion.c
+++ b/fs/reiser4/plugin/file/file_conversion.c
@@ -305,7 +305,7 @@ static int read_check_compressibility(struct inode * inode,
 {
 	int i;
 	int result;
-	__u32 dst_len;
+	size_t dst_len;
 	hint_t tmp_hint;
 	hint_t * cur_hint = clust->hint;
 	assert("edward-1541", cont->state == PSCHED_SCHED_POINT);
diff --git a/fs/reiser4/plugin/item/item.h b/fs/reiser4/plugin/item/item.h
index 864edae..5998701 100644
--- a/fs/reiser4/plugin/item/item.h
+++ b/fs/reiser4/plugin/item/item.h
@@ -233,8 +233,8 @@ struct dir_entry_iops {
 
 /* operations specific to items regular (unix) file metadata are built of */
 struct file_iops{
-	int (*write) (struct file *, struct inode *,
-		      const char __user *, size_t, loff_t *pos);
+	ssize_t (*write) (struct file *, struct inode *,
+			  const char __user *, size_t, loff_t *pos);
 	int (*read) (struct file *, flow_t *, hint_t *);
 	int (*readpage) (void *, struct page *);
 	int (*get_block) (const coord_t *, sector_t, sector_t *);
diff --git a/fs/reiser4/plugin/plugin.h b/fs/reiser4/plugin/plugin.h
index 76ef56c..82fa66a 100644
--- a/fs/reiser4/plugin/plugin.h
+++ b/fs/reiser4/plugin/plugin.h
@@ -560,10 +560,10 @@ typedef struct compression_plugin {
 	int (*min_size_deflate) (void);
 	 __u32(*checksum) (char *data, __u32 length);
 	/* main transform procedures */
-	void (*compress) (coa_t coa, __u8 *src_first, unsigned src_len,
-			  __u8 *dst_first, unsigned *dst_len);
-	void (*decompress) (coa_t coa, __u8 *src_first, unsigned src_len,
-			    __u8 *dst_first, unsigned *dst_len);
+	void (*compress) (coa_t coa, __u8 *src_first, size_t src_len,
+			  __u8 *dst_first, size_t *dst_len);
+	void (*decompress) (coa_t coa, __u8 *src_first, size_t src_len,
+			    __u8 *dst_first, size_t *dst_len);
 } compression_plugin;
 
 typedef struct compression_mode_plugin {

             reply	other threads:[~2009-09-13  3:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-13  3:34 Brandon Berhent [this message]
2009-09-23 22:16 ` Fix reiser4 compile warnings Edward Shishkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9bb377710909122034mb8da551x299032990230efe0@mail.gmail.com \
    --to=cheater1034@gmail.com \
    --cc=reiserfs-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).