linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Namjae Jeon <linkinjeon@gmail.com>
Cc: hirofumi@mail.parknet.co.jp, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Namjae Jeon <namjae.jeon@samsung.com>,
	Amit Sahrawat <a.sahrawat@samsung.com>
Subject: Re: [PATCH v5] fat: editions to support fat_fallocate
Date: Mon, 22 Apr 2013 15:03:02 -0700	[thread overview]
Message-ID: <20130422150302.d01a3edb005a79bd68929d38@linux-foundation.org> (raw)
In-Reply-To: <1366293255-4649-1-git-send-email-linkinjeon@gmail.com>

On Thu, 18 Apr 2013 22:54:15 +0900 Namjae Jeon <linkinjeon@gmail.com> wrote:

> Change Log:
> v5: change to avoid compilation warning:
>   fs/fat/inode.c: In function 'fat_zero_falloc_area':
> >> fs/fat/inode.c:169:11: warning: comparison of distinct pointer
> types lacks a cast [enabled by default]

The patch does more than that - here's the v4->v5 delta:

--- a/fs/fat/file.c~fat-additions-to-support-fat_fallocate-v5
+++ a/fs/fat/file.c
@@ -153,7 +153,6 @@ static int fat_file_release(struct inode
 	 */
 	mutex_lock(&inode->i_mutex);
 	mmu_private_ideal = round_up(inode->i_size, sb->s_blocksize);
-
 	if (mmu_private_ideal < MSDOS_I(inode)->mmu_private &&
 	    filp->f_dentry->d_count == 1)
 		fat_truncate_blocks(inode, inode->i_size);
@@ -231,7 +230,6 @@ static int fat_cont_expand(struct inode
 out:
 	return err;
 }
-
 /*
  * Preallocate space for a file. This implements fat's fallocate file
  * operation, which gets called from sys_fallocate system call. User
@@ -281,10 +279,8 @@ static long fat_fallocate(struct file *f
 						      sbi->cluster_bits;
 		} else
 			nr_bytes = offset + len - inode->i_size;
-
 		nr_cluster = (nr_bytes + (sbi->cluster_size - 1)) >>
 			     sbi->cluster_bits;
-
 		/* Start the allocation.We are not zeroing out the clusters */
 		while (nr_cluster-- > 0) {
 			err = fat_alloc_clusters(inode, &cluster, 1);
@@ -308,12 +304,10 @@ static long fat_fallocate(struct file *f
 				"fat_fallocate(): fat_cont_expand() error");
 		}
 	}
-
 error:
 	mutex_unlock(&inode->i_mutex);
 	return err;
 }
-
 /* Free all clusters after the skip'th cluster. */
 static int fat_free(struct inode *inode, int skip)
 {
--- a/fs/fat/inode.c~fat-additions-to-support-fat_fallocate-v5
+++ a/fs/fat/inode.c
@@ -166,7 +166,7 @@ static int fat_zero_falloc_area(struct f
 
 		offset = (curpos & (PAGE_CACHE_SIZE - 1));
 		bytes = PAGE_CACHE_SIZE - offset;
-		bytes = min(bytes, count);
+		bytes = min_t(size_t, bytes, count);
 
 		err = pagecache_write_begin(NULL, mapping, curpos, bytes,
 					AOP_FLAG_UNINTERRUPTIBLE,

The whitespace changes are mostly dubious and the ones which remove the
newline after a function's final brace are simply wrong.  The min_t
change is unneeded - it's better to make the type of `bytes' size_t. 
So I shall skip v5.

BTW, I don't intend to send this patch into Linus until I have
heard from hirofumi.  Please let me know if he has already reviewed
and acked it?

  reply	other threads:[~2013-04-22 22:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-18 13:54 [PATCH v5] fat: editions to support fat_fallocate Namjae Jeon
2013-04-22 22:03 ` Andrew Morton [this message]
2013-04-23  5:33   ` Namjae Jeon
2013-04-23  6:54     ` OGAWA Hirofumi

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=20130422150302.d01a3edb005a79bd68929d38@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=a.sahrawat@samsung.com \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linkinjeon@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namjae.jeon@samsung.com \
    /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).