Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242268
b: refs/heads/master
c: ffe80ce
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo committed Mar 9, 2011
1 parent 98fcd51 commit 6b33741
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 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: f47350fdecb7ce9fe715e2df4431c4b51c4ef46b
refs/heads/master: ffe80cea354519d846767b8165598c2903706c2a
11 changes: 6 additions & 5 deletions trunk/drivers/s390/char/tape_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@
static DEFINE_MUTEX(tape_block_mutex);
static int tapeblock_open(struct block_device *, fmode_t);
static int tapeblock_release(struct gendisk *, fmode_t);
static int tapeblock_medium_changed(struct gendisk *);
static unsigned int tapeblock_check_events(struct gendisk *, unsigned int);
static int tapeblock_revalidate_disk(struct gendisk *);

static const struct block_device_operations tapeblock_fops = {
.owner = THIS_MODULE,
.open = tapeblock_open,
.release = tapeblock_release,
.media_changed = tapeblock_medium_changed,
.check_events = tapeblock_check_events,
.revalidate_disk = tapeblock_revalidate_disk,
};

Expand Down Expand Up @@ -237,6 +237,7 @@ tapeblock_setup_device(struct tape_device * device)
disk->major = tapeblock_major;
disk->first_minor = device->first_minor;
disk->fops = &tapeblock_fops;
disk->events = DISK_EVENT_MEDIA_CHANGE;
disk->private_data = tape_get_device(device);
disk->queue = blkdat->request_queue;
set_capacity(disk, 0);
Expand Down Expand Up @@ -340,16 +341,16 @@ tapeblock_revalidate_disk(struct gendisk *disk)
return 0;
}

static int
tapeblock_medium_changed(struct gendisk *disk)
static unsigned int
tapeblock_check_events(struct gendisk *disk, unsigned int clearing)
{
struct tape_device *device;

device = (struct tape_device *) disk->private_data;
DBF_LH(6, "tapeblock_medium_changed(%p) = %d\n",
device, device->blk_data.medium_changed);

return device->blk_data.medium_changed;
return device->blk_data.medium_changed ? DISK_EVENT_MEDIA_CHANGE : 0;
}

/*
Expand Down

0 comments on commit 6b33741

Please sign in to comment.