diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-12-03 02:38:13 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-12-03 02:38:13 -0500 |
commit | 467832032cc07626880363efa8625719c16c04eb (patch) | |
tree | ee9a62c04f0b3106e412bc1b2dd1cea5566d5ca7 /include | |
parent | 66d2a5952eab875f1286e04f738ef029afdaf013 (diff) | |
parent | 22763c5cf3690a681551162c15d34d935308c8d7 (diff) |
Merge commit 'v2.6.32' into next
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-generic/fcntl.h | 21 | ||||
-rw-r--r-- | include/linux/ext3_fs_i.h | 8 | ||||
-rw-r--r-- | include/linux/fb.h | 6 | ||||
-rw-r--r-- | include/linux/fscache-cache.h | 40 | ||||
-rw-r--r-- | include/linux/fscache.h | 27 | ||||
-rw-r--r-- | include/linux/i2c-pnx.h | 2 | ||||
-rw-r--r-- | include/linux/i2c.h | 18 | ||||
-rw-r--r-- | include/linux/input.h | 4 | ||||
-rw-r--r-- | include/linux/isdn_ppp.h | 2 | ||||
-rw-r--r-- | include/linux/mfd/wm831x/regulator.h | 4 | ||||
-rw-r--r-- | include/linux/nilfs2_fs.h | 9 | ||||
-rw-r--r-- | include/linux/pci_ids.h | 4 | ||||
-rw-r--r-- | include/linux/slow-work.h | 72 | ||||
-rw-r--r-- | include/linux/suspend.h | 21 | ||||
-rw-r--r-- | include/linux/vt.h | 4 | ||||
-rw-r--r-- | include/net/mac80211.h | 6 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack.h | 8 | ||||
-rw-r--r-- | include/net/netfilter/nf_nat_helper.h | 4 | ||||
-rw-r--r-- | include/net/sctp/structs.h | 3 | ||||
-rw-r--r-- | include/scsi/scsi_device.h | 1 | ||||
-rw-r--r-- | include/scsi/scsi_host.h | 29 |
21 files changed, 231 insertions, 62 deletions
diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h index 0c3dd8603927..495dc8af4044 100644 --- a/include/asm-generic/fcntl.h +++ b/include/asm-generic/fcntl.h | |||
@@ -73,14 +73,23 @@ | |||
73 | #define F_SETSIG 10 /* for sockets. */ | 73 | #define F_SETSIG 10 /* for sockets. */ |
74 | #define F_GETSIG 11 /* for sockets. */ | 74 | #define F_GETSIG 11 /* for sockets. */ |
75 | #endif | 75 | #endif |
76 | |||
77 | #ifndef CONFIG_64BIT | ||
78 | #ifndef F_GETLK64 | ||
79 | #define F_GETLK64 12 /* using 'struct flock64' */ | ||
80 | #define F_SETLK64 13 | ||
81 | #define F_SETLKW64 14 | ||
82 | #endif | ||
83 | #endif | ||
84 | |||
76 | #ifndef F_SETOWN_EX | 85 | #ifndef F_SETOWN_EX |
77 | #define F_SETOWN_EX 12 | 86 | #define F_SETOWN_EX 15 |
78 | #define F_GETOWN_EX 13 | 87 | #define F_GETOWN_EX 16 |
79 | #endif | 88 | #endif |
80 | 89 | ||
81 | #define F_OWNER_TID 0 | 90 | #define F_OWNER_TID 0 |
82 | #define F_OWNER_PID 1 | 91 | #define F_OWNER_PID 1 |
83 | #define F_OWNER_GID 2 | 92 | #define F_OWNER_PGRP 2 |
84 | 93 | ||
85 | struct f_owner_ex { | 94 | struct f_owner_ex { |
86 | int type; | 95 | int type; |
@@ -139,12 +148,6 @@ struct flock { | |||
139 | 148 | ||
140 | #ifndef CONFIG_64BIT | 149 | #ifndef CONFIG_64BIT |
141 | 150 | ||
142 | #ifndef F_GETLK64 | ||
143 | #define F_GETLK64 12 /* using 'struct flock64' */ | ||
144 | #define F_SETLK64 13 | ||
145 | #define F_SETLKW64 14 | ||
146 | #endif | ||
147 | |||
148 | #ifndef HAVE_ARCH_STRUCT_FLOCK64 | 151 | #ifndef HAVE_ARCH_STRUCT_FLOCK64 |
149 | #ifndef __ARCH_FLOCK64_PAD | 152 | #ifndef __ARCH_FLOCK64_PAD |
150 | #define __ARCH_FLOCK64_PAD | 153 | #define __ARCH_FLOCK64_PAD |
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h index ca1bfe90004f..93e7428156ba 100644 --- a/include/linux/ext3_fs_i.h +++ b/include/linux/ext3_fs_i.h | |||
@@ -137,6 +137,14 @@ struct ext3_inode_info { | |||
137 | * by other means, so we have truncate_mutex. | 137 | * by other means, so we have truncate_mutex. |
138 | */ | 138 | */ |
139 | struct mutex truncate_mutex; | 139 | struct mutex truncate_mutex; |
140 | |||
141 | /* | ||
142 | * Transactions that contain inode's metadata needed to complete | ||
143 | * fsync and fdatasync, respectively. | ||
144 | */ | ||
145 | atomic_t i_sync_tid; | ||
146 | atomic_t i_datasync_tid; | ||
147 | |||
140 | struct inode vfs_inode; | 148 | struct inode vfs_inode; |
141 | }; | 149 | }; |
142 | 150 | ||
diff --git a/include/linux/fb.h b/include/linux/fb.h index a34bdf5a9d23..de9c722e7b90 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -669,12 +669,6 @@ struct fb_ops { | |||
669 | /* perform fb specific mmap */ | 669 | /* perform fb specific mmap */ |
670 | int (*fb_mmap)(struct fb_info *info, struct vm_area_struct *vma); | 670 | int (*fb_mmap)(struct fb_info *info, struct vm_area_struct *vma); |
671 | 671 | ||
672 | /* save current hardware state */ | ||
673 | void (*fb_save_state)(struct fb_info *info); | ||
674 | |||
675 | /* restore saved state */ | ||
676 | void (*fb_restore_state)(struct fb_info *info); | ||
677 | |||
678 | /* get capability given var */ | 672 | /* get capability given var */ |
679 | void (*fb_get_caps)(struct fb_info *info, struct fb_blit_caps *caps, | 673 | void (*fb_get_caps)(struct fb_info *info, struct fb_blit_caps *caps, |
680 | struct fb_var_screeninfo *var); | 674 | struct fb_var_screeninfo *var); |
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h index 84d3532dd3ea..7be0c6fbe880 100644 --- a/include/linux/fscache-cache.h +++ b/include/linux/fscache-cache.h | |||
@@ -91,6 +91,8 @@ struct fscache_operation { | |||
91 | #define FSCACHE_OP_WAITING 4 /* cleared when op is woken */ | 91 | #define FSCACHE_OP_WAITING 4 /* cleared when op is woken */ |
92 | #define FSCACHE_OP_EXCLUSIVE 5 /* exclusive op, other ops must wait */ | 92 | #define FSCACHE_OP_EXCLUSIVE 5 /* exclusive op, other ops must wait */ |
93 | #define FSCACHE_OP_DEAD 6 /* op is now dead */ | 93 | #define FSCACHE_OP_DEAD 6 /* op is now dead */ |
94 | #define FSCACHE_OP_DEC_READ_CNT 7 /* decrement object->n_reads on destruction */ | ||
95 | #define FSCACHE_OP_KEEP_FLAGS 0xc0 /* flags to keep when repurposing an op */ | ||
94 | 96 | ||
95 | atomic_t usage; | 97 | atomic_t usage; |
96 | unsigned debug_id; /* debugging ID */ | 98 | unsigned debug_id; /* debugging ID */ |
@@ -102,6 +104,16 @@ struct fscache_operation { | |||
102 | 104 | ||
103 | /* operation releaser */ | 105 | /* operation releaser */ |
104 | fscache_operation_release_t release; | 106 | fscache_operation_release_t release; |
107 | |||
108 | #ifdef CONFIG_SLOW_WORK_PROC | ||
109 | const char *name; /* operation name */ | ||
110 | const char *state; /* operation state */ | ||
111 | #define fscache_set_op_name(OP, N) do { (OP)->name = (N); } while(0) | ||
112 | #define fscache_set_op_state(OP, S) do { (OP)->state = (S); } while(0) | ||
113 | #else | ||
114 | #define fscache_set_op_name(OP, N) do { } while(0) | ||
115 | #define fscache_set_op_state(OP, S) do { } while(0) | ||
116 | #endif | ||
105 | }; | 117 | }; |
106 | 118 | ||
107 | extern atomic_t fscache_op_debug_id; | 119 | extern atomic_t fscache_op_debug_id; |
@@ -125,6 +137,7 @@ static inline void fscache_operation_init(struct fscache_operation *op, | |||
125 | op->debug_id = atomic_inc_return(&fscache_op_debug_id); | 137 | op->debug_id = atomic_inc_return(&fscache_op_debug_id); |
126 | op->release = release; | 138 | op->release = release; |
127 | INIT_LIST_HEAD(&op->pend_link); | 139 | INIT_LIST_HEAD(&op->pend_link); |
140 | fscache_set_op_state(op, "Init"); | ||
128 | } | 141 | } |
129 | 142 | ||
130 | /** | 143 | /** |
@@ -221,8 +234,10 @@ struct fscache_cache_ops { | |||
221 | struct fscache_object *(*alloc_object)(struct fscache_cache *cache, | 234 | struct fscache_object *(*alloc_object)(struct fscache_cache *cache, |
222 | struct fscache_cookie *cookie); | 235 | struct fscache_cookie *cookie); |
223 | 236 | ||
224 | /* look up the object for a cookie */ | 237 | /* look up the object for a cookie |
225 | void (*lookup_object)(struct fscache_object *object); | 238 | * - return -ETIMEDOUT to be requeued |
239 | */ | ||
240 | int (*lookup_object)(struct fscache_object *object); | ||
226 | 241 | ||
227 | /* finished looking up */ | 242 | /* finished looking up */ |
228 | void (*lookup_complete)(struct fscache_object *object); | 243 | void (*lookup_complete)(struct fscache_object *object); |
@@ -297,12 +312,14 @@ struct fscache_cookie { | |||
297 | atomic_t usage; /* number of users of this cookie */ | 312 | atomic_t usage; /* number of users of this cookie */ |
298 | atomic_t n_children; /* number of children of this cookie */ | 313 | atomic_t n_children; /* number of children of this cookie */ |
299 | spinlock_t lock; | 314 | spinlock_t lock; |
315 | spinlock_t stores_lock; /* lock on page store tree */ | ||
300 | struct hlist_head backing_objects; /* object(s) backing this file/index */ | 316 | struct hlist_head backing_objects; /* object(s) backing this file/index */ |
301 | const struct fscache_cookie_def *def; /* definition */ | 317 | const struct fscache_cookie_def *def; /* definition */ |
302 | struct fscache_cookie *parent; /* parent of this entry */ | 318 | struct fscache_cookie *parent; /* parent of this entry */ |
303 | void *netfs_data; /* back pointer to netfs */ | 319 | void *netfs_data; /* back pointer to netfs */ |
304 | struct radix_tree_root stores; /* pages to be stored on this cookie */ | 320 | struct radix_tree_root stores; /* pages to be stored on this cookie */ |
305 | #define FSCACHE_COOKIE_PENDING_TAG 0 /* pages tag: pending write to cache */ | 321 | #define FSCACHE_COOKIE_PENDING_TAG 0 /* pages tag: pending write to cache */ |
322 | #define FSCACHE_COOKIE_STORING_TAG 1 /* pages tag: writing to cache */ | ||
306 | 323 | ||
307 | unsigned long flags; | 324 | unsigned long flags; |
308 | #define FSCACHE_COOKIE_LOOKING_UP 0 /* T if non-index cookie being looked up still */ | 325 | #define FSCACHE_COOKIE_LOOKING_UP 0 /* T if non-index cookie being looked up still */ |
@@ -337,6 +354,7 @@ struct fscache_object { | |||
337 | FSCACHE_OBJECT_RECYCLING, /* retiring object */ | 354 | FSCACHE_OBJECT_RECYCLING, /* retiring object */ |
338 | FSCACHE_OBJECT_WITHDRAWING, /* withdrawing object */ | 355 | FSCACHE_OBJECT_WITHDRAWING, /* withdrawing object */ |
339 | FSCACHE_OBJECT_DEAD, /* object is now dead */ | 356 | FSCACHE_OBJECT_DEAD, /* object is now dead */ |
357 | FSCACHE_OBJECT__NSTATES | ||
340 | } state; | 358 | } state; |
341 | 359 | ||
342 | int debug_id; /* debugging ID */ | 360 | int debug_id; /* debugging ID */ |
@@ -345,6 +363,7 @@ struct fscache_object { | |||
345 | int n_obj_ops; /* number of object ops outstanding on object */ | 363 | int n_obj_ops; /* number of object ops outstanding on object */ |
346 | int n_in_progress; /* number of ops in progress */ | 364 | int n_in_progress; /* number of ops in progress */ |
347 | int n_exclusive; /* number of exclusive ops queued */ | 365 | int n_exclusive; /* number of exclusive ops queued */ |
366 | atomic_t n_reads; /* number of read ops in progress */ | ||
348 | spinlock_t lock; /* state and operations lock */ | 367 | spinlock_t lock; /* state and operations lock */ |
349 | 368 | ||
350 | unsigned long lookup_jif; /* time at which lookup started */ | 369 | unsigned long lookup_jif; /* time at which lookup started */ |
@@ -358,6 +377,7 @@ struct fscache_object { | |||
358 | #define FSCACHE_OBJECT_EV_RELEASE 4 /* T if netfs requested object release */ | 377 | #define FSCACHE_OBJECT_EV_RELEASE 4 /* T if netfs requested object release */ |
359 | #define FSCACHE_OBJECT_EV_RETIRE 5 /* T if netfs requested object retirement */ | 378 | #define FSCACHE_OBJECT_EV_RETIRE 5 /* T if netfs requested object retirement */ |
360 | #define FSCACHE_OBJECT_EV_WITHDRAW 6 /* T if cache requested object withdrawal */ | 379 | #define FSCACHE_OBJECT_EV_WITHDRAW 6 /* T if cache requested object withdrawal */ |
380 | #define FSCACHE_OBJECT_EVENTS_MASK 0x7f /* mask of all events*/ | ||
361 | 381 | ||
362 | unsigned long flags; | 382 | unsigned long flags; |
363 | #define FSCACHE_OBJECT_LOCK 0 /* T if object is busy being processed */ | 383 | #define FSCACHE_OBJECT_LOCK 0 /* T if object is busy being processed */ |
@@ -373,7 +393,11 @@ struct fscache_object { | |||
373 | struct list_head dependents; /* FIFO of dependent objects */ | 393 | struct list_head dependents; /* FIFO of dependent objects */ |
374 | struct list_head dep_link; /* link in parent's dependents list */ | 394 | struct list_head dep_link; /* link in parent's dependents list */ |
375 | struct list_head pending_ops; /* unstarted operations on this object */ | 395 | struct list_head pending_ops; /* unstarted operations on this object */ |
396 | #ifdef CONFIG_FSCACHE_OBJECT_LIST | ||
397 | struct rb_node objlist_link; /* link in global object list */ | ||
398 | #endif | ||
376 | pgoff_t store_limit; /* current storage limit */ | 399 | pgoff_t store_limit; /* current storage limit */ |
400 | loff_t store_limit_l; /* current storage limit */ | ||
377 | }; | 401 | }; |
378 | 402 | ||
379 | extern const char *fscache_object_states[]; | 403 | extern const char *fscache_object_states[]; |
@@ -383,6 +407,10 @@ extern const char *fscache_object_states[]; | |||
383 | (obj)->state >= FSCACHE_OBJECT_AVAILABLE && \ | 407 | (obj)->state >= FSCACHE_OBJECT_AVAILABLE && \ |
384 | (obj)->state < FSCACHE_OBJECT_DYING) | 408 | (obj)->state < FSCACHE_OBJECT_DYING) |
385 | 409 | ||
410 | #define fscache_object_is_dead(obj) \ | ||
411 | (test_bit(FSCACHE_IOERROR, &(obj)->cache->flags) && \ | ||
412 | (obj)->state >= FSCACHE_OBJECT_DYING) | ||
413 | |||
386 | extern const struct slow_work_ops fscache_object_slow_work_ops; | 414 | extern const struct slow_work_ops fscache_object_slow_work_ops; |
387 | 415 | ||
388 | /** | 416 | /** |
@@ -414,6 +442,7 @@ void fscache_object_init(struct fscache_object *object, | |||
414 | object->events = object->event_mask = 0; | 442 | object->events = object->event_mask = 0; |
415 | object->flags = 0; | 443 | object->flags = 0; |
416 | object->store_limit = 0; | 444 | object->store_limit = 0; |
445 | object->store_limit_l = 0; | ||
417 | object->cache = cache; | 446 | object->cache = cache; |
418 | object->cookie = cookie; | 447 | object->cookie = cookie; |
419 | object->parent = NULL; | 448 | object->parent = NULL; |
@@ -422,6 +451,12 @@ void fscache_object_init(struct fscache_object *object, | |||
422 | extern void fscache_object_lookup_negative(struct fscache_object *object); | 451 | extern void fscache_object_lookup_negative(struct fscache_object *object); |
423 | extern void fscache_obtained_object(struct fscache_object *object); | 452 | extern void fscache_obtained_object(struct fscache_object *object); |
424 | 453 | ||
454 | #ifdef CONFIG_FSCACHE_OBJECT_LIST | ||
455 | extern void fscache_object_destroy(struct fscache_object *object); | ||
456 | #else | ||
457 | #define fscache_object_destroy(object) do {} while(0) | ||
458 | #endif | ||
459 | |||
425 | /** | 460 | /** |
426 | * fscache_object_destroyed - Note destruction of an object in a cache | 461 | * fscache_object_destroyed - Note destruction of an object in a cache |
427 | * @cache: The cache from which the object came | 462 | * @cache: The cache from which the object came |
@@ -460,6 +495,7 @@ static inline void fscache_object_lookup_error(struct fscache_object *object) | |||
460 | static inline | 495 | static inline |
461 | void fscache_set_store_limit(struct fscache_object *object, loff_t i_size) | 496 | void fscache_set_store_limit(struct fscache_object *object, loff_t i_size) |
462 | { | 497 | { |
498 | object->store_limit_l = i_size; | ||
463 | object->store_limit = i_size >> PAGE_SHIFT; | 499 | object->store_limit = i_size >> PAGE_SHIFT; |
464 | if (i_size & ~PAGE_MASK) | 500 | if (i_size & ~PAGE_MASK) |
465 | object->store_limit++; | 501 | object->store_limit++; |
diff --git a/include/linux/fscache.h b/include/linux/fscache.h index 6d8ee466e0a0..595ce49288b7 100644 --- a/include/linux/fscache.h +++ b/include/linux/fscache.h | |||
@@ -202,6 +202,8 @@ extern int __fscache_write_page(struct fscache_cookie *, struct page *, gfp_t); | |||
202 | extern void __fscache_uncache_page(struct fscache_cookie *, struct page *); | 202 | extern void __fscache_uncache_page(struct fscache_cookie *, struct page *); |
203 | extern bool __fscache_check_page_write(struct fscache_cookie *, struct page *); | 203 | extern bool __fscache_check_page_write(struct fscache_cookie *, struct page *); |
204 | extern void __fscache_wait_on_page_write(struct fscache_cookie *, struct page *); | 204 | extern void __fscache_wait_on_page_write(struct fscache_cookie *, struct page *); |
205 | extern bool __fscache_maybe_release_page(struct fscache_cookie *, struct page *, | ||
206 | gfp_t); | ||
205 | 207 | ||
206 | /** | 208 | /** |
207 | * fscache_register_netfs - Register a filesystem as desiring caching services | 209 | * fscache_register_netfs - Register a filesystem as desiring caching services |
@@ -615,4 +617,29 @@ void fscache_wait_on_page_write(struct fscache_cookie *cookie, | |||
615 | __fscache_wait_on_page_write(cookie, page); | 617 | __fscache_wait_on_page_write(cookie, page); |
616 | } | 618 | } |
617 | 619 | ||
620 | /** | ||
621 | * fscache_maybe_release_page - Consider releasing a page, cancelling a store | ||
622 | * @cookie: The cookie representing the cache object | ||
623 | * @page: The netfs page that is being cached. | ||
624 | * @gfp: The gfp flags passed to releasepage() | ||
625 | * | ||
626 | * Consider releasing a page for the vmscan algorithm, on behalf of the netfs's | ||
627 | * releasepage() call. A storage request on the page may cancelled if it is | ||
628 | * not currently being processed. | ||
629 | * | ||
630 | * The function returns true if the page no longer has a storage request on it, | ||
631 | * and false if a storage request is left in place. If true is returned, the | ||
632 | * page will have been passed to fscache_uncache_page(). If false is returned | ||
633 | * the page cannot be freed yet. | ||
634 | */ | ||
635 | static inline | ||
636 | bool fscache_maybe_release_page(struct fscache_cookie *cookie, | ||
637 | struct page *page, | ||
638 | gfp_t gfp) | ||
639 | { | ||
640 | if (fscache_cookie_valid(cookie) && PageFsCache(page)) | ||
641 | return __fscache_maybe_release_page(cookie, page, gfp); | ||
642 | return false; | ||
643 | } | ||
644 | |||
618 | #endif /* _LINUX_FSCACHE_H */ | 645 | #endif /* _LINUX_FSCACHE_H */ |
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h index f13255e06406..9eb07bbc6522 100644 --- a/include/linux/i2c-pnx.h +++ b/include/linux/i2c-pnx.h | |||
@@ -21,7 +21,7 @@ struct i2c_pnx_mif { | |||
21 | int mode; /* Interface mode */ | 21 | int mode; /* Interface mode */ |
22 | struct completion complete; /* I/O completion */ | 22 | struct completion complete; /* I/O completion */ |
23 | struct timer_list timer; /* Timeout */ | 23 | struct timer_list timer; /* Timeout */ |
24 | char * buf; /* Data buffer */ | 24 | u8 * buf; /* Data buffer */ |
25 | int len; /* Length of data buffer */ | 25 | int len; /* Length of data buffer */ |
26 | }; | 26 | }; |
27 | 27 | ||
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 57d41b0abce2..7b40cda57a70 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -361,6 +361,24 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data) | |||
361 | dev_set_drvdata(&dev->dev, data); | 361 | dev_set_drvdata(&dev->dev, data); |
362 | } | 362 | } |
363 | 363 | ||
364 | /** | ||
365 | * i2c_lock_adapter - Prevent access to an I2C bus segment | ||
366 | * @adapter: Target I2C bus segment | ||
367 | */ | ||
368 | static inline void i2c_lock_adapter(struct i2c_adapter *adapter) | ||
369 | { | ||
370 | mutex_lock(&adapter->bus_lock); | ||
371 | } | ||
372 | |||
373 | /** | ||
374 | * i2c_unlock_adapter - Reauthorize access to an I2C bus segment | ||
375 | * @adapter: Target I2C bus segment | ||
376 | */ | ||
377 | static inline void i2c_unlock_adapter(struct i2c_adapter *adapter) | ||
378 | { | ||
379 | mutex_unlock(&adapter->bus_lock); | ||
380 | } | ||
381 | |||
364 | /*flags for the client struct: */ | 382 | /*flags for the client struct: */ |
365 | #define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */ | 383 | #define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */ |
366 | #define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */ | 384 | #define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */ |
diff --git a/include/linux/input.h b/include/linux/input.h index db563bbac9dd..7be8a6537b57 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -1389,6 +1389,10 @@ extern struct class input_class; | |||
1389 | * methods; erase() is optional. set_gain() and set_autocenter() need | 1389 | * methods; erase() is optional. set_gain() and set_autocenter() need |
1390 | * only be implemented if driver sets up FF_GAIN and FF_AUTOCENTER | 1390 | * only be implemented if driver sets up FF_GAIN and FF_AUTOCENTER |
1391 | * bits. | 1391 | * bits. |
1392 | * | ||
1393 | * Note that playback(), set_gain() and set_autocenter() are called with | ||
1394 | * dev->event_lock spinlock held and interrupts off and thus may not | ||
1395 | * sleep. | ||
1392 | */ | 1396 | */ |
1393 | struct ff_device { | 1397 | struct ff_device { |
1394 | int (*upload)(struct input_dev *dev, struct ff_effect *effect, | 1398 | int (*upload)(struct input_dev *dev, struct ff_effect *effect, |
diff --git a/include/linux/isdn_ppp.h b/include/linux/isdn_ppp.h index 4c218ee7587a..8687a7dc0632 100644 --- a/include/linux/isdn_ppp.h +++ b/include/linux/isdn_ppp.h | |||
@@ -157,7 +157,7 @@ typedef struct { | |||
157 | 157 | ||
158 | typedef struct { | 158 | typedef struct { |
159 | int mp_mrru; /* unused */ | 159 | int mp_mrru; /* unused */ |
160 | struct sk_buff_head frags; /* fragments sl list */ | 160 | struct sk_buff * frags; /* fragments sl list -- use skb->next */ |
161 | long frames; /* number of frames in the frame list */ | 161 | long frames; /* number of frames in the frame list */ |
162 | unsigned int seq; /* last processed packet seq #: any packets | 162 | unsigned int seq; /* last processed packet seq #: any packets |
163 | * with smaller seq # will be dropped | 163 | * with smaller seq # will be dropped |
diff --git a/include/linux/mfd/wm831x/regulator.h b/include/linux/mfd/wm831x/regulator.h index f95466343fb2..955d30fc6a27 100644 --- a/include/linux/mfd/wm831x/regulator.h +++ b/include/linux/mfd/wm831x/regulator.h | |||
@@ -1212,7 +1212,7 @@ | |||
1212 | #define WM831X_LDO1_OK_SHIFT 0 /* LDO1_OK */ | 1212 | #define WM831X_LDO1_OK_SHIFT 0 /* LDO1_OK */ |
1213 | #define WM831X_LDO1_OK_WIDTH 1 /* LDO1_OK */ | 1213 | #define WM831X_LDO1_OK_WIDTH 1 /* LDO1_OK */ |
1214 | 1214 | ||
1215 | #define WM831X_ISINK_MAX_ISEL 56 | 1215 | #define WM831X_ISINK_MAX_ISEL 55 |
1216 | extern int wm831x_isinkv_values[WM831X_ISINK_MAX_ISEL]; | 1216 | extern int wm831x_isinkv_values[WM831X_ISINK_MAX_ISEL + 1]; |
1217 | 1217 | ||
1218 | #endif | 1218 | #endif |
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h index 79fec6af3f9f..ce520402e840 100644 --- a/include/linux/nilfs2_fs.h +++ b/include/linux/nilfs2_fs.h | |||
@@ -425,15 +425,6 @@ struct nilfs_dat_entry { | |||
425 | }; | 425 | }; |
426 | 426 | ||
427 | /** | 427 | /** |
428 | * struct nilfs_dat_group_desc - block group descriptor | ||
429 | * @dg_nfrees: number of free virtual block numbers in block group | ||
430 | */ | ||
431 | struct nilfs_dat_group_desc { | ||
432 | __le32 dg_nfrees; | ||
433 | }; | ||
434 | |||
435 | |||
436 | /** | ||
437 | * struct nilfs_snapshot_list - snapshot list | 428 | * struct nilfs_snapshot_list - snapshot list |
438 | * @ssl_next: next checkpoint number on snapshot list | 429 | * @ssl_next: next checkpoint number on snapshot list |
439 | * @ssl_prev: previous checkpoint number on snapshot list | 430 | * @ssl_prev: previous checkpoint number on snapshot list |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index b0f0f3851cd4..84cf1f3b7838 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -543,7 +543,7 @@ | |||
543 | #define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 | 543 | #define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 |
544 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 | 544 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 |
545 | #define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458 | 545 | #define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458 |
546 | #define PCI_DEVICE_ID_AMD_SB900_SMBUS 0x780b | 546 | #define PCI_DEVICE_ID_AMD_HUDSON2_SMBUS 0x780b |
547 | #define PCI_DEVICE_ID_AMD_CS5535_IDE 0x208F | 547 | #define PCI_DEVICE_ID_AMD_CS5535_IDE 0x208F |
548 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 | 548 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 |
549 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 | 549 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 |
@@ -1956,6 +1956,8 @@ | |||
1956 | #define PCI_DEVICE_ID_LAVA_DSERIAL 0x0100 /* 2x 16550 */ | 1956 | #define PCI_DEVICE_ID_LAVA_DSERIAL 0x0100 /* 2x 16550 */ |
1957 | #define PCI_DEVICE_ID_LAVA_QUATRO_A 0x0101 /* 2x 16550, half of 4 port */ | 1957 | #define PCI_DEVICE_ID_LAVA_QUATRO_A 0x0101 /* 2x 16550, half of 4 port */ |
1958 | #define PCI_DEVICE_ID_LAVA_QUATRO_B 0x0102 /* 2x 16550, half of 4 port */ | 1958 | #define PCI_DEVICE_ID_LAVA_QUATRO_B 0x0102 /* 2x 16550, half of 4 port */ |
1959 | #define PCI_DEVICE_ID_LAVA_QUATTRO_A 0x0120 /* 2x 16550A, half of 4 port */ | ||
1960 | #define PCI_DEVICE_ID_LAVA_QUATTRO_B 0x0121 /* 2x 16550A, half of 4 port */ | ||
1959 | #define PCI_DEVICE_ID_LAVA_OCTO_A 0x0180 /* 4x 16550A, half of 8 port */ | 1961 | #define PCI_DEVICE_ID_LAVA_OCTO_A 0x0180 /* 4x 16550A, half of 8 port */ |
1960 | #define PCI_DEVICE_ID_LAVA_OCTO_B 0x0181 /* 4x 16550A, half of 8 port */ | 1962 | #define PCI_DEVICE_ID_LAVA_OCTO_B 0x0181 /* 4x 16550A, half of 8 port */ |
1961 | #define PCI_DEVICE_ID_LAVA_PORT_PLUS 0x0200 /* 2x 16650 */ | 1963 | #define PCI_DEVICE_ID_LAVA_PORT_PLUS 0x0200 /* 2x 16650 */ |
diff --git a/include/linux/slow-work.h b/include/linux/slow-work.h index b65c8881f07a..13337bf6c3f5 100644 --- a/include/linux/slow-work.h +++ b/include/linux/slow-work.h | |||
@@ -17,13 +17,20 @@ | |||
17 | #ifdef CONFIG_SLOW_WORK | 17 | #ifdef CONFIG_SLOW_WORK |
18 | 18 | ||
19 | #include <linux/sysctl.h> | 19 | #include <linux/sysctl.h> |
20 | #include <linux/timer.h> | ||
20 | 21 | ||
21 | struct slow_work; | 22 | struct slow_work; |
23 | #ifdef CONFIG_SLOW_WORK_DEBUG | ||
24 | struct seq_file; | ||
25 | #endif | ||
22 | 26 | ||
23 | /* | 27 | /* |
24 | * The operations used to support slow work items | 28 | * The operations used to support slow work items |
25 | */ | 29 | */ |
26 | struct slow_work_ops { | 30 | struct slow_work_ops { |
31 | /* owner */ | ||
32 | struct module *owner; | ||
33 | |||
27 | /* get a ref on a work item | 34 | /* get a ref on a work item |
28 | * - return 0 if successful, -ve if not | 35 | * - return 0 if successful, -ve if not |
29 | */ | 36 | */ |
@@ -34,6 +41,11 @@ struct slow_work_ops { | |||
34 | 41 | ||
35 | /* execute a work item */ | 42 | /* execute a work item */ |
36 | void (*execute)(struct slow_work *work); | 43 | void (*execute)(struct slow_work *work); |
44 | |||
45 | #ifdef CONFIG_SLOW_WORK_DEBUG | ||
46 | /* describe a work item for debugfs */ | ||
47 | void (*desc)(struct slow_work *work, struct seq_file *m); | ||
48 | #endif | ||
37 | }; | 49 | }; |
38 | 50 | ||
39 | /* | 51 | /* |
@@ -42,13 +54,24 @@ struct slow_work_ops { | |||
42 | * queued | 54 | * queued |
43 | */ | 55 | */ |
44 | struct slow_work { | 56 | struct slow_work { |
57 | struct module *owner; /* the owning module */ | ||
45 | unsigned long flags; | 58 | unsigned long flags; |
46 | #define SLOW_WORK_PENDING 0 /* item pending (further) execution */ | 59 | #define SLOW_WORK_PENDING 0 /* item pending (further) execution */ |
47 | #define SLOW_WORK_EXECUTING 1 /* item currently executing */ | 60 | #define SLOW_WORK_EXECUTING 1 /* item currently executing */ |
48 | #define SLOW_WORK_ENQ_DEFERRED 2 /* item enqueue deferred */ | 61 | #define SLOW_WORK_ENQ_DEFERRED 2 /* item enqueue deferred */ |
49 | #define SLOW_WORK_VERY_SLOW 3 /* item is very slow */ | 62 | #define SLOW_WORK_VERY_SLOW 3 /* item is very slow */ |
63 | #define SLOW_WORK_CANCELLING 4 /* item is being cancelled, don't enqueue */ | ||
64 | #define SLOW_WORK_DELAYED 5 /* item is struct delayed_slow_work with active timer */ | ||
50 | const struct slow_work_ops *ops; /* operations table for this item */ | 65 | const struct slow_work_ops *ops; /* operations table for this item */ |
51 | struct list_head link; /* link in queue */ | 66 | struct list_head link; /* link in queue */ |
67 | #ifdef CONFIG_SLOW_WORK_DEBUG | ||
68 | struct timespec mark; /* jiffies at which queued or exec begun */ | ||
69 | #endif | ||
70 | }; | ||
71 | |||
72 | struct delayed_slow_work { | ||
73 | struct slow_work work; | ||
74 | struct timer_list timer; | ||
52 | }; | 75 | }; |
53 | 76 | ||
54 | /** | 77 | /** |
@@ -67,6 +90,20 @@ static inline void slow_work_init(struct slow_work *work, | |||
67 | } | 90 | } |
68 | 91 | ||
69 | /** | 92 | /** |
93 | * slow_work_init - Initialise a delayed slow work item | ||
94 | * @work: The work item to initialise | ||
95 | * @ops: The operations to use to handle the slow work item | ||
96 | * | ||
97 | * Initialise a delayed slow work item. | ||
98 | */ | ||
99 | static inline void delayed_slow_work_init(struct delayed_slow_work *dwork, | ||
100 | const struct slow_work_ops *ops) | ||
101 | { | ||
102 | init_timer(&dwork->timer); | ||
103 | slow_work_init(&dwork->work, ops); | ||
104 | } | ||
105 | |||
106 | /** | ||
70 | * vslow_work_init - Initialise a very slow work item | 107 | * vslow_work_init - Initialise a very slow work item |
71 | * @work: The work item to initialise | 108 | * @work: The work item to initialise |
72 | * @ops: The operations to use to handle the slow work item | 109 | * @ops: The operations to use to handle the slow work item |
@@ -83,9 +120,40 @@ static inline void vslow_work_init(struct slow_work *work, | |||
83 | INIT_LIST_HEAD(&work->link); | 120 | INIT_LIST_HEAD(&work->link); |
84 | } | 121 | } |
85 | 122 | ||
123 | /** | ||
124 | * slow_work_is_queued - Determine if a slow work item is on the work queue | ||
125 | * work: The work item to test | ||
126 | * | ||
127 | * Determine if the specified slow-work item is on the work queue. This | ||
128 | * returns true if it is actually on the queue. | ||
129 | * | ||
130 | * If the item is executing and has been marked for requeue when execution | ||
131 | * finishes, then false will be returned. | ||
132 | * | ||
133 | * Anyone wishing to wait for completion of execution can wait on the | ||
134 | * SLOW_WORK_EXECUTING bit. | ||
135 | */ | ||
136 | static inline bool slow_work_is_queued(struct slow_work *work) | ||
137 | { | ||
138 | unsigned long flags = work->flags; | ||
139 | return flags & SLOW_WORK_PENDING && !(flags & SLOW_WORK_EXECUTING); | ||
140 | } | ||
141 | |||
86 | extern int slow_work_enqueue(struct slow_work *work); | 142 | extern int slow_work_enqueue(struct slow_work *work); |
87 | extern int slow_work_register_user(void); | 143 | extern void slow_work_cancel(struct slow_work *work); |
88 | extern void slow_work_unregister_user(void); | 144 | extern int slow_work_register_user(struct module *owner); |
145 | extern void slow_work_unregister_user(struct module *owner); | ||
146 | |||
147 | extern int delayed_slow_work_enqueue(struct delayed_slow_work *dwork, | ||
148 | unsigned long delay); | ||
149 | |||
150 | static inline void delayed_slow_work_cancel(struct delayed_slow_work *dwork) | ||
151 | { | ||
152 | slow_work_cancel(&dwork->work); | ||
153 | } | ||
154 | |||
155 | extern bool slow_work_sleep_till_thread_needed(struct slow_work *work, | ||
156 | signed long *_timeout); | ||
89 | 157 | ||
90 | #ifdef CONFIG_SYSCTL | 158 | #ifdef CONFIG_SYSCTL |
91 | extern ctl_table slow_work_sysctls[]; | 159 | extern ctl_table slow_work_sysctls[]; |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index cd15df6c63cd..5e781d824e6d 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -301,6 +301,8 @@ static inline int unregister_pm_notifier(struct notifier_block *nb) | |||
301 | #define pm_notifier(fn, pri) do { (void)(fn); } while (0) | 301 | #define pm_notifier(fn, pri) do { (void)(fn); } while (0) |
302 | #endif /* !CONFIG_PM_SLEEP */ | 302 | #endif /* !CONFIG_PM_SLEEP */ |
303 | 303 | ||
304 | extern struct mutex pm_mutex; | ||
305 | |||
304 | #ifndef CONFIG_HIBERNATION | 306 | #ifndef CONFIG_HIBERNATION |
305 | static inline void register_nosave_region(unsigned long b, unsigned long e) | 307 | static inline void register_nosave_region(unsigned long b, unsigned long e) |
306 | { | 308 | { |
@@ -308,8 +310,23 @@ static inline void register_nosave_region(unsigned long b, unsigned long e) | |||
308 | static inline void register_nosave_region_late(unsigned long b, unsigned long e) | 310 | static inline void register_nosave_region_late(unsigned long b, unsigned long e) |
309 | { | 311 | { |
310 | } | 312 | } |
311 | #endif | ||
312 | 313 | ||
313 | extern struct mutex pm_mutex; | 314 | static inline void lock_system_sleep(void) {} |
315 | static inline void unlock_system_sleep(void) {} | ||
316 | |||
317 | #else | ||
318 | |||
319 | /* Let some subsystems like memory hotadd exclude hibernation */ | ||
320 | |||
321 | static inline void lock_system_sleep(void) | ||
322 | { | ||
323 | mutex_lock(&pm_mutex); | ||
324 | } | ||
325 | |||
326 | static inline void unlock_system_sleep(void) | ||
327 | { | ||
328 | mutex_unlock(&pm_mutex); | ||
329 | } | ||
330 | #endif | ||
314 | 331 | ||
315 | #endif /* _LINUX_SUSPEND_H */ | 332 | #endif /* _LINUX_SUSPEND_H */ |
diff --git a/include/linux/vt.h b/include/linux/vt.h index 7afca0d72139..7ffa11f06232 100644 --- a/include/linux/vt.h +++ b/include/linux/vt.h | |||
@@ -70,8 +70,8 @@ struct vt_event { | |||
70 | #define VT_EVENT_UNBLANK 0x0004 /* Screen unblank */ | 70 | #define VT_EVENT_UNBLANK 0x0004 /* Screen unblank */ |
71 | #define VT_EVENT_RESIZE 0x0008 /* Resize display */ | 71 | #define VT_EVENT_RESIZE 0x0008 /* Resize display */ |
72 | #define VT_MAX_EVENT 0x000F | 72 | #define VT_MAX_EVENT 0x000F |
73 | unsigned int old; /* Old console */ | 73 | unsigned int oldev; /* Old console */ |
74 | unsigned int new; /* New console (if changing) */ | 74 | unsigned int newev; /* New console (if changing) */ |
75 | unsigned int pad[4]; /* Padding for expansion */ | 75 | unsigned int pad[4]; /* Padding for expansion */ |
76 | }; | 76 | }; |
77 | 77 | ||
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index c75b960c8ac8..998c30fc8981 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -1283,6 +1283,12 @@ enum ieee80211_filter_flags { | |||
1283 | * | 1283 | * |
1284 | * These flags are used with the ampdu_action() callback in | 1284 | * These flags are used with the ampdu_action() callback in |
1285 | * &struct ieee80211_ops to indicate which action is needed. | 1285 | * &struct ieee80211_ops to indicate which action is needed. |
1286 | * | ||
1287 | * Note that drivers MUST be able to deal with a TX aggregation | ||
1288 | * session being stopped even before they OK'ed starting it by | ||
1289 | * calling ieee80211_start_tx_ba_cb(_irqsafe), because the peer | ||
1290 | * might receive the addBA frame and send a delBA right away! | ||
1291 | * | ||
1286 | * @IEEE80211_AMPDU_RX_START: start Rx aggregation | 1292 | * @IEEE80211_AMPDU_RX_START: start Rx aggregation |
1287 | * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation | 1293 | * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation |
1288 | * @IEEE80211_AMPDU_TX_START: start Tx aggregation | 1294 | * @IEEE80211_AMPDU_TX_START: start Tx aggregation |
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index cbdd6284996d..5cf7270e3ffc 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -255,11 +255,9 @@ static inline bool nf_ct_kill(struct nf_conn *ct) | |||
255 | } | 255 | } |
256 | 256 | ||
257 | /* These are for NAT. Icky. */ | 257 | /* These are for NAT. Icky. */ |
258 | /* Update TCP window tracking data when NAT mangles the packet */ | 258 | extern s16 (*nf_ct_nat_offset)(const struct nf_conn *ct, |
259 | extern void nf_conntrack_tcp_update(const struct sk_buff *skb, | 259 | enum ip_conntrack_dir dir, |
260 | unsigned int dataoff, | 260 | u32 seq); |
261 | struct nf_conn *ct, int dir, | ||
262 | s16 offset); | ||
263 | 261 | ||
264 | /* Fake conntrack entry for untracked connections */ | 262 | /* Fake conntrack entry for untracked connections */ |
265 | extern struct nf_conn nf_conntrack_untracked; | 263 | extern struct nf_conn nf_conntrack_untracked; |
diff --git a/include/net/netfilter/nf_nat_helper.h b/include/net/netfilter/nf_nat_helper.h index 237a961f40e1..4222220920a5 100644 --- a/include/net/netfilter/nf_nat_helper.h +++ b/include/net/netfilter/nf_nat_helper.h | |||
@@ -32,4 +32,8 @@ extern int (*nf_nat_seq_adjust_hook)(struct sk_buff *skb, | |||
32 | * to port ct->master->saved_proto. */ | 32 | * to port ct->master->saved_proto. */ |
33 | extern void nf_nat_follow_master(struct nf_conn *ct, | 33 | extern void nf_nat_follow_master(struct nf_conn *ct, |
34 | struct nf_conntrack_expect *this); | 34 | struct nf_conntrack_expect *this); |
35 | |||
36 | extern s16 nf_nat_get_offset(const struct nf_conn *ct, | ||
37 | enum ip_conntrack_dir dir, | ||
38 | u32 seq); | ||
35 | #endif | 39 | #endif |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 6e5f0e0c7967..0a474568b003 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -893,7 +893,6 @@ struct sctp_transport { | |||
893 | */ | 893 | */ |
894 | /* RTO : The current retransmission timeout value. */ | 894 | /* RTO : The current retransmission timeout value. */ |
895 | unsigned long rto; | 895 | unsigned long rto; |
896 | unsigned long last_rto; | ||
897 | 896 | ||
898 | __u32 rtt; /* This is the most recent RTT. */ | 897 | __u32 rtt; /* This is the most recent RTT. */ |
899 | 898 | ||
@@ -1980,7 +1979,7 @@ void sctp_assoc_set_primary(struct sctp_association *, | |||
1980 | void sctp_assoc_del_nonprimary_peers(struct sctp_association *, | 1979 | void sctp_assoc_del_nonprimary_peers(struct sctp_association *, |
1981 | struct sctp_transport *); | 1980 | struct sctp_transport *); |
1982 | int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *, | 1981 | int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *, |
1983 | gfp_t); | 1982 | sctp_scope_t, gfp_t); |
1984 | int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *, | 1983 | int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *, |
1985 | struct sctp_cookie*, | 1984 | struct sctp_cookie*, |
1986 | gfp_t gfp); | 1985 | gfp_t gfp); |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 9af48cbf0036..f097ae340bc1 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -145,6 +145,7 @@ struct scsi_device { | |||
145 | unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */ | 145 | unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */ |
146 | unsigned last_sector_bug:1; /* do not use multisector accesses on | 146 | unsigned last_sector_bug:1; /* do not use multisector accesses on |
147 | SD_LAST_BUGGY_SECTORS */ | 147 | SD_LAST_BUGGY_SECTORS */ |
148 | unsigned is_visible:1; /* is the device visible in sysfs */ | ||
148 | 149 | ||
149 | DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ | 150 | DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ |
150 | struct list_head event_list; /* asserted events */ | 151 | struct list_head event_list; /* asserted events */ |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 6e728b176904..47941fc5aba7 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -797,30 +797,23 @@ static inline unsigned int scsi_host_get_prot(struct Scsi_Host *shost) | |||
797 | 797 | ||
798 | static inline unsigned int scsi_host_dif_capable(struct Scsi_Host *shost, unsigned int target_type) | 798 | static inline unsigned int scsi_host_dif_capable(struct Scsi_Host *shost, unsigned int target_type) |
799 | { | 799 | { |
800 | switch (target_type) { | 800 | static unsigned char cap[] = { 0, |
801 | case 1: | 801 | SHOST_DIF_TYPE1_PROTECTION, |
802 | if (shost->prot_capabilities & SHOST_DIF_TYPE1_PROTECTION) | 802 | SHOST_DIF_TYPE2_PROTECTION, |
803 | return target_type; | 803 | SHOST_DIF_TYPE3_PROTECTION }; |
804 | case 2: | ||
805 | if (shost->prot_capabilities & SHOST_DIF_TYPE2_PROTECTION) | ||
806 | return target_type; | ||
807 | case 3: | ||
808 | if (shost->prot_capabilities & SHOST_DIF_TYPE3_PROTECTION) | ||
809 | return target_type; | ||
810 | } | ||
811 | 804 | ||
812 | return 0; | 805 | return shost->prot_capabilities & cap[target_type] ? target_type : 0; |
813 | } | 806 | } |
814 | 807 | ||
815 | static inline unsigned int scsi_host_dix_capable(struct Scsi_Host *shost, unsigned int target_type) | 808 | static inline unsigned int scsi_host_dix_capable(struct Scsi_Host *shost, unsigned int target_type) |
816 | { | 809 | { |
817 | #if defined(CONFIG_BLK_DEV_INTEGRITY) | 810 | #if defined(CONFIG_BLK_DEV_INTEGRITY) |
818 | switch (target_type) { | 811 | static unsigned char cap[] = { SHOST_DIX_TYPE0_PROTECTION, |
819 | case 0: return shost->prot_capabilities & SHOST_DIX_TYPE0_PROTECTION; | 812 | SHOST_DIX_TYPE1_PROTECTION, |
820 | case 1: return shost->prot_capabilities & SHOST_DIX_TYPE1_PROTECTION; | 813 | SHOST_DIX_TYPE2_PROTECTION, |
821 | case 2: return shost->prot_capabilities & SHOST_DIX_TYPE2_PROTECTION; | 814 | SHOST_DIX_TYPE3_PROTECTION }; |
822 | case 3: return shost->prot_capabilities & SHOST_DIX_TYPE3_PROTECTION; | 815 | |
823 | } | 816 | return shost->prot_capabilities & cap[target_type]; |
824 | #endif | 817 | #endif |
825 | return 0; | 818 | return 0; |
826 | } | 819 | } |