linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] locks: use assign_type()
@ 2011-01-17  6:45 Namhyung Kim
  2011-01-18 23:30 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Namhyung Kim @ 2011-01-17  6:45 UTC (permalink / raw)
  To: Alexander Viro, Matthew Wilcox; +Cc: linux-fsdevel, linux-kernel

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
 fs/locks.c |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)

diff --git a/fs/locks.c b/fs/locks.c
index 0f3998291f78..2c2d3b804d62 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -415,17 +415,7 @@ static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl,
 	fl->fl_ops = NULL;
 	fl->fl_lmops = NULL;
 
-	switch (l->l_type) {
-	case F_RDLCK:
-	case F_WRLCK:
-	case F_UNLCK:
-		fl->fl_type = l->l_type;
-		break;
-	default:
-		return -EINVAL;
-	}
-
-	return (0);
+	return assign_type(fl, l->l_type);
 }
 #endif
 
-- 
1.7.3.4.600.g982838b0


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

* Re: [PATCH] locks: use assign_type()
  2011-01-17  6:45 [PATCH] locks: use assign_type() Namhyung Kim
@ 2011-01-18 23:30 ` J. Bruce Fields
  0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2011-01-18 23:30 UTC (permalink / raw)
  To: Namhyung Kim; +Cc: Alexander Viro, Matthew Wilcox, linux-fsdevel, linux-kernel

Looks right to me.

I suppose I'll queue this up in the nfsd tree if nobody else takes
it.

--b.

On Mon, Jan 17, 2011 at 03:45:59PM +0900, Namhyung Kim wrote:
> Signed-off-by: Namhyung Kim <namhyung@gmail.com>
> ---
>  fs/locks.c |   12 +-----------
>  1 files changed, 1 insertions(+), 11 deletions(-)
> 
> diff --git a/fs/locks.c b/fs/locks.c
> index 0f3998291f78..2c2d3b804d62 100644
> --- a/fs/locks.c
> +++ b/fs/locks.c
> @@ -415,17 +415,7 @@ static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl,
>  	fl->fl_ops = NULL;
>  	fl->fl_lmops = NULL;
>  
> -	switch (l->l_type) {
> -	case F_RDLCK:
> -	case F_WRLCK:
> -	case F_UNLCK:
> -		fl->fl_type = l->l_type;
> -		break;
> -	default:
> -		return -EINVAL;
> -	}
> -
> -	return (0);
> +	return assign_type(fl, l->l_type);
>  }
>  #endif
>  
> -- 
> 1.7.3.4.600.g982838b0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-17  6:45 [PATCH] locks: use assign_type() Namhyung Kim
2011-01-18 23:30 ` J. Bruce Fields

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