linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] generic_file_write_nolock cleanup
@ 2006-01-30 16:56 Badari Pulavarty
  2006-01-30 17:20 ` Hugh Dickins
  0 siblings, 1 reply; 3+ messages in thread
From: Badari Pulavarty @ 2006-01-30 16:56 UTC (permalink / raw)
  To: akpm, lkml, hch

[-- 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))) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] generic_file_write_nolock cleanup
  2006-01-30 16:56 [PATCH] generic_file_write_nolock cleanup Badari Pulavarty
@ 2006-01-30 17:20 ` Hugh Dickins
  2006-01-30 18:07   ` Badari Pulavarty
  0 siblings, 1 reply; 3+ messages in thread
From: Hugh Dickins @ 2006-01-30 17:20 UTC (permalink / raw)
  To: Badari Pulavarty; +Cc: akpm, lkml, hch

On Mon, 30 Jan 2006, Badari Pulavarty wrote:
> 
> 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() ?

Doesn't generic_file_write_nolock() call generic_file_aio_write_nolock(),
but __generic_file_write_nolock() call __generic_file_aio_write_nolock()?
With the first doing some syncing which the __second doesn't do?

Lovely names in mm/filemap.c, aren't they?

Hugh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] generic_file_write_nolock cleanup
  2006-01-30 17:20 ` Hugh Dickins
@ 2006-01-30 18:07   ` Badari Pulavarty
  0 siblings, 0 replies; 3+ messages in thread
From: Badari Pulavarty @ 2006-01-30 18:07 UTC (permalink / raw)
  To: Hugh Dickins; +Cc: akpm, lkml, hch

On Mon, 2006-01-30 at 17:20 +0000, Hugh Dickins wrote:
> On Mon, 30 Jan 2006, Badari Pulavarty wrote:
> > 
> > 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() ?
> 
> Doesn't generic_file_write_nolock() call generic_file_aio_write_nolock(),
> but __generic_file_write_nolock() call __generic_file_aio_write_nolock()?
> With the first doing some syncing which the __second doesn't do?
> 
> Lovely names in mm/filemap.c, aren't they?

Sigh !! I see it now. It was my version which was exactly equal (I was
doing some cleanup). :(

Please ignore my patch.

Thanks,
Badari


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-01-30 18:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-30 16:56 [PATCH] generic_file_write_nolock cleanup Badari Pulavarty
2006-01-30 17:20 ` Hugh Dickins
2006-01-30 18:07   ` Badari Pulavarty

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).