diff options
| author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-05-15 10:26:50 -0400 |
|---|---|---|
| committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-05-15 10:26:50 -0400 |
| commit | 12e04ffcd93b25dfd726d46338c2ee7d23de556e (patch) | |
| tree | f91479a62805619168994fd3ee55e3ffa23fc24e /include/linux/idr.h | |
| parent | 9eff37a8713939f218ab8bf0dc93f1d67af7b8b4 (diff) | |
| parent | f722406faae2d073cc1d01063d1123c35425939e (diff) | |
Merge tag 'v3.10-rc1' into stable/for-linus-3.10
Linux 3.10-rc1
* tag 'v3.10-rc1': (12273 commits)
Linux 3.10-rc1
[SCSI] qla2xxx: Update firmware link in Kconfig file.
[SCSI] iscsi class, qla4xxx: fix sess/conn refcounting when find fns are used
[SCSI] sas: unify the pointlessly separated enums sas_dev_type and sas_device_type
[SCSI] pm80xx: thermal, sas controller config and error handling update
[SCSI] pm80xx: NCQ error handling changes
[SCSI] pm80xx: WWN Modification for PM8081/88/89 controllers
[SCSI] pm80xx: Changed module name and debug messages update
[SCSI] pm80xx: Firmware flash memory free fix, with addition of new memory region for it
[SCSI] pm80xx: SPC new firmware changes for device id 0x8081 alone
[SCSI] pm80xx: Added SPCv/ve specific hardware functionalities and relevant changes in common files
[SCSI] pm80xx: MSI-X implementation for using 64 interrupts
[SCSI] pm80xx: Updated common functions common for SPC and SPCv/ve
[SCSI] pm80xx: Multiple inbound/outbound queue configuration
[SCSI] pm80xx: Added SPCv/ve specific ids, variables and modify for SPC
[SCSI] lpfc: fix up Kconfig dependencies
[SCSI] Handle MLQUEUE busy response in scsi_send_eh_cmnd
dm cache: set config value
dm cache: move config fns
dm thin: generate event when metadata threshold passed
...
Diffstat (limited to 'include/linux/idr.h')
| -rw-r--r-- | include/linux/idr.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/idr.h b/include/linux/idr.h index 2640c7e99e51..871a213a8477 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
| @@ -42,6 +42,7 @@ struct idr { | |||
| 42 | struct idr_layer *id_free; | 42 | struct idr_layer *id_free; |
| 43 | int layers; /* only valid w/o concurrent changes */ | 43 | int layers; /* only valid w/o concurrent changes */ |
| 44 | int id_free_cnt; | 44 | int id_free_cnt; |
| 45 | int cur; /* current pos for cyclic allocation */ | ||
| 45 | spinlock_t lock; | 46 | spinlock_t lock; |
| 46 | }; | 47 | }; |
| 47 | 48 | ||
| @@ -75,6 +76,7 @@ struct idr { | |||
| 75 | void *idr_find_slowpath(struct idr *idp, int id); | 76 | void *idr_find_slowpath(struct idr *idp, int id); |
| 76 | void idr_preload(gfp_t gfp_mask); | 77 | void idr_preload(gfp_t gfp_mask); |
| 77 | int idr_alloc(struct idr *idp, void *ptr, int start, int end, gfp_t gfp_mask); | 78 | int idr_alloc(struct idr *idp, void *ptr, int start, int end, gfp_t gfp_mask); |
| 79 | int idr_alloc_cyclic(struct idr *idr, void *ptr, int start, int end, gfp_t gfp_mask); | ||
| 78 | int idr_for_each(struct idr *idp, | 80 | int idr_for_each(struct idr *idp, |
| 79 | int (*fn)(int id, void *p, void *data), void *data); | 81 | int (*fn)(int id, void *p, void *data), void *data); |
| 80 | void *idr_get_next(struct idr *idp, int *nextid); | 82 | void *idr_get_next(struct idr *idp, int *nextid); |
| @@ -122,11 +124,13 @@ static inline void *idr_find(struct idr *idr, int id) | |||
| 122 | * @idp: idr handle | 124 | * @idp: idr handle |
| 123 | * @entry: the type * to use as cursor | 125 | * @entry: the type * to use as cursor |
| 124 | * @id: id entry's key | 126 | * @id: id entry's key |
| 127 | * | ||
| 128 | * @entry and @id do not need to be initialized before the loop, and | ||
| 129 | * after normal terminatinon @entry is left with the value NULL. This | ||
| 130 | * is convenient for a "not found" value. | ||
| 125 | */ | 131 | */ |
| 126 | #define idr_for_each_entry(idp, entry, id) \ | 132 | #define idr_for_each_entry(idp, entry, id) \ |
| 127 | for (id = 0, entry = (typeof(entry))idr_get_next((idp), &(id)); \ | 133 | for (id = 0; ((entry) = idr_get_next(idp, &(id))) != NULL; ++id) |
| 128 | entry != NULL; \ | ||
| 129 | ++id, entry = (typeof(entry))idr_get_next((idp), &(id))) | ||
| 130 | 134 | ||
| 131 | /* | 135 | /* |
| 132 | * Don't use the following functions. These exist only to suppress | 136 | * Don't use the following functions. These exist only to suppress |
