Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
blk-sysfs.c File Reference
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/bio.h>
#include <linux/blkdev.h>
#include <linux/blktrace_api.h>
#include "blk.h"
#include "blk-cgroup.h"

Go to the source code of this file.

Data Structures

struct  queue_sysfs_entry
 

Macros

#define QUEUE_SYSFS_BIT_FNS(name, flag, neg)
 
#define to_queue(atr)   container_of((atr), struct queue_sysfs_entry, attr)
 

Functions

 QUEUE_SYSFS_BIT_FNS (nonrot, NONROT, 1)
 
 QUEUE_SYSFS_BIT_FNS (random, ADD_RANDOM, 0)
 
 QUEUE_SYSFS_BIT_FNS (iostats, IO_STAT, 0)
 
int blk_register_queue (struct gendisk *disk)
 
void blk_unregister_queue (struct gendisk *disk)
 

Variables

struct kobj_type blk_queue_ktype
 

Macro Definition Documentation

#define QUEUE_SYSFS_BIT_FNS (   name,
  flag,
  neg 
)
Value:
static ssize_t \
queue_show_##name(struct request_queue *q, char *page) \
{ \
int bit; \
bit = test_bit(QUEUE_FLAG_##flag, &q->queue_flags); \
return queue_var_show(neg ? !bit : bit, page); \
} \
static ssize_t \
queue_store_##name(struct request_queue *q, const char *page, size_t count) \
{ \
unsigned long val; \
ret = queue_var_store(&val, page, count); \
if (neg) \
val = !val; \
\
spin_lock_irq(q->queue_lock); \
if (val) \
queue_flag_set(QUEUE_FLAG_##flag, q); \
else \
queue_flag_clear(QUEUE_FLAG_##flag, q); \
spin_unlock_irq(q->queue_lock); \
return ret; \
}

Definition at line 218 of file blk-sysfs.c.

#define to_queue (   atr)    container_of((atr), struct queue_sysfs_entry, attr)

Definition at line 456 of file blk-sysfs.c.

Function Documentation

int blk_register_queue ( struct gendisk *  disk)

Definition at line 555 of file blk-sysfs.c.

void blk_unregister_queue ( struct gendisk *  disk)

Definition at line 597 of file blk-sysfs.c.

QUEUE_SYSFS_BIT_FNS ( nonrot  ,
NONROT  ,
 
)
QUEUE_SYSFS_BIT_FNS ( random  ,
ADD_RANDOM  ,
 
)
QUEUE_SYSFS_BIT_FNS ( iostats  ,
IO_STAT  ,
 
)

Variable Documentation

struct kobj_type blk_queue_ktype
Initial value:
= {
.sysfs_ops = &queue_sysfs_ops,
.default_attrs = default_attrs,
.release = blk_release_queue,
}

Definition at line 549 of file blk-sysfs.c.