Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309286
b: refs/heads/master
c: bfa10b8
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Kosina committed May 18, 2012
1 parent c6fe6d5 commit 92bfb9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 070ad7e793dc6ff753ee682ef7790b3373b471f6
refs/heads/master: bfa10b8c98bb335bc3e401d3ec947d446f04d1aa
18 changes: 4 additions & 14 deletions trunk/drivers/block/floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -3607,9 +3607,7 @@ static int floppy_release(struct gendisk *disk, fmode_t mode)

mutex_lock(&floppy_mutex);
mutex_lock(&open_lock);
if (UDRS->fd_ref < 0)
UDRS->fd_ref = 0;
else if (!UDRS->fd_ref--) {
if (!UDRS->fd_ref--) {
DPRINT("floppy_release with fd_ref == 0");
UDRS->fd_ref = 0;
}
Expand Down Expand Up @@ -3645,13 +3643,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;

Expand Down Expand Up @@ -3714,10 +3706,8 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)
mutex_unlock(&floppy_mutex);
return 0;
out:
if (UDRS->fd_ref < 0)
UDRS->fd_ref = 0;
else
UDRS->fd_ref--;
UDRS->fd_ref--;

if (!UDRS->fd_ref)
opened_bdev[drive] = NULL;
out2:
Expand Down

0 comments on commit 92bfb9a

Please sign in to comment.