mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Badari Pulavarty <pbadari@us.ibm.com>
To: akpm@osdl.org, lkml <linux-kernel@vger.kernel.org>, hch@lst.de
Subject: [PATCH] generic_file_write_nolock cleanup
Date: Mon, 30 Jan 2006 08:56:05 -0800	[thread overview]
Message-ID: <1138640165.28382.3.camel@dyn9047017102.beaverton.ibm.com> (raw)

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

Hi,

generic_file_write_nolock() and __generic_file_write_nolock() seems
to be doing exactly same thing. Why do we have 2 of these ? 
Can we kill __generic_file_write_nolock() ?

Here is the patch.

Thanks,
Badari



[-- Attachment #2: generic_file_write_nolock-cleanup.patch --]
[-- Type: text/x-patch, Size: 1421 bytes --]

Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
--- linux.org/mm/filemap.c	2006-01-16 23:44:47.000000000 -0800
+++ linux/mm/filemap.c	2006-01-30 08:51:04.000000000 -0800
@@ -2155,20 +2155,6 @@ generic_file_aio_write_nolock(struct kio
 	return ret;
 }
 
-static ssize_t
-__generic_file_write_nolock(struct file *file, const struct iovec *iov,
-				unsigned long nr_segs, loff_t *ppos)
-{
-	struct kiocb kiocb;
-	ssize_t ret;
-
-	init_sync_kiocb(&kiocb, file);
-	ret = __generic_file_aio_write_nolock(&kiocb, iov, nr_segs, ppos);
-	if (ret == -EIOCBQUEUED)
-		ret = wait_on_sync_kiocb(&kiocb);
-	return ret;
-}
-
 ssize_t
 generic_file_write_nolock(struct file *file, const struct iovec *iov,
 				unsigned long nr_segs, loff_t *ppos)
@@ -2222,7 +2208,7 @@ ssize_t generic_file_write(struct file *
 					.iov_len = count };
 
 	mutex_lock(&inode->i_mutex);
-	ret = __generic_file_write_nolock(file, &local_iov, 1, ppos);
+	ret = generic_file_write_nolock(file, &local_iov, 1, ppos);
 	mutex_unlock(&inode->i_mutex);
 
 	if (ret > 0 && ((file->f_flags & O_SYNC) || IS_SYNC(inode))) {
@@ -2258,7 +2244,7 @@ ssize_t generic_file_writev(struct file 
 	ssize_t ret;
 
 	mutex_lock(&inode->i_mutex);
-	ret = __generic_file_write_nolock(file, iov, nr_segs, ppos);
+	ret = generic_file_write_nolock(file, iov, nr_segs, ppos);
 	mutex_unlock(&inode->i_mutex);
 
 	if (ret > 0 && ((file->f_flags & O_SYNC) || IS_SYNC(inode))) {

             reply	other threads:[~2006-01-30 16:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-30 16:56 Badari Pulavarty [this message]
2006-01-30 17:20 ` Hugh Dickins
2006-01-30 18:07   ` Badari Pulavarty

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=1138640165.28382.3.camel@dyn9047017102.beaverton.ibm.com \
    --to=pbadari@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=hch@lst.de \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®