linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [2.6 patch] fs/nfs/direct.c: remove dead code
@ 2007-12-11 22:21 Adrian Bunk
  2007-12-12 15:57 ` Chuck Lever
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian Bunk @ 2007-12-11 22:21 UTC (permalink / raw)
  To: Chuck Lever, Trond Myklebust; +Cc: linux-kernel

This code became dead after commit b9148c6b80d802dbc2a7530b29915a80432e50c7
(which BTW doesn't seem to have changed any behaviour) and can therefore 
be removed.

Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---
--- linux-2.6/fs/nfs/direct.c.old	2007-12-02 21:54:53.000000000 +0100
+++ linux-2.6/fs/nfs/direct.c	2007-12-02 21:55:10.000000000 +0100
@@ -897,15 +897,12 @@ ssize_t nfs_file_direct_write(struct kio
 	if (!count)
 		goto out;	/* return 0 */
 
 	retval = -EINVAL;
 	if ((ssize_t) count < 0)
 		goto out;
-	retval = 0;
-	if (!count)
-		goto out;
 
 	retval = nfs_sync_mapping(mapping);
 	if (retval)
 		goto out;
 
 	retval = nfs_direct_write(iocb, iov, nr_segs, pos, count);


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

* Re: [2.6 patch] fs/nfs/direct.c: remove dead code
  2007-12-11 22:21 [2.6 patch] fs/nfs/direct.c: remove dead code Adrian Bunk
@ 2007-12-12 15:57 ` Chuck Lever
  0 siblings, 0 replies; 2+ messages in thread
From: Chuck Lever @ 2007-12-12 15:57 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Trond Myklebust, linux-kernel

commit b9148c6b should be reverted.  It was recently forward-ported  
from some years-old patches, and is clearly not needed now.

On Dec 11, 2007, at 5:21 PM, Adrian Bunk wrote:

> This code became dead after commit  
> b9148c6b80d802dbc2a7530b29915a80432e50c7
> (which BTW doesn't seem to have changed any behaviour) and can  
> therefore
> be removed.
>
> Spotted by the Coverity checker.
>
> Signed-off-by: Adrian Bunk <bunk@kernel.org>
>
> ---
> --- linux-2.6/fs/nfs/direct.c.old	2007-12-02 21:54:53.000000000 +0100
> +++ linux-2.6/fs/nfs/direct.c	2007-12-02 21:55:10.000000000 +0100
> @@ -897,15 +897,12 @@ ssize_t nfs_file_direct_write(struct kio
>  	if (!count)
>  		goto out;	/* return 0 */
>
>  	retval = -EINVAL;
>  	if ((ssize_t) count < 0)
>  		goto out;
> -	retval = 0;
> -	if (!count)
> -		goto out;
>
>  	retval = nfs_sync_mapping(mapping);
>  	if (retval)
>  		goto out;
>
>  	retval = nfs_direct_write(iocb, iov, nr_segs, pos, count);
>

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com




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

end of thread, other threads:[~2007-12-12 16:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-11 22:21 [2.6 patch] fs/nfs/direct.c: remove dead code Adrian Bunk
2007-12-12 15:57 ` Chuck Lever

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