Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-for-linus-2.6

This commit is contained in:
Linus Torvalds
2005-09-07 17:31:27 -07:00
119 changed files with 7209 additions and 9426 deletions

View File

@@ -11,10 +11,12 @@
#include <linux/device.h>
#include <linux/list.h>
#include <linux/klist.h>
#include <linux/spinlock.h>
struct attribute_container {
struct list_head node;
struct list_head containers;
struct klist containers;
struct class *class;
struct class_device_attribute **attrs;
int (*match)(struct attribute_container *, struct device *);
@@ -62,12 +64,8 @@ int attribute_container_add_class_device_adapter(struct attribute_container *con
struct class_device *classdev);
void attribute_container_remove_attrs(struct class_device *classdev);
void attribute_container_class_device_del(struct class_device *classdev);
struct attribute_container *attribute_container_classdev_to_container(struct class_device *);
struct class_device *attribute_container_find_class_device(struct attribute_container *, struct device *);
struct class_device_attribute **attribute_container_classdev_to_attrs(const struct class_device *classdev);
#endif

View File

@@ -295,7 +295,13 @@ extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int);
extern int bio_get_nr_vecs(struct block_device *);
extern struct bio *bio_map_user(struct request_queue *, struct block_device *,
unsigned long, unsigned int, int);
struct sg_iovec;
extern struct bio *bio_map_user_iov(struct request_queue *,
struct block_device *,
struct sg_iovec *, int, int);
extern void bio_unmap_user(struct bio *);
extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int,
unsigned int);
extern void bio_set_pages_dirty(struct bio *bio);
extern void bio_check_pages_dirty(struct bio *bio);
extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int);

View File

@@ -563,10 +563,12 @@ extern void blk_sync_queue(struct request_queue *q);
extern void __blk_stop_queue(request_queue_t *q);
extern void blk_run_queue(request_queue_t *);
extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *);
extern struct request *blk_rq_map_user(request_queue_t *, int, void __user *, unsigned int);
extern int blk_rq_unmap_user(struct request *, struct bio *, unsigned int);
extern int blk_execute_rq(request_queue_t *, struct gendisk *, struct request *);
extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int);
extern int blk_rq_unmap_user(struct bio *, unsigned int);
extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, unsigned int);
extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int);
extern int blk_execute_rq(request_queue_t *, struct gendisk *,
struct request *, int);
static inline request_queue_t *bdev_get_queue(struct block_device *bdev)
{
return bdev->bd_disk->queue;

View File

@@ -0,0 +1,59 @@
/*
*/
#include <linux/transport_class.h>
struct raid_template {
struct transport_container raid_attrs;
};
struct raid_function_template {
void *cookie;
int (*is_raid)(struct device *);
void (*get_resync)(struct device *);
void (*get_state)(struct device *);
};
enum raid_state {
RAID_ACTIVE = 1,
RAID_DEGRADED,
RAID_RESYNCING,
RAID_OFFLINE,
};
struct raid_data {
struct list_head component_list;
int component_count;
int level;
enum raid_state state;
int resync;
};
#define DEFINE_RAID_ATTRIBUTE(type, attr) \
static inline void \
raid_set_##attr(struct raid_template *r, struct device *dev, type value) { \
struct class_device *cdev = \
attribute_container_find_class_device(&r->raid_attrs.ac, dev);\
struct raid_data *rd; \
BUG_ON(!cdev); \
rd = class_get_devdata(cdev); \
rd->attr = value; \
} \
static inline type \
raid_get_##attr(struct raid_template *r, struct device *dev) { \
struct class_device *cdev = \
attribute_container_find_class_device(&r->raid_attrs.ac, dev);\
struct raid_data *rd; \
BUG_ON(!cdev); \
rd = class_get_devdata(cdev); \
return rd->attr; \
}
DEFINE_RAID_ATTRIBUTE(int, level)
DEFINE_RAID_ATTRIBUTE(int, resync)
DEFINE_RAID_ATTRIBUTE(enum raid_state, state)
struct raid_template *raid_class_attach(struct raid_function_template *);
void raid_class_release(struct raid_template *);
void raid_component_add(struct raid_template *, struct device *,
struct device *);

View File

@@ -12,11 +12,16 @@
#include <linux/device.h>
#include <linux/attribute_container.h>
struct transport_container;
struct transport_class {
struct class class;
int (*setup)(struct device *);
int (*configure)(struct device *);
int (*remove)(struct device *);
int (*setup)(struct transport_container *, struct device *,
struct class_device *);
int (*configure)(struct transport_container *, struct device *,
struct class_device *);
int (*remove)(struct transport_container *, struct device *,
struct class_device *);
};
#define DECLARE_TRANSPORT_CLASS(cls, nm, su, rm, cfg) \