Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Browse files Browse the repository at this point in the history
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  cdrom: support devices that have check_events but not media_changed
  cfq-iosched: Don't wait if queue already has requests.
  blkio-throttle: Avoid calling blkiocg_lookup_group() for root group
  cfq: rename a function to give it more appropriate name
  cciss: make cciss_revalidate not loop through CISS_MAX_LUNS volumes unnecessarily.
  drivers/block/aoe/Makefile: replace the use of <module>-objs with <module>-y
  loop: queue_lock NULL pointer derefence in blk_throtl_exit
  drivers/block/Makefile: replace the use of <module>-objs with <module>-y
  blktrace: Don't output messages if NOTIFY isn't set.
  • Loading branch information
Linus Torvalds committed Feb 9, 2011
2 parents ae8eed2 + b8cf0e0 commit aceb91c
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 8 deletions.
10 changes: 9 additions & 1 deletion block/blk-throttle.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,15 @@ static struct throtl_grp * throtl_find_alloc_tg(struct throtl_data *td,
* tree of blkg (instead of traversing through hash list all
* the time.
*/
tg = tg_of_blkg(blkiocg_lookup_group(blkcg, key));

/*
* This is the common case when there are no blkio cgroups.
* Avoid lookup in this case
*/
if (blkcg == &blkio_root_cgroup)
tg = &td->root_tg;
else
tg = tg_of_blkg(blkiocg_lookup_group(blkcg, key));

/* Fill in device details for root group */
if (tg && !tg->blkg.dev && bdi->dev && dev_name(bdi->dev)) {
Expand Down
10 changes: 7 additions & 3 deletions block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ cfq_group_slice(struct cfq_data *cfqd, struct cfq_group *cfqg)
}

static inline unsigned
cfq_scaled_group_slice(struct cfq_data *cfqd, struct cfq_queue *cfqq)
cfq_scaled_cfqq_slice(struct cfq_data *cfqd, struct cfq_queue *cfqq)
{
unsigned slice = cfq_prio_to_slice(cfqd, cfqq);
if (cfqd->cfq_latency) {
Expand Down Expand Up @@ -631,7 +631,7 @@ cfq_scaled_group_slice(struct cfq_data *cfqd, struct cfq_queue *cfqq)
static inline void
cfq_set_prio_slice(struct cfq_data *cfqd, struct cfq_queue *cfqq)
{
unsigned slice = cfq_scaled_group_slice(cfqd, cfqq);
unsigned slice = cfq_scaled_cfqq_slice(cfqd, cfqq);

cfqq->slice_start = jiffies;
cfqq->slice_end = jiffies + slice;
Expand Down Expand Up @@ -1671,7 +1671,7 @@ __cfq_slice_expired(struct cfq_data *cfqd, struct cfq_queue *cfqq,
*/
if (timed_out) {
if (cfq_cfqq_slice_new(cfqq))
cfqq->slice_resid = cfq_scaled_group_slice(cfqd, cfqq);
cfqq->slice_resid = cfq_scaled_cfqq_slice(cfqd, cfqq);
else
cfqq->slice_resid = cfqq->slice_end - jiffies;
cfq_log_cfqq(cfqd, cfqq, "resid=%ld", cfqq->slice_resid);
Expand Down Expand Up @@ -3432,6 +3432,10 @@ static bool cfq_should_wait_busy(struct cfq_data *cfqd, struct cfq_queue *cfqq)
{
struct cfq_io_context *cic = cfqd->active_cic;

/* If the queue already has requests, don't wait */
if (!RB_EMPTY_ROOT(&cfqq->sort_list))
return false;

/* If there are other queues in the group, don't wait */
if (cfqq->cfqg->nr_cfqq > 1)
return false;
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ obj-$(CONFIG_XEN_BLKDEV_FRONTEND) += xen-blkfront.o
obj-$(CONFIG_BLK_DEV_DRBD) += drbd/
obj-$(CONFIG_BLK_DEV_RBD) += rbd.o

swim_mod-objs := swim.o swim_asm.o
swim_mod-y := swim.o swim_asm.o
2 changes: 1 addition & 1 deletion drivers/block/aoe/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
#

obj-$(CONFIG_ATA_OVER_ETH) += aoe.o
aoe-objs := aoeblk.o aoechr.o aoecmd.o aoedev.o aoemain.o aoenet.o
aoe-y := aoeblk.o aoechr.o aoecmd.o aoedev.o aoemain.o aoenet.o
2 changes: 1 addition & 1 deletion drivers/block/cciss.c
Original file line number Diff line number Diff line change
Expand Up @@ -2833,7 +2833,7 @@ static int cciss_revalidate(struct gendisk *disk)
sector_t total_size;
InquiryData_struct *inq_buff = NULL;

for (logvol = 0; logvol < CISS_MAX_LUN; logvol++) {
for (logvol = 0; logvol <= h->highest_lun; logvol++) {
if (!h->drv[logvol])
continue;
if (memcmp(h->drv[logvol]->LunID, drv->LunID,
Expand Down
3 changes: 3 additions & 0 deletions drivers/block/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1641,6 +1641,9 @@ static struct loop_device *loop_alloc(int i)

static void loop_free(struct loop_device *lo)
{
if (!lo->lo_queue->queue_lock)
lo->lo_queue->queue_lock = &lo->lo_queue->__queue_lock;

blk_cleanup_queue(lo->lo_queue);
put_disk(lo->lo_disk);
list_del(&lo->lo_list);
Expand Down
3 changes: 2 additions & 1 deletion drivers/cdrom/cdrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,8 @@ int register_cdrom(struct cdrom_device_info *cdi)
}

ENSURE(drive_status, CDC_DRIVE_STATUS );
ENSURE(media_changed, CDC_MEDIA_CHANGED);
if (cdo->check_events == NULL && cdo->media_changed == NULL)
*change_capability = ~(CDC_MEDIA_CHANGED | CDC_SELECT_DISC);
ENSURE(tray_move, CDC_CLOSE_TRAY | CDC_OPEN_TRAY);
ENSURE(lock_door, CDC_LOCK);
ENSURE(select_speed, CDC_SELECT_SPEED);
Expand Down
7 changes: 7 additions & 0 deletions kernel/trace/blktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ void __trace_note_message(struct blk_trace *bt, const char *fmt, ...)
!blk_tracer_enabled))
return;

/*
* If the BLK_TC_NOTIFY action mask isn't set, don't send any note
* message to the trace.
*/
if (!(bt->act_mask & BLK_TC_NOTIFY))
return;

local_irq_save(flags);
buf = per_cpu_ptr(bt->msg_data, smp_processor_id());
va_start(args, fmt);
Expand Down

0 comments on commit aceb91c

Please sign in to comment.