public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] floppy: remove floppy-specific O_EXCL handling
@ 2012-05-13  9:02 Jiri Kosina
  2012-05-14 16:25 ` Tejun Heo
  0 siblings, 1 reply; 8+ messages in thread
From: Jiri Kosina @ 2012-05-13  9:02 UTC (permalink / raw)
  To: Andrew Morton, Jens Axboe, NeilBrown, Tejun Heo; +Cc: linux-kernel

Block layer now handles O_EXCL in a generic way for block devices.

The semantics is however different for floppy and all other block devices,
as floppy driver contains its own O_EXCL handling.

The semantics for all-but-floppy bdevs is "there can be at most one O_EXCL 
open of this file", while for floppy bdev the semantics is "if someone has 
the bdev open with O_EXCL, noone else can open it".

Remove the floppy-specific handling and let the generic bdev code O_EXCL
handling take over.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
---
 drivers/block/floppy.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index b0b00d7..fe694f8 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -3650,13 +3650,7 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)
 		set_bit(FD_VERIFY_BIT, &UDRS->flags);
 	}
 
-	if (UDRS->fd_ref == -1 || (UDRS->fd_ref && (mode & FMODE_EXCL)))
-		goto out2;
-
-	if (mode & FMODE_EXCL)
-		UDRS->fd_ref = -1;
-	else
-		UDRS->fd_ref++;
+	UDRS->fd_ref++;
 
 	opened_bdev[drive] = bdev;
 
-- 
Jiri Kosina
SUSE Labs

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

end of thread, other threads:[~2012-05-15  6:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-13  9:02 [PATCH] floppy: remove floppy-specific O_EXCL handling Jiri Kosina
2012-05-14 16:25 ` Tejun Heo
2012-05-14 16:49   ` Joe Perches
2012-05-14 20:42   ` Jiri Kosina
2012-05-14 21:19     ` Tejun Heo
2012-05-14 21:38       ` Jiri Kosina
2012-05-14 23:22         ` NeilBrown
2012-05-15  6:15           ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox