~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise-security

« back to all changes in this revision

Viewing changes to include/linux/blkdev.h

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2011-12-06 15:56:07 UTC
  • Revision ID: package-import@ubuntu.com-20111206155607-pcf44kv5fmhk564f
Tags: 3.2.0-1401.1
[ Paolo Pisati ]

* Rebased on top of Ubuntu-3.2.0-3.8
* Tilt-tracking @ ef2487af4bb15bdd0689631774b5a5e3a59f74e2
* Delete debian.ti-omap4/control, it shoudln't be tracked
* Fix architecture spelling (s/armel/armhf/)
* [Config] Update configs following 3.2 import
* [Config] Fix compilation: disable CODA and ARCH_OMAP3
* [Config] Fix compilation: disable Ethernet Faraday
* Update series to precise

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
#include <linux/wait.h>
15
15
#include <linux/mempool.h>
16
16
#include <linux/bio.h>
17
 
#include <linux/module.h>
18
17
#include <linux/stringify.h>
19
18
#include <linux/gfp.h>
20
19
#include <linux/bsg.h>
22
21
 
23
22
#include <asm/scatterlist.h>
24
23
 
 
24
struct module;
25
25
struct scsi_ioctl_command;
26
26
 
27
27
struct request_queue;
30
30
struct blk_trace;
31
31
struct request;
32
32
struct sg_io_hdr;
 
33
struct bsg_job;
33
34
 
34
35
#define BLKDEV_MIN_RQ   4
35
36
#define BLKDEV_MAX_RQ   128     /* Default maximum */
73
74
 
74
75
/*
75
76
 * try to put the fields that are referenced together in the same cacheline.
76
 
 * if you modify this structure, be sure to check block/blk-core.c:rq_init()
 
77
 * if you modify this structure, be sure to check block/blk-core.c:blk_rq_init()
77
78
 * as well!
78
79
 */
79
80
struct request {
117
118
                struct {
118
119
                        unsigned int            seq;
119
120
                        struct list_head        list;
 
121
                        rq_end_io_fn            *saved_end_io;
120
122
                } flush;
121
123
        };
122
124
 
193
195
#include <linux/elevator.h>
194
196
 
195
197
typedef void (request_fn_proc) (struct request_queue *q);
196
 
typedef int (make_request_fn) (struct request_queue *q, struct bio *bio);
 
198
typedef void (make_request_fn) (struct request_queue *q, struct bio *bio);
197
199
typedef int (prep_rq_fn) (struct request_queue *, struct request *);
198
200
typedef void (unprep_rq_fn) (struct request_queue *, struct request *);
199
201
 
209
211
typedef void (softirq_done_fn)(struct request *);
210
212
typedef int (dma_drain_needed_fn)(struct request *);
211
213
typedef int (lld_busy_fn) (struct request_queue *q);
 
214
typedef int (bsg_job_fn) (struct bsg_job *);
212
215
 
213
216
enum blk_eh_timer_return {
214
217
        BLK_EH_NOT_HANDLED,
260
263
        unsigned char           discard_zeroes_data;
261
264
};
262
265
 
263
 
struct request_queue
264
 
{
 
266
struct request_queue {
265
267
        /*
266
268
         * Together with queue_head for cacheline sharing
267
269
         */
304
306
        void                    *queuedata;
305
307
 
306
308
        /*
 
309
         * various queue flags, see QUEUE_* below
 
310
         */
 
311
        unsigned long           queue_flags;
 
312
 
 
313
        /*
307
314
         * queue needs bounce pages for pages above this limit
308
315
         */
309
316
        gfp_t                   bounce_gfp;
310
317
 
311
318
        /*
312
 
         * various queue flags, see QUEUE_* below
313
 
         */
314
 
        unsigned long           queue_flags;
315
 
 
316
 
        /*
317
319
         * protects queue structures from reentrancy. ->__queue_lock should
318
320
         * _never_ be used directly, it is queue private. always use
319
321
         * ->queue_lock.
334
336
        unsigned int            nr_congestion_off;
335
337
        unsigned int            nr_batching;
336
338
 
 
339
        unsigned int            dma_drain_size;
337
340
        void                    *dma_drain_buffer;
338
 
        unsigned int            dma_drain_size;
339
341
        unsigned int            dma_pad_mask;
340
342
        unsigned int            dma_alignment;
341
343
 
376
378
        struct mutex            sysfs_lock;
377
379
 
378
380
#if defined(CONFIG_BLK_DEV_BSG)
 
381
        bsg_job_fn              *bsg_job_fn;
 
382
        int                     bsg_job_size;
379
383
        struct bsg_class_device bsg_dev;
380
384
#endif
381
385
 
393
397
#define QUEUE_FLAG_ELVSWITCH    6       /* don't use elevator, just do FIFO */
394
398
#define QUEUE_FLAG_BIDI         7       /* queue supports bidi requests */
395
399
#define QUEUE_FLAG_NOMERGES     8       /* disable merge attempts */
396
 
#define QUEUE_FLAG_SAME_COMP    9       /* force complete on same CPU */
 
400
#define QUEUE_FLAG_SAME_COMP    9       /* complete on same CPU-group */
397
401
#define QUEUE_FLAG_FAIL_IO     10       /* fake timeout */
398
402
#define QUEUE_FLAG_STACKABLE   11       /* supports request stacking */
399
403
#define QUEUE_FLAG_NONROT      12       /* non-rotational device (SSD) */
403
407
#define QUEUE_FLAG_NOXMERGES   15       /* No extended merges */
404
408
#define QUEUE_FLAG_ADD_RANDOM  16       /* Contributes to random pool */
405
409
#define QUEUE_FLAG_SECDISCARD  17       /* supports SECDISCARD */
 
410
#define QUEUE_FLAG_SAME_FORCE  18       /* force complete on same CPU */
406
411
 
407
412
#define QUEUE_FLAG_DEFAULT      ((1 << QUEUE_FLAG_IO_STAT) |            \
408
413
                                 (1 << QUEUE_FLAG_STACKABLE)    |       \
675
680
extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t,
676
681
                         struct scsi_ioctl_command __user *);
677
682
 
 
683
extern void blk_queue_bio(struct request_queue *q, struct bio *bio);
 
684
 
678
685
/*
679
686
 * A queue has just exitted congestion.  Note this in the global counter of
680
687
 * congested queues, and wake up anyone who was waiting for requests to be
857
864
struct request_queue *blk_alloc_queue_node(gfp_t, int);
858
865
extern void blk_put_queue(struct request_queue *);
859
866
 
 
867
/*
 
868
 * blk_plug permits building a queue of related requests by holding the I/O
 
869
 * fragments for a short period. This allows merging of sequential requests
 
870
 * into single larger request. As the requests are moved from a per-task list to
 
871
 * the device's request_queue in a batch, this results in improved scalability
 
872
 * as the lock contention for request_queue lock is reduced.
 
873
 *
 
874
 * It is ok not to disable preemption when adding the request to the plug list
 
875
 * or when attempting a merge, because blk_schedule_flush_list() will only flush
 
876
 * the plug list when the task sleeps by itself. For details, please see
 
877
 * schedule() where blk_schedule_flush_plug() is called.
 
878
 */
860
879
struct blk_plug {
861
 
        unsigned long magic;
862
 
        struct list_head list;
863
 
        struct list_head cb_list;
864
 
        unsigned int should_sort;
 
880
        unsigned long magic; /* detect uninitialized use-cases */
 
881
        struct list_head list; /* requests */
 
882
        struct list_head cb_list; /* md requires an unplug callback */
 
883
        unsigned int should_sort; /* list to be sorted before flushing? */
865
884
};
 
885
#define BLK_MAX_REQUEST_COUNT 16
 
886
 
866
887
struct blk_plug_cb {
867
888
        struct list_head list;
868
889
        void (*callback)(struct blk_plug_cb *);
1176
1197
}
1177
1198
#endif
1178
1199
 
1179
 
#ifdef CONFIG_BLK_DEV_THROTTLING
1180
 
extern int blk_throtl_init(struct request_queue *q);
1181
 
extern void blk_throtl_exit(struct request_queue *q);
1182
 
extern int blk_throtl_bio(struct request_queue *q, struct bio **bio);
1183
 
#else /* CONFIG_BLK_DEV_THROTTLING */
1184
 
static inline int blk_throtl_bio(struct request_queue *q, struct bio **bio)
1185
 
{
1186
 
        return 0;
1187
 
}
1188
 
 
1189
 
static inline int blk_throtl_init(struct request_queue *q) { return 0; }
1190
 
static inline int blk_throtl_exit(struct request_queue *q) { return 0; }
1191
 
#endif /* CONFIG_BLK_DEV_THROTTLING */
1192
 
 
1193
1200
#define MODULE_ALIAS_BLOCKDEV(major,minor) \
1194
1201
        MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor))
1195
1202
#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \