Skip to contentSkip to conversation

locks: use assign_type()

PATCH In review Namhyung Kim 2 participants 2 messages Jan 17, 2011 – Jan 18, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 locks: use assign_type()

---
 fs/locks.c |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)
fs/locks.c +1 -11
index 0f3998291f78..2c2d3b804d62 100644
@@ -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
 
Signature · 1 line
1.7.3.4.600.g982838b0
#1 lore raw

Looks right to me.

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

--b.

Quoted 36 lines · Namhyung Kim
---
 fs/locks.c |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)
fs/locks.c +1 -11
index 0f3998291f78..2c2d3b804d62 100644
@@ -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
 
Signature · 7 lines
1.7.3.4.600.g982838b0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/