Annotation of /trunk/kernel26-magellan/patches-2.6.17-r6/0106-2.6.17.13-all-fixes.patch
Parent Directory | Revision Log
Revision 105 -
(hide annotations)
(download)
Sun Mar 11 16:17:56 2007 UTC (17 years, 6 months ago) by niro
File size: 3403 byte(s)
Sun Mar 11 16:17:56 2007 UTC (17 years, 6 months ago) by niro
File size: 3403 byte(s)
2.6.17-magellan-r6
1 | niro | 105 | diff --git a/include/linux/idr.h b/include/linux/idr.h |
2 | index d37c8d8..f559a71 100644 | ||
3 | --- a/include/linux/idr.h | ||
4 | +++ b/include/linux/idr.h | ||
5 | @@ -78,6 +78,7 @@ void *idr_find(struct idr *idp, int id); | ||
6 | int idr_pre_get(struct idr *idp, gfp_t gfp_mask); | ||
7 | int idr_get_new(struct idr *idp, void *ptr, int *id); | ||
8 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); | ||
9 | +void *idr_replace(struct idr *idp, void *ptr, int id); | ||
10 | void idr_remove(struct idr *idp, int id); | ||
11 | void idr_destroy(struct idr *idp); | ||
12 | void idr_init(struct idr *idp); | ||
13 | diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h | ||
14 | index 590dc6d..10d6759 100644 | ||
15 | --- a/include/linux/pci_ids.h | ||
16 | +++ b/include/linux/pci_ids.h | ||
17 | @@ -1235,6 +1235,7 @@ #define PCI_DEVICE_ID_VIA_PT880ULTRA 0x0 | ||
18 | #define PCI_DEVICE_ID_VIA_PX8X0_0 0x0259 | ||
19 | #define PCI_DEVICE_ID_VIA_3269_0 0x0269 | ||
20 | #define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282 | ||
21 | +#define PCI_DEVICE_ID_VIA_3296_0 0x0296 | ||
22 | #define PCI_DEVICE_ID_VIA_8363_0 0x0305 | ||
23 | #define PCI_DEVICE_ID_VIA_P4M800CE 0x0314 | ||
24 | #define PCI_DEVICE_ID_VIA_8371_0 0x0391 | ||
25 | @@ -1242,6 +1243,7 @@ #define PCI_DEVICE_ID_VIA_8501_0 0x0501 | ||
26 | #define PCI_DEVICE_ID_VIA_82C561 0x0561 | ||
27 | #define PCI_DEVICE_ID_VIA_82C586_1 0x0571 | ||
28 | #define PCI_DEVICE_ID_VIA_82C576 0x0576 | ||
29 | +#define PCI_DEVICE_ID_VIA_SATA_EIDE 0x0581 | ||
30 | #define PCI_DEVICE_ID_VIA_82C586_0 0x0586 | ||
31 | #define PCI_DEVICE_ID_VIA_82C596 0x0596 | ||
32 | #define PCI_DEVICE_ID_VIA_82C597_0 0x0597 | ||
33 | @@ -1282,10 +1284,11 @@ #define PCI_DEVICE_ID_VIA_8378_0 0x3205 | ||
34 | #define PCI_DEVICE_ID_VIA_8783_0 0x3208 | ||
35 | #define PCI_DEVICE_ID_VIA_8237 0x3227 | ||
36 | #define PCI_DEVICE_ID_VIA_8251 0x3287 | ||
37 | -#define PCI_DEVICE_ID_VIA_3296_0 0x0296 | ||
38 | +#define PCI_DEVICE_ID_VIA_8237A 0x3337 | ||
39 | #define PCI_DEVICE_ID_VIA_8231 0x8231 | ||
40 | #define PCI_DEVICE_ID_VIA_8231_4 0x8235 | ||
41 | #define PCI_DEVICE_ID_VIA_8365_1 0x8305 | ||
42 | +#define PCI_DEVICE_ID_VIA_CX700 0x8324 | ||
43 | #define PCI_DEVICE_ID_VIA_8371_1 0x8391 | ||
44 | #define PCI_DEVICE_ID_VIA_82C598_1 0x8598 | ||
45 | #define PCI_DEVICE_ID_VIA_838X_1 0xB188 | ||
46 | diff --git a/lib/idr.c b/lib/idr.c | ||
47 | index de19030..4d09681 100644 | ||
48 | --- a/lib/idr.c | ||
49 | +++ b/lib/idr.c | ||
50 | @@ -29,6 +29,7 @@ #include <linux/slab.h> | ||
51 | #include <linux/init.h> | ||
52 | #include <linux/module.h> | ||
53 | #endif | ||
54 | +#include <linux/err.h> | ||
55 | #include <linux/string.h> | ||
56 | #include <linux/idr.h> | ||
57 | |||
58 | @@ -398,6 +399,48 @@ void *idr_find(struct idr *idp, int id) | ||
59 | } | ||
60 | EXPORT_SYMBOL(idr_find); | ||
61 | |||
62 | +/** | ||
63 | + * idr_replace - replace pointer for given id | ||
64 | + * @idp: idr handle | ||
65 | + * @ptr: pointer you want associated with the id | ||
66 | + * @id: lookup key | ||
67 | + * | ||
68 | + * Replace the pointer registered with an id and return the old value. | ||
69 | + * A -ENOENT return indicates that @id was not found. | ||
70 | + * A -EINVAL return indicates that @id was not within valid constraints. | ||
71 | + * | ||
72 | + * The caller must serialize vs idr_find(), idr_get_new(), and idr_remove(). | ||
73 | + */ | ||
74 | +void *idr_replace(struct idr *idp, void *ptr, int id) | ||
75 | +{ | ||
76 | + int n; | ||
77 | + struct idr_layer *p, *old_p; | ||
78 | + | ||
79 | + n = idp->layers * IDR_BITS; | ||
80 | + p = idp->top; | ||
81 | + | ||
82 | + id &= MAX_ID_MASK; | ||
83 | + | ||
84 | + if (id >= (1 << n)) | ||
85 | + return ERR_PTR(-EINVAL); | ||
86 | + | ||
87 | + n -= IDR_BITS; | ||
88 | + while ((n > 0) && p) { | ||
89 | + p = p->ary[(id >> n) & IDR_MASK]; | ||
90 | + n -= IDR_BITS; | ||
91 | + } | ||
92 | + | ||
93 | + n = id & IDR_MASK; | ||
94 | + if (unlikely(p == NULL || !test_bit(n, &p->bitmap))) | ||
95 | + return ERR_PTR(-ENOENT); | ||
96 | + | ||
97 | + old_p = p->ary[n]; | ||
98 | + p->ary[n] = ptr; | ||
99 | + | ||
100 | + return old_p; | ||
101 | +} | ||
102 | +EXPORT_SYMBOL(idr_replace); | ||
103 | + | ||
104 | static void idr_cache_ctor(void * idr_layer, kmem_cache_t *idr_layer_cache, | ||
105 | unsigned long flags) | ||
106 | { |