diff options
-rw-r--r-- | MAINTAINERS | 6 | ||||
-rw-r--r-- | arch/x86/kernel/pci-dma_64.c | 49 | ||||
-rw-r--r-- | arch/x86/kernel/setup_64.c | 2 | ||||
-rw-r--r-- | drivers/mmc/core/Makefile | 2 | ||||
-rw-r--r-- | drivers/mmc/core/bus.c | 23 | ||||
-rw-r--r-- | drivers/mmc/core/bus.h | 11 | ||||
-rw-r--r-- | drivers/mmc/core/core.h | 2 | ||||
-rw-r--r-- | drivers/mmc/core/mmc.c | 90 | ||||
-rw-r--r-- | drivers/mmc/core/sd.c | 95 | ||||
-rw-r--r-- | drivers/mmc/core/sdio.c | 2 | ||||
-rw-r--r-- | drivers/mmc/core/sysfs.c | 43 | ||||
-rw-r--r-- | drivers/mmc/core/sysfs.h | 26 | ||||
-rw-r--r-- | drivers/pnp/isapnp/core.c | 25 | ||||
-rw-r--r-- | fs/cifs/cifs_dfs_ref.c | 18 | ||||
-rw-r--r-- | fs/cifs/cifsacl.c | 25 | ||||
-rw-r--r-- | fs/cifs/cifsproto.h | 9 | ||||
-rw-r--r-- | fs/cifs/dir.c | 5 | ||||
-rw-r--r-- | fs/cifs/dns_resolve.c | 8 | ||||
-rw-r--r-- | fs/cifs/file.c | 4 | ||||
-rw-r--r-- | fs/cifs/inode.c | 161 | ||||
-rw-r--r-- | fs/cifs/link.c | 2 | ||||
-rw-r--r-- | fs/proc/task_mmu.c | 50 | ||||
-rw-r--r-- | include/asm-x86/pci_64.h | 1 | ||||
-rw-r--r-- | include/linux/pnp.h | 2 |
24 files changed, 281 insertions, 380 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 03e4602e1b9c..73883b8bbd76 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -2935,9 +2935,9 @@ S: Maintained | |||
2935 | 2935 | ||
2936 | ORACLE CLUSTER FILESYSTEM 2 (OCFS2) | 2936 | ORACLE CLUSTER FILESYSTEM 2 (OCFS2) |
2937 | P: Mark Fasheh | 2937 | P: Mark Fasheh |
2938 | M: mark.fasheh@oracle.com | 2938 | M: mfasheh@suse.com |
2939 | P: Kurt Hackel | 2939 | P: Joel Becker |
2940 | M: kurt.hackel@oracle.com | 2940 | M: joel.becker@oracle.com |
2941 | L: ocfs2-devel@oss.oracle.com | 2941 | L: ocfs2-devel@oss.oracle.com |
2942 | W: http://oss.oracle.com/projects/ocfs2/ | 2942 | W: http://oss.oracle.com/projects/ocfs2/ |
2943 | S: Supported | 2943 | S: Supported |
diff --git a/arch/x86/kernel/pci-dma_64.c b/arch/x86/kernel/pci-dma_64.c index 8bc1e185e557..375cb2bc45be 100644 --- a/arch/x86/kernel/pci-dma_64.c +++ b/arch/x86/kernel/pci-dma_64.c | |||
@@ -8,8 +8,6 @@ | |||
8 | #include <linux/pci.h> | 8 | #include <linux/pci.h> |
9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
10 | #include <linux/dmar.h> | 10 | #include <linux/dmar.h> |
11 | #include <linux/bootmem.h> | ||
12 | #include <asm/proto.h> | ||
13 | #include <asm/io.h> | 11 | #include <asm/io.h> |
14 | #include <asm/gart.h> | 12 | #include <asm/gart.h> |
15 | #include <asm/calgary.h> | 13 | #include <asm/calgary.h> |
@@ -288,55 +286,8 @@ static __init int iommu_setup(char *p) | |||
288 | } | 286 | } |
289 | early_param("iommu", iommu_setup); | 287 | early_param("iommu", iommu_setup); |
290 | 288 | ||
291 | static __initdata void *dma32_bootmem_ptr; | ||
292 | static unsigned long dma32_bootmem_size __initdata = (128ULL<<20); | ||
293 | |||
294 | static int __init parse_dma32_size_opt(char *p) | ||
295 | { | ||
296 | if (!p) | ||
297 | return -EINVAL; | ||
298 | dma32_bootmem_size = memparse(p, &p); | ||
299 | return 0; | ||
300 | } | ||
301 | early_param("dma32_size", parse_dma32_size_opt); | ||
302 | |||
303 | void __init dma32_reserve_bootmem(void) | ||
304 | { | ||
305 | unsigned long size, align; | ||
306 | if (end_pfn <= MAX_DMA32_PFN) | ||
307 | return; | ||
308 | |||
309 | align = 64ULL<<20; | ||
310 | size = round_up(dma32_bootmem_size, align); | ||
311 | dma32_bootmem_ptr = __alloc_bootmem_nopanic(size, align, | ||
312 | __pa(MAX_DMA_ADDRESS)); | ||
313 | if (dma32_bootmem_ptr) | ||
314 | dma32_bootmem_size = size; | ||
315 | else | ||
316 | dma32_bootmem_size = 0; | ||
317 | } | ||
318 | static void __init dma32_free_bootmem(void) | ||
319 | { | ||
320 | int node; | ||
321 | |||
322 | if (end_pfn <= MAX_DMA32_PFN) | ||
323 | return; | ||
324 | |||
325 | if (!dma32_bootmem_ptr) | ||
326 | return; | ||
327 | |||
328 | for_each_online_node(node) | ||
329 | free_bootmem_node(NODE_DATA(node), __pa(dma32_bootmem_ptr), | ||
330 | dma32_bootmem_size); | ||
331 | |||
332 | dma32_bootmem_ptr = NULL; | ||
333 | dma32_bootmem_size = 0; | ||
334 | } | ||
335 | |||
336 | void __init pci_iommu_alloc(void) | 289 | void __init pci_iommu_alloc(void) |
337 | { | 290 | { |
338 | /* free the range so iommu could get some range less than 4G */ | ||
339 | dma32_free_bootmem(); | ||
340 | /* | 291 | /* |
341 | * The order of these functions is important for | 292 | * The order of these functions is important for |
342 | * fall-back/fail-over reasons | 293 | * fall-back/fail-over reasons |
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c index a775fe3de955..7637dc91c79b 100644 --- a/arch/x86/kernel/setup_64.c +++ b/arch/x86/kernel/setup_64.c | |||
@@ -389,8 +389,6 @@ void __init setup_arch(char **cmdline_p) | |||
389 | 389 | ||
390 | early_res_to_bootmem(); | 390 | early_res_to_bootmem(); |
391 | 391 | ||
392 | dma32_reserve_bootmem(); | ||
393 | |||
394 | #ifdef CONFIG_ACPI_SLEEP | 392 | #ifdef CONFIG_ACPI_SLEEP |
395 | /* | 393 | /* |
396 | * Reserve low memory region for sleep support. | 394 | * Reserve low memory region for sleep support. |
diff --git a/drivers/mmc/core/Makefile b/drivers/mmc/core/Makefile index 4985807257a8..19a1a254a0c5 100644 --- a/drivers/mmc/core/Makefile +++ b/drivers/mmc/core/Makefile | |||
@@ -7,7 +7,7 @@ ifeq ($(CONFIG_MMC_DEBUG),y) | |||
7 | endif | 7 | endif |
8 | 8 | ||
9 | obj-$(CONFIG_MMC) += mmc_core.o | 9 | obj-$(CONFIG_MMC) += mmc_core.o |
10 | mmc_core-y := core.o sysfs.o bus.o host.o \ | 10 | mmc_core-y := core.o bus.o host.o \ |
11 | mmc.o mmc_ops.o sd.o sd_ops.o \ | 11 | mmc.o mmc_ops.o sd.o sd_ops.o \ |
12 | sdio.o sdio_ops.o sdio_bus.o \ | 12 | sdio.o sdio_ops.o sdio_bus.o \ |
13 | sdio_cis.o sdio_io.o sdio_irq.o | 13 | sdio_cis.o sdio_io.o sdio_irq.o |
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index b0c22cad9423..fd95b18e988b 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/mmc/card.h> | 17 | #include <linux/mmc/card.h> |
18 | #include <linux/mmc/host.h> | 18 | #include <linux/mmc/host.h> |
19 | 19 | ||
20 | #include "sysfs.h" | ||
21 | #include "core.h" | 20 | #include "core.h" |
22 | #include "sdio_cis.h" | 21 | #include "sdio_cis.h" |
23 | #include "bus.h" | 22 | #include "bus.h" |
@@ -43,7 +42,7 @@ static ssize_t mmc_type_show(struct device *dev, | |||
43 | } | 42 | } |
44 | 43 | ||
45 | static struct device_attribute mmc_dev_attrs[] = { | 44 | static struct device_attribute mmc_dev_attrs[] = { |
46 | MMC_ATTR_RO(type), | 45 | __ATTR(type, S_IRUGO, mmc_type_show, NULL), |
47 | __ATTR_NULL, | 46 | __ATTR_NULL, |
48 | }; | 47 | }; |
49 | 48 | ||
@@ -189,7 +188,7 @@ static void mmc_release_card(struct device *dev) | |||
189 | /* | 188 | /* |
190 | * Allocate and initialise a new MMC card structure. | 189 | * Allocate and initialise a new MMC card structure. |
191 | */ | 190 | */ |
192 | struct mmc_card *mmc_alloc_card(struct mmc_host *host) | 191 | struct mmc_card *mmc_alloc_card(struct mmc_host *host, struct device_type *type) |
193 | { | 192 | { |
194 | struct mmc_card *card; | 193 | struct mmc_card *card; |
195 | 194 | ||
@@ -204,6 +203,7 @@ struct mmc_card *mmc_alloc_card(struct mmc_host *host) | |||
204 | card->dev.parent = mmc_classdev(host); | 203 | card->dev.parent = mmc_classdev(host); |
205 | card->dev.bus = &mmc_bus_type; | 204 | card->dev.bus = &mmc_bus_type; |
206 | card->dev.release = mmc_release_card; | 205 | card->dev.release = mmc_release_card; |
206 | card->dev.type = type; | ||
207 | 207 | ||
208 | return card; | 208 | return card; |
209 | } | 209 | } |
@@ -248,24 +248,10 @@ int mmc_add_card(struct mmc_card *card) | |||
248 | type, card->rca); | 248 | type, card->rca); |
249 | } | 249 | } |
250 | 250 | ||
251 | card->dev.uevent_suppress = 1; | ||
252 | |||
253 | ret = device_add(&card->dev); | 251 | ret = device_add(&card->dev); |
254 | if (ret) | 252 | if (ret) |
255 | return ret; | 253 | return ret; |
256 | 254 | ||
257 | if (card->host->bus_ops->sysfs_add) { | ||
258 | ret = card->host->bus_ops->sysfs_add(card->host, card); | ||
259 | if (ret) { | ||
260 | device_del(&card->dev); | ||
261 | return ret; | ||
262 | } | ||
263 | } | ||
264 | |||
265 | card->dev.uevent_suppress = 0; | ||
266 | |||
267 | kobject_uevent(&card->dev.kobj, KOBJ_ADD); | ||
268 | |||
269 | mmc_card_set_present(card); | 255 | mmc_card_set_present(card); |
270 | 256 | ||
271 | return 0; | 257 | return 0; |
@@ -285,9 +271,6 @@ void mmc_remove_card(struct mmc_card *card) | |||
285 | printk(KERN_INFO "%s: card %04x removed\n", | 271 | printk(KERN_INFO "%s: card %04x removed\n", |
286 | mmc_hostname(card->host), card->rca); | 272 | mmc_hostname(card->host), card->rca); |
287 | } | 273 | } |
288 | |||
289 | if (card->host->bus_ops->sysfs_remove) | ||
290 | card->host->bus_ops->sysfs_remove(card->host, card); | ||
291 | device_del(&card->dev); | 274 | device_del(&card->dev); |
292 | } | 275 | } |
293 | 276 | ||
diff --git a/drivers/mmc/core/bus.h b/drivers/mmc/core/bus.h index 4f35431116a8..18178766ab46 100644 --- a/drivers/mmc/core/bus.h +++ b/drivers/mmc/core/bus.h | |||
@@ -11,7 +11,16 @@ | |||
11 | #ifndef _MMC_CORE_BUS_H | 11 | #ifndef _MMC_CORE_BUS_H |
12 | #define _MMC_CORE_BUS_H | 12 | #define _MMC_CORE_BUS_H |
13 | 13 | ||
14 | struct mmc_card *mmc_alloc_card(struct mmc_host *host); | 14 | #define MMC_DEV_ATTR(name, fmt, args...) \ |
15 | static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute *attr, char *buf) \ | ||
16 | { \ | ||
17 | struct mmc_card *card = container_of(dev, struct mmc_card, dev); \ | ||
18 | return sprintf(buf, fmt, args); \ | ||
19 | } \ | ||
20 | static DEVICE_ATTR(name, S_IRUGO, mmc_##name##_show, NULL) | ||
21 | |||
22 | struct mmc_card *mmc_alloc_card(struct mmc_host *host, | ||
23 | struct device_type *type); | ||
15 | int mmc_add_card(struct mmc_card *card); | 24 | int mmc_add_card(struct mmc_card *card); |
16 | void mmc_remove_card(struct mmc_card *card); | 25 | void mmc_remove_card(struct mmc_card *card); |
17 | 26 | ||
diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h index 39daf2fb5dc4..cfa8e15b5923 100644 --- a/drivers/mmc/core/core.h +++ b/drivers/mmc/core/core.h | |||
@@ -18,8 +18,6 @@ | |||
18 | struct mmc_bus_ops { | 18 | struct mmc_bus_ops { |
19 | void (*remove)(struct mmc_host *); | 19 | void (*remove)(struct mmc_host *); |
20 | void (*detect)(struct mmc_host *); | 20 | void (*detect)(struct mmc_host *); |
21 | int (*sysfs_add)(struct mmc_host *, struct mmc_card *card); | ||
22 | void (*sysfs_remove)(struct mmc_host *, struct mmc_card *card); | ||
23 | void (*suspend)(struct mmc_host *); | 21 | void (*suspend)(struct mmc_host *); |
24 | void (*resume)(struct mmc_host *); | 22 | void (*resume)(struct mmc_host *); |
25 | }; | 23 | }; |
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 68c0e3b2f0e8..3da29eef8f7d 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/mmc/mmc.h> | 17 | #include <linux/mmc/mmc.h> |
18 | 18 | ||
19 | #include "core.h" | 19 | #include "core.h" |
20 | #include "sysfs.h" | ||
21 | #include "bus.h" | 20 | #include "bus.h" |
22 | #include "mmc_ops.h" | 21 | #include "mmc_ops.h" |
23 | 22 | ||
@@ -248,6 +247,44 @@ out: | |||
248 | return err; | 247 | return err; |
249 | } | 248 | } |
250 | 249 | ||
250 | MMC_DEV_ATTR(cid, "%08x%08x%08x%08x\n", card->raw_cid[0], card->raw_cid[1], | ||
251 | card->raw_cid[2], card->raw_cid[3]); | ||
252 | MMC_DEV_ATTR(csd, "%08x%08x%08x%08x\n", card->raw_csd[0], card->raw_csd[1], | ||
253 | card->raw_csd[2], card->raw_csd[3]); | ||
254 | MMC_DEV_ATTR(date, "%02d/%04d\n", card->cid.month, card->cid.year); | ||
255 | MMC_DEV_ATTR(fwrev, "0x%x\n", card->cid.fwrev); | ||
256 | MMC_DEV_ATTR(hwrev, "0x%x\n", card->cid.hwrev); | ||
257 | MMC_DEV_ATTR(manfid, "0x%06x\n", card->cid.manfid); | ||
258 | MMC_DEV_ATTR(name, "%s\n", card->cid.prod_name); | ||
259 | MMC_DEV_ATTR(oemid, "0x%04x\n", card->cid.oemid); | ||
260 | MMC_DEV_ATTR(serial, "0x%08x\n", card->cid.serial); | ||
261 | |||
262 | static struct attribute *mmc_std_attrs[] = { | ||
263 | &dev_attr_cid.attr, | ||
264 | &dev_attr_csd.attr, | ||
265 | &dev_attr_date.attr, | ||
266 | &dev_attr_fwrev.attr, | ||
267 | &dev_attr_hwrev.attr, | ||
268 | &dev_attr_manfid.attr, | ||
269 | &dev_attr_name.attr, | ||
270 | &dev_attr_oemid.attr, | ||
271 | &dev_attr_serial.attr, | ||
272 | NULL, | ||
273 | }; | ||
274 | |||
275 | static struct attribute_group mmc_std_attr_group = { | ||
276 | .attrs = mmc_std_attrs, | ||
277 | }; | ||
278 | |||
279 | static struct attribute_group *mmc_attr_groups[] = { | ||
280 | &mmc_std_attr_group, | ||
281 | NULL, | ||
282 | }; | ||
283 | |||
284 | static struct device_type mmc_type = { | ||
285 | .groups = mmc_attr_groups, | ||
286 | }; | ||
287 | |||
251 | /* | 288 | /* |
252 | * Handle the detection and initialisation of a card. | 289 | * Handle the detection and initialisation of a card. |
253 | * | 290 | * |
@@ -308,7 +345,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, | |||
308 | /* | 345 | /* |
309 | * Allocate card structure. | 346 | * Allocate card structure. |
310 | */ | 347 | */ |
311 | card = mmc_alloc_card(host); | 348 | card = mmc_alloc_card(host, &mmc_type); |
312 | if (IS_ERR(card)) { | 349 | if (IS_ERR(card)) { |
313 | err = PTR_ERR(card); | 350 | err = PTR_ERR(card); |
314 | goto err; | 351 | goto err; |
@@ -459,53 +496,6 @@ static void mmc_detect(struct mmc_host *host) | |||
459 | } | 496 | } |
460 | } | 497 | } |
461 | 498 | ||
462 | MMC_ATTR_FN(cid, "%08x%08x%08x%08x\n", card->raw_cid[0], card->raw_cid[1], | ||
463 | card->raw_cid[2], card->raw_cid[3]); | ||
464 | MMC_ATTR_FN(csd, "%08x%08x%08x%08x\n", card->raw_csd[0], card->raw_csd[1], | ||
465 | card->raw_csd[2], card->raw_csd[3]); | ||
466 | MMC_ATTR_FN(date, "%02d/%04d\n", card->cid.month, card->cid.year); | ||
467 | MMC_ATTR_FN(fwrev, "0x%x\n", card->cid.fwrev); | ||
468 | MMC_ATTR_FN(hwrev, "0x%x\n", card->cid.hwrev); | ||
469 | MMC_ATTR_FN(manfid, "0x%06x\n", card->cid.manfid); | ||
470 | MMC_ATTR_FN(name, "%s\n", card->cid.prod_name); | ||
471 | MMC_ATTR_FN(oemid, "0x%04x\n", card->cid.oemid); | ||
472 | MMC_ATTR_FN(serial, "0x%08x\n", card->cid.serial); | ||
473 | |||
474 | static struct device_attribute mmc_dev_attrs[] = { | ||
475 | MMC_ATTR_RO(cid), | ||
476 | MMC_ATTR_RO(csd), | ||
477 | MMC_ATTR_RO(date), | ||
478 | MMC_ATTR_RO(fwrev), | ||
479 | MMC_ATTR_RO(hwrev), | ||
480 | MMC_ATTR_RO(manfid), | ||
481 | MMC_ATTR_RO(name), | ||
482 | MMC_ATTR_RO(oemid), | ||
483 | MMC_ATTR_RO(serial), | ||
484 | __ATTR_NULL, | ||
485 | }; | ||
486 | |||
487 | /* | ||
488 | * Adds sysfs entries as relevant. | ||
489 | */ | ||
490 | static int mmc_sysfs_add(struct mmc_host *host, struct mmc_card *card) | ||
491 | { | ||
492 | int ret; | ||
493 | |||
494 | ret = mmc_add_attrs(card, mmc_dev_attrs); | ||
495 | if (ret < 0) | ||
496 | return ret; | ||
497 | |||
498 | return 0; | ||
499 | } | ||
500 | |||
501 | /* | ||
502 | * Removes the sysfs entries added by mmc_sysfs_add(). | ||
503 | */ | ||
504 | static void mmc_sysfs_remove(struct mmc_host *host, struct mmc_card *card) | ||
505 | { | ||
506 | mmc_remove_attrs(card, mmc_dev_attrs); | ||
507 | } | ||
508 | |||
509 | #ifdef CONFIG_MMC_UNSAFE_RESUME | 499 | #ifdef CONFIG_MMC_UNSAFE_RESUME |
510 | 500 | ||
511 | /* | 501 | /* |
@@ -560,8 +550,6 @@ static void mmc_resume(struct mmc_host *host) | |||
560 | static const struct mmc_bus_ops mmc_ops = { | 550 | static const struct mmc_bus_ops mmc_ops = { |
561 | .remove = mmc_remove, | 551 | .remove = mmc_remove, |
562 | .detect = mmc_detect, | 552 | .detect = mmc_detect, |
563 | .sysfs_add = mmc_sysfs_add, | ||
564 | .sysfs_remove = mmc_sysfs_remove, | ||
565 | .suspend = mmc_suspend, | 553 | .suspend = mmc_suspend, |
566 | .resume = mmc_resume, | 554 | .resume = mmc_resume, |
567 | }; | 555 | }; |
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index d1c1e0f592f1..7ef3b15c5e3d 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/mmc/sd.h> | 18 | #include <linux/mmc/sd.h> |
19 | 19 | ||
20 | #include "core.h" | 20 | #include "core.h" |
21 | #include "sysfs.h" | ||
22 | #include "bus.h" | 21 | #include "bus.h" |
23 | #include "mmc_ops.h" | 22 | #include "mmc_ops.h" |
24 | #include "sd_ops.h" | 23 | #include "sd_ops.h" |
@@ -283,6 +282,47 @@ out: | |||
283 | return err; | 282 | return err; |
284 | } | 283 | } |
285 | 284 | ||
285 | MMC_DEV_ATTR(cid, "%08x%08x%08x%08x\n", card->raw_cid[0], card->raw_cid[1], | ||
286 | card->raw_cid[2], card->raw_cid[3]); | ||
287 | MMC_DEV_ATTR(csd, "%08x%08x%08x%08x\n", card->raw_csd[0], card->raw_csd[1], | ||
288 | card->raw_csd[2], card->raw_csd[3]); | ||
289 | MMC_DEV_ATTR(scr, "%08x%08x\n", card->raw_scr[0], card->raw_scr[1]); | ||
290 | MMC_DEV_ATTR(date, "%02d/%04d\n", card->cid.month, card->cid.year); | ||
291 | MMC_DEV_ATTR(fwrev, "0x%x\n", card->cid.fwrev); | ||
292 | MMC_DEV_ATTR(hwrev, "0x%x\n", card->cid.hwrev); | ||
293 | MMC_DEV_ATTR(manfid, "0x%06x\n", card->cid.manfid); | ||
294 | MMC_DEV_ATTR(name, "%s\n", card->cid.prod_name); | ||
295 | MMC_DEV_ATTR(oemid, "0x%04x\n", card->cid.oemid); | ||
296 | MMC_DEV_ATTR(serial, "0x%08x\n", card->cid.serial); | ||
297 | |||
298 | |||
299 | static struct attribute *sd_std_attrs[] = { | ||
300 | &dev_attr_cid.attr, | ||
301 | &dev_attr_csd.attr, | ||
302 | &dev_attr_scr.attr, | ||
303 | &dev_attr_date.attr, | ||
304 | &dev_attr_fwrev.attr, | ||
305 | &dev_attr_hwrev.attr, | ||
306 | &dev_attr_manfid.attr, | ||
307 | &dev_attr_name.attr, | ||
308 | &dev_attr_oemid.attr, | ||
309 | &dev_attr_serial.attr, | ||
310 | NULL, | ||
311 | }; | ||
312 | |||
313 | static struct attribute_group sd_std_attr_group = { | ||
314 | .attrs = sd_std_attrs, | ||
315 | }; | ||
316 | |||
317 | static struct attribute_group *sd_attr_groups[] = { | ||
318 | &sd_std_attr_group, | ||
319 | NULL, | ||
320 | }; | ||
321 | |||
322 | static struct device_type sd_type = { | ||
323 | .groups = sd_attr_groups, | ||
324 | }; | ||
325 | |||
286 | /* | 326 | /* |
287 | * Handle the detection and initialisation of a card. | 327 | * Handle the detection and initialisation of a card. |
288 | * | 328 | * |
@@ -352,7 +392,7 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, | |||
352 | /* | 392 | /* |
353 | * Allocate card structure. | 393 | * Allocate card structure. |
354 | */ | 394 | */ |
355 | card = mmc_alloc_card(host); | 395 | card = mmc_alloc_card(host, &sd_type); |
356 | if (IS_ERR(card)) { | 396 | if (IS_ERR(card)) { |
357 | err = PTR_ERR(card); | 397 | err = PTR_ERR(card); |
358 | goto err; | 398 | goto err; |
@@ -518,55 +558,6 @@ static void mmc_sd_detect(struct mmc_host *host) | |||
518 | } | 558 | } |
519 | } | 559 | } |
520 | 560 | ||
521 | MMC_ATTR_FN(cid, "%08x%08x%08x%08x\n", card->raw_cid[0], card->raw_cid[1], | ||
522 | card->raw_cid[2], card->raw_cid[3]); | ||
523 | MMC_ATTR_FN(csd, "%08x%08x%08x%08x\n", card->raw_csd[0], card->raw_csd[1], | ||
524 | card->raw_csd[2], card->raw_csd[3]); | ||
525 | MMC_ATTR_FN(scr, "%08x%08x\n", card->raw_scr[0], card->raw_scr[1]); | ||
526 | MMC_ATTR_FN(date, "%02d/%04d\n", card->cid.month, card->cid.year); | ||
527 | MMC_ATTR_FN(fwrev, "0x%x\n", card->cid.fwrev); | ||
528 | MMC_ATTR_FN(hwrev, "0x%x\n", card->cid.hwrev); | ||
529 | MMC_ATTR_FN(manfid, "0x%06x\n", card->cid.manfid); | ||
530 | MMC_ATTR_FN(name, "%s\n", card->cid.prod_name); | ||
531 | MMC_ATTR_FN(oemid, "0x%04x\n", card->cid.oemid); | ||
532 | MMC_ATTR_FN(serial, "0x%08x\n", card->cid.serial); | ||
533 | |||
534 | static struct device_attribute mmc_sd_dev_attrs[] = { | ||
535 | MMC_ATTR_RO(cid), | ||
536 | MMC_ATTR_RO(csd), | ||
537 | MMC_ATTR_RO(scr), | ||
538 | MMC_ATTR_RO(date), | ||
539 | MMC_ATTR_RO(fwrev), | ||
540 | MMC_ATTR_RO(hwrev), | ||
541 | MMC_ATTR_RO(manfid), | ||
542 | MMC_ATTR_RO(name), | ||
543 | MMC_ATTR_RO(oemid), | ||
544 | MMC_ATTR_RO(serial), | ||
545 | __ATTR_NULL, | ||
546 | }; | ||
547 | |||
548 | /* | ||
549 | * Adds sysfs entries as relevant. | ||
550 | */ | ||
551 | static int mmc_sd_sysfs_add(struct mmc_host *host, struct mmc_card *card) | ||
552 | { | ||
553 | int ret; | ||
554 | |||
555 | ret = mmc_add_attrs(card, mmc_sd_dev_attrs); | ||
556 | if (ret < 0) | ||
557 | return ret; | ||
558 | |||
559 | return 0; | ||
560 | } | ||
561 | |||
562 | /* | ||
563 | * Removes the sysfs entries added by mmc_sysfs_add(). | ||
564 | */ | ||
565 | static void mmc_sd_sysfs_remove(struct mmc_host *host, struct mmc_card *card) | ||
566 | { | ||
567 | mmc_remove_attrs(card, mmc_sd_dev_attrs); | ||
568 | } | ||
569 | |||
570 | #ifdef CONFIG_MMC_UNSAFE_RESUME | 561 | #ifdef CONFIG_MMC_UNSAFE_RESUME |
571 | 562 | ||
572 | /* | 563 | /* |
@@ -621,8 +612,6 @@ static void mmc_sd_resume(struct mmc_host *host) | |||
621 | static const struct mmc_bus_ops mmc_sd_ops = { | 612 | static const struct mmc_bus_ops mmc_sd_ops = { |
622 | .remove = mmc_sd_remove, | 613 | .remove = mmc_sd_remove, |
623 | .detect = mmc_sd_detect, | 614 | .detect = mmc_sd_detect, |
624 | .sysfs_add = mmc_sd_sysfs_add, | ||
625 | .sysfs_remove = mmc_sd_sysfs_remove, | ||
626 | .suspend = mmc_sd_suspend, | 615 | .suspend = mmc_sd_suspend, |
627 | .resume = mmc_sd_resume, | 616 | .resume = mmc_sd_resume, |
628 | }; | 617 | }; |
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 87a50f456efc..4eab79e09ccc 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c | |||
@@ -287,7 +287,7 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr) | |||
287 | /* | 287 | /* |
288 | * Allocate card structure. | 288 | * Allocate card structure. |
289 | */ | 289 | */ |
290 | card = mmc_alloc_card(host); | 290 | card = mmc_alloc_card(host, NULL); |
291 | if (IS_ERR(card)) { | 291 | if (IS_ERR(card)) { |
292 | err = PTR_ERR(card); | 292 | err = PTR_ERR(card); |
293 | goto err; | 293 | goto err; |
diff --git a/drivers/mmc/core/sysfs.c b/drivers/mmc/core/sysfs.c deleted file mode 100644 index 00a97e70f914..000000000000 --- a/drivers/mmc/core/sysfs.c +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * linux/drivers/mmc/core/sysfs.c | ||
3 | * | ||
4 | * Copyright (C) 2003 Russell King, All Rights Reserved. | ||
5 | * Copyright 2007 Pierre Ossman | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * MMC sysfs/driver model support. | ||
12 | */ | ||
13 | #include <linux/device.h> | ||
14 | |||
15 | #include <linux/mmc/card.h> | ||
16 | |||
17 | #include "sysfs.h" | ||
18 | |||
19 | int mmc_add_attrs(struct mmc_card *card, struct device_attribute *attrs) | ||
20 | { | ||
21 | int error = 0; | ||
22 | int i; | ||
23 | |||
24 | for (i = 0; attr_name(attrs[i]); i++) { | ||
25 | error = device_create_file(&card->dev, &attrs[i]); | ||
26 | if (error) { | ||
27 | while (--i >= 0) | ||
28 | device_remove_file(&card->dev, &attrs[i]); | ||
29 | break; | ||
30 | } | ||
31 | } | ||
32 | |||
33 | return error; | ||
34 | } | ||
35 | |||
36 | void mmc_remove_attrs(struct mmc_card *card, struct device_attribute *attrs) | ||
37 | { | ||
38 | int i; | ||
39 | |||
40 | for (i = 0; attr_name(attrs[i]); i++) | ||
41 | device_remove_file(&card->dev, &attrs[i]); | ||
42 | } | ||
43 | |||
diff --git a/drivers/mmc/core/sysfs.h b/drivers/mmc/core/sysfs.h deleted file mode 100644 index 4b8f670bd10f..000000000000 --- a/drivers/mmc/core/sysfs.h +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | /* | ||
2 | * linux/drivers/mmc/core/sysfs.h | ||
3 | * | ||
4 | * Copyright (C) 2003 Russell King, All Rights Reserved. | ||
5 | * Copyright 2007 Pierre Ossman | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef _MMC_CORE_SYSFS_H | ||
12 | #define _MMC_CORE_SYSFS_H | ||
13 | |||
14 | #define MMC_ATTR_FN(name, fmt, args...) \ | ||
15 | static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute *attr, char *buf) \ | ||
16 | { \ | ||
17 | struct mmc_card *card = container_of(dev, struct mmc_card, dev);\ | ||
18 | return sprintf(buf, fmt, args); \ | ||
19 | } | ||
20 | |||
21 | #define MMC_ATTR_RO(name) __ATTR(name, S_IRUGO, mmc_##name##_show, NULL) | ||
22 | |||
23 | int mmc_add_attrs(struct mmc_card *card, struct device_attribute *attrs); | ||
24 | void mmc_remove_attrs(struct mmc_card *card, struct device_attribute *attrs); | ||
25 | |||
26 | #endif | ||
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c index 2c925b7cd93e..257f5d827d83 100644 --- a/drivers/pnp/isapnp/core.c +++ b/drivers/pnp/isapnp/core.c | |||
@@ -88,6 +88,15 @@ MODULE_LICENSE("GPL"); | |||
88 | #define _LTAG_MEM32RANGE 0x85 | 88 | #define _LTAG_MEM32RANGE 0x85 |
89 | #define _LTAG_FIXEDMEM32RANGE 0x86 | 89 | #define _LTAG_FIXEDMEM32RANGE 0x86 |
90 | 90 | ||
91 | /* | ||
92 | * Sizes of ISAPNP logical device configuration register sets. | ||
93 | * See PNP-ISA-v1.0a.pdf, Appendix A. | ||
94 | */ | ||
95 | #define ISAPNP_MAX_MEM 4 | ||
96 | #define ISAPNP_MAX_PORT 8 | ||
97 | #define ISAPNP_MAX_IRQ 2 | ||
98 | #define ISAPNP_MAX_DMA 2 | ||
99 | |||
91 | static unsigned char isapnp_checksum_value; | 100 | static unsigned char isapnp_checksum_value; |
92 | static DEFINE_MUTEX(isapnp_cfg_mutex); | 101 | static DEFINE_MUTEX(isapnp_cfg_mutex); |
93 | static int isapnp_csn_count; | 102 | static int isapnp_csn_count; |
@@ -945,14 +954,14 @@ static int isapnp_read_resources(struct pnp_dev *dev, | |||
945 | 954 | ||
946 | dev->active = isapnp_read_byte(ISAPNP_CFG_ACTIVATE); | 955 | dev->active = isapnp_read_byte(ISAPNP_CFG_ACTIVATE); |
947 | if (dev->active) { | 956 | if (dev->active) { |
948 | for (tmp = 0; tmp < PNP_MAX_PORT; tmp++) { | 957 | for (tmp = 0; tmp < ISAPNP_MAX_PORT; tmp++) { |
949 | ret = isapnp_read_word(ISAPNP_CFG_PORT + (tmp << 1)); | 958 | ret = isapnp_read_word(ISAPNP_CFG_PORT + (tmp << 1)); |
950 | if (!ret) | 959 | if (!ret) |
951 | continue; | 960 | continue; |
952 | res->port_resource[tmp].start = ret; | 961 | res->port_resource[tmp].start = ret; |
953 | res->port_resource[tmp].flags = IORESOURCE_IO; | 962 | res->port_resource[tmp].flags = IORESOURCE_IO; |
954 | } | 963 | } |
955 | for (tmp = 0; tmp < PNP_MAX_MEM; tmp++) { | 964 | for (tmp = 0; tmp < ISAPNP_MAX_MEM; tmp++) { |
956 | ret = | 965 | ret = |
957 | isapnp_read_word(ISAPNP_CFG_MEM + (tmp << 3)) << 8; | 966 | isapnp_read_word(ISAPNP_CFG_MEM + (tmp << 3)) << 8; |
958 | if (!ret) | 967 | if (!ret) |
@@ -960,7 +969,7 @@ static int isapnp_read_resources(struct pnp_dev *dev, | |||
960 | res->mem_resource[tmp].start = ret; | 969 | res->mem_resource[tmp].start = ret; |
961 | res->mem_resource[tmp].flags = IORESOURCE_MEM; | 970 | res->mem_resource[tmp].flags = IORESOURCE_MEM; |
962 | } | 971 | } |
963 | for (tmp = 0; tmp < PNP_MAX_IRQ; tmp++) { | 972 | for (tmp = 0; tmp < ISAPNP_MAX_IRQ; tmp++) { |
964 | ret = | 973 | ret = |
965 | (isapnp_read_word(ISAPNP_CFG_IRQ + (tmp << 1)) >> | 974 | (isapnp_read_word(ISAPNP_CFG_IRQ + (tmp << 1)) >> |
966 | 8); | 975 | 8); |
@@ -970,7 +979,7 @@ static int isapnp_read_resources(struct pnp_dev *dev, | |||
970 | res->irq_resource[tmp].end = ret; | 979 | res->irq_resource[tmp].end = ret; |
971 | res->irq_resource[tmp].flags = IORESOURCE_IRQ; | 980 | res->irq_resource[tmp].flags = IORESOURCE_IRQ; |
972 | } | 981 | } |
973 | for (tmp = 0; tmp < PNP_MAX_DMA; tmp++) { | 982 | for (tmp = 0; tmp < ISAPNP_MAX_DMA; tmp++) { |
974 | ret = isapnp_read_byte(ISAPNP_CFG_DMA + tmp); | 983 | ret = isapnp_read_byte(ISAPNP_CFG_DMA + tmp); |
975 | if (ret == 4) | 984 | if (ret == 4) |
976 | continue; | 985 | continue; |
@@ -1002,14 +1011,14 @@ static int isapnp_set_resources(struct pnp_dev *dev, | |||
1002 | isapnp_cfg_begin(dev->card->number, dev->number); | 1011 | isapnp_cfg_begin(dev->card->number, dev->number); |
1003 | dev->active = 1; | 1012 | dev->active = 1; |
1004 | for (tmp = 0; | 1013 | for (tmp = 0; |
1005 | tmp < PNP_MAX_PORT | 1014 | tmp < ISAPNP_MAX_PORT |
1006 | && (res->port_resource[tmp]. | 1015 | && (res->port_resource[tmp]. |
1007 | flags & (IORESOURCE_IO | IORESOURCE_UNSET)) == IORESOURCE_IO; | 1016 | flags & (IORESOURCE_IO | IORESOURCE_UNSET)) == IORESOURCE_IO; |
1008 | tmp++) | 1017 | tmp++) |
1009 | isapnp_write_word(ISAPNP_CFG_PORT + (tmp << 1), | 1018 | isapnp_write_word(ISAPNP_CFG_PORT + (tmp << 1), |
1010 | res->port_resource[tmp].start); | 1019 | res->port_resource[tmp].start); |
1011 | for (tmp = 0; | 1020 | for (tmp = 0; |
1012 | tmp < PNP_MAX_IRQ | 1021 | tmp < ISAPNP_MAX_IRQ |
1013 | && (res->irq_resource[tmp]. | 1022 | && (res->irq_resource[tmp]. |
1014 | flags & (IORESOURCE_IRQ | IORESOURCE_UNSET)) == IORESOURCE_IRQ; | 1023 | flags & (IORESOURCE_IRQ | IORESOURCE_UNSET)) == IORESOURCE_IRQ; |
1015 | tmp++) { | 1024 | tmp++) { |
@@ -1019,14 +1028,14 @@ static int isapnp_set_resources(struct pnp_dev *dev, | |||
1019 | isapnp_write_byte(ISAPNP_CFG_IRQ + (tmp << 1), irq); | 1028 | isapnp_write_byte(ISAPNP_CFG_IRQ + (tmp << 1), irq); |
1020 | } | 1029 | } |
1021 | for (tmp = 0; | 1030 | for (tmp = 0; |
1022 | tmp < PNP_MAX_DMA | 1031 | tmp < ISAPNP_MAX_DMA |
1023 | && (res->dma_resource[tmp]. | 1032 | && (res->dma_resource[tmp]. |
1024 | flags & (IORESOURCE_DMA | IORESOURCE_UNSET)) == IORESOURCE_DMA; | 1033 | flags & (IORESOURCE_DMA | IORESOURCE_UNSET)) == IORESOURCE_DMA; |
1025 | tmp++) | 1034 | tmp++) |
1026 | isapnp_write_byte(ISAPNP_CFG_DMA + tmp, | 1035 | isapnp_write_byte(ISAPNP_CFG_DMA + tmp, |
1027 | res->dma_resource[tmp].start); | 1036 | res->dma_resource[tmp].start); |
1028 | for (tmp = 0; | 1037 | for (tmp = 0; |
1029 | tmp < PNP_MAX_MEM | 1038 | tmp < ISAPNP_MAX_MEM |
1030 | && (res->mem_resource[tmp]. | 1039 | && (res->mem_resource[tmp]. |
1031 | flags & (IORESOURCE_MEM | IORESOURCE_UNSET)) == IORESOURCE_MEM; | 1040 | flags & (IORESOURCE_MEM | IORESOURCE_UNSET)) == IORESOURCE_MEM; |
1032 | tmp++) | 1041 | tmp++) |
diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c index 7f8838253410..a1a95b027136 100644 --- a/fs/cifs/cifs_dfs_ref.c +++ b/fs/cifs/cifs_dfs_ref.c | |||
@@ -74,7 +74,7 @@ static char *cifs_get_share_name(const char *node_name) | |||
74 | pSep = memchr(UNC+2, '\\', len-2); | 74 | pSep = memchr(UNC+2, '\\', len-2); |
75 | if (!pSep) { | 75 | if (!pSep) { |
76 | cERROR(1, ("%s: no server name end in node name: %s", | 76 | cERROR(1, ("%s: no server name end in node name: %s", |
77 | __FUNCTION__, node_name)); | 77 | __func__, node_name)); |
78 | kfree(UNC); | 78 | kfree(UNC); |
79 | return NULL; | 79 | return NULL; |
80 | } | 80 | } |
@@ -84,7 +84,7 @@ static char *cifs_get_share_name(const char *node_name) | |||
84 | pSep = memchr(UNC+(pSep-UNC), '\\', len-(pSep-UNC)); | 84 | pSep = memchr(UNC+(pSep-UNC), '\\', len-(pSep-UNC)); |
85 | if (!pSep) { | 85 | if (!pSep) { |
86 | cERROR(1, ("%s:2 cant find share name in node name: %s", | 86 | cERROR(1, ("%s:2 cant find share name in node name: %s", |
87 | __FUNCTION__, node_name)); | 87 | __func__, node_name)); |
88 | kfree(UNC); | 88 | kfree(UNC); |
89 | return NULL; | 89 | return NULL; |
90 | } | 90 | } |
@@ -127,7 +127,7 @@ static char *compose_mount_options(const char *sb_mountdata, | |||
127 | rc = dns_resolve_server_name_to_ip(*devname, &srvIP); | 127 | rc = dns_resolve_server_name_to_ip(*devname, &srvIP); |
128 | if (rc != 0) { | 128 | if (rc != 0) { |
129 | cERROR(1, ("%s: Failed to resolve server part of %s to IP", | 129 | cERROR(1, ("%s: Failed to resolve server part of %s to IP", |
130 | __FUNCTION__, *devname)); | 130 | __func__, *devname)); |
131 | mountdata = ERR_PTR(rc); | 131 | mountdata = ERR_PTR(rc); |
132 | goto compose_mount_options_out; | 132 | goto compose_mount_options_out; |
133 | } | 133 | } |
@@ -181,8 +181,8 @@ static char *compose_mount_options(const char *sb_mountdata, | |||
181 | } | 181 | } |
182 | } | 182 | } |
183 | 183 | ||
184 | /*cFYI(1,("%s: parent mountdata: %s", __FUNCTION__,sb_mountdata));*/ | 184 | /*cFYI(1,("%s: parent mountdata: %s", __func__,sb_mountdata));*/ |
185 | /*cFYI(1, ("%s: submount mountdata: %s", __FUNCTION__, mountdata ));*/ | 185 | /*cFYI(1, ("%s: submount mountdata: %s", __func__, mountdata ));*/ |
186 | 186 | ||
187 | compose_mount_options_out: | 187 | compose_mount_options_out: |
188 | kfree(srvIP); | 188 | kfree(srvIP); |
@@ -302,7 +302,7 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd) | |||
302 | int rc = 0; | 302 | int rc = 0; |
303 | struct vfsmount *mnt = ERR_PTR(-ENOENT); | 303 | struct vfsmount *mnt = ERR_PTR(-ENOENT); |
304 | 304 | ||
305 | cFYI(1, ("in %s", __FUNCTION__)); | 305 | cFYI(1, ("in %s", __func__)); |
306 | BUG_ON(IS_ROOT(dentry)); | 306 | BUG_ON(IS_ROOT(dentry)); |
307 | 307 | ||
308 | xid = GetXid(); | 308 | xid = GetXid(); |
@@ -336,7 +336,7 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd) | |||
336 | len = strlen(referrals[i].node_name); | 336 | len = strlen(referrals[i].node_name); |
337 | if (len < 2) { | 337 | if (len < 2) { |
338 | cERROR(1, ("%s: Net Address path too short: %s", | 338 | cERROR(1, ("%s: Net Address path too short: %s", |
339 | __FUNCTION__, referrals[i].node_name)); | 339 | __func__, referrals[i].node_name)); |
340 | rc = -EINVAL; | 340 | rc = -EINVAL; |
341 | goto out_err; | 341 | goto out_err; |
342 | } | 342 | } |
@@ -344,7 +344,7 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd) | |||
344 | nd->path.dentry, | 344 | nd->path.dentry, |
345 | referrals[i].node_name); | 345 | referrals[i].node_name); |
346 | cFYI(1, ("%s: cifs_dfs_do_refmount:%s , mnt:%p", | 346 | cFYI(1, ("%s: cifs_dfs_do_refmount:%s , mnt:%p", |
347 | __FUNCTION__, | 347 | __func__, |
348 | referrals[i].node_name, mnt)); | 348 | referrals[i].node_name, mnt)); |
349 | 349 | ||
350 | /* complete mount procedure if we accured submount */ | 350 | /* complete mount procedure if we accured submount */ |
@@ -365,7 +365,7 @@ out: | |||
365 | FreeXid(xid); | 365 | FreeXid(xid); |
366 | free_dfs_info_array(referrals, num_referrals); | 366 | free_dfs_info_array(referrals, num_referrals); |
367 | kfree(full_path); | 367 | kfree(full_path); |
368 | cFYI(1, ("leaving %s" , __FUNCTION__)); | 368 | cFYI(1, ("leaving %s" , __func__)); |
369 | return ERR_PTR(rc); | 369 | return ERR_PTR(rc); |
370 | out_err: | 370 | out_err: |
371 | path_put(&nd->path); | 371 | path_put(&nd->path); |
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c index f93932c21772..1f5a4289b848 100644 --- a/fs/cifs/cifsacl.c +++ b/fs/cifs/cifsacl.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * fs/cifs/cifsacl.c | 2 | * fs/cifs/cifsacl.c |
3 | * | 3 | * |
4 | * Copyright (C) International Business Machines Corp., 2007 | 4 | * Copyright (C) International Business Machines Corp., 2007,2008 |
5 | * Author(s): Steve French (sfrench@us.ibm.com) | 5 | * Author(s): Steve French (sfrench@us.ibm.com) |
6 | * | 6 | * |
7 | * Contains the routines for mapping CIFS/NTFS ACLs | 7 | * Contains the routines for mapping CIFS/NTFS ACLs |
@@ -556,9 +556,9 @@ static int build_sec_desc(struct cifs_ntsd *pntsd, struct cifs_ntsd *pnntsd, | |||
556 | 556 | ||
557 | /* Retrieve an ACL from the server */ | 557 | /* Retrieve an ACL from the server */ |
558 | static struct cifs_ntsd *get_cifs_acl(u32 *pacllen, struct inode *inode, | 558 | static struct cifs_ntsd *get_cifs_acl(u32 *pacllen, struct inode *inode, |
559 | const char *path) | 559 | const char *path, const __u16 *pfid) |
560 | { | 560 | { |
561 | struct cifsFileInfo *open_file; | 561 | struct cifsFileInfo *open_file = NULL; |
562 | int unlock_file = FALSE; | 562 | int unlock_file = FALSE; |
563 | int xid; | 563 | int xid; |
564 | int rc = -EIO; | 564 | int rc = -EIO; |
@@ -573,7 +573,11 @@ static struct cifs_ntsd *get_cifs_acl(u32 *pacllen, struct inode *inode, | |||
573 | return NULL; | 573 | return NULL; |
574 | 574 | ||
575 | xid = GetXid(); | 575 | xid = GetXid(); |
576 | open_file = find_readable_file(CIFS_I(inode)); | 576 | if (pfid == NULL) |
577 | open_file = find_readable_file(CIFS_I(inode)); | ||
578 | else | ||
579 | fid = *pfid; | ||
580 | |||
577 | sb = inode->i_sb; | 581 | sb = inode->i_sb; |
578 | if (sb == NULL) { | 582 | if (sb == NULL) { |
579 | FreeXid(xid); | 583 | FreeXid(xid); |
@@ -584,7 +588,7 @@ static struct cifs_ntsd *get_cifs_acl(u32 *pacllen, struct inode *inode, | |||
584 | if (open_file) { | 588 | if (open_file) { |
585 | unlock_file = TRUE; | 589 | unlock_file = TRUE; |
586 | fid = open_file->netfid; | 590 | fid = open_file->netfid; |
587 | } else { | 591 | } else if (pfid == NULL) { |
588 | int oplock = FALSE; | 592 | int oplock = FALSE; |
589 | /* open file */ | 593 | /* open file */ |
590 | rc = CIFSSMBOpen(xid, cifs_sb->tcon, path, FILE_OPEN, | 594 | rc = CIFSSMBOpen(xid, cifs_sb->tcon, path, FILE_OPEN, |
@@ -600,10 +604,11 @@ static struct cifs_ntsd *get_cifs_acl(u32 *pacllen, struct inode *inode, | |||
600 | 604 | ||
601 | rc = CIFSSMBGetCIFSACL(xid, cifs_sb->tcon, fid, &pntsd, pacllen); | 605 | rc = CIFSSMBGetCIFSACL(xid, cifs_sb->tcon, fid, &pntsd, pacllen); |
602 | cFYI(1, ("GetCIFSACL rc = %d ACL len %d", rc, *pacllen)); | 606 | cFYI(1, ("GetCIFSACL rc = %d ACL len %d", rc, *pacllen)); |
603 | if (unlock_file == TRUE) | 607 | if (unlock_file == TRUE) /* find_readable_file increments ref count */ |
604 | atomic_dec(&open_file->wrtPending); | 608 | atomic_dec(&open_file->wrtPending); |
605 | else | 609 | else if (pfid == NULL) /* if opened above we have to close the handle */ |
606 | CIFSSMBClose(xid, cifs_sb->tcon, fid); | 610 | CIFSSMBClose(xid, cifs_sb->tcon, fid); |
611 | /* else handle was passed in by caller */ | ||
607 | 612 | ||
608 | FreeXid(xid); | 613 | FreeXid(xid); |
609 | return pntsd; | 614 | return pntsd; |
@@ -664,14 +669,14 @@ static int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen, | |||
664 | } | 669 | } |
665 | 670 | ||
666 | /* Translate the CIFS ACL (simlar to NTFS ACL) for a file into mode bits */ | 671 | /* Translate the CIFS ACL (simlar to NTFS ACL) for a file into mode bits */ |
667 | void acl_to_uid_mode(struct inode *inode, const char *path) | 672 | void acl_to_uid_mode(struct inode *inode, const char *path, const __u16 *pfid) |
668 | { | 673 | { |
669 | struct cifs_ntsd *pntsd = NULL; | 674 | struct cifs_ntsd *pntsd = NULL; |
670 | u32 acllen = 0; | 675 | u32 acllen = 0; |
671 | int rc = 0; | 676 | int rc = 0; |
672 | 677 | ||
673 | cFYI(DBG2, ("converting ACL to mode for %s", path)); | 678 | cFYI(DBG2, ("converting ACL to mode for %s", path)); |
674 | pntsd = get_cifs_acl(&acllen, inode, path); | 679 | pntsd = get_cifs_acl(&acllen, inode, path, pfid); |
675 | 680 | ||
676 | /* if we can retrieve the ACL, now parse Access Control Entries, ACEs */ | 681 | /* if we can retrieve the ACL, now parse Access Control Entries, ACEs */ |
677 | if (pntsd) | 682 | if (pntsd) |
@@ -694,7 +699,7 @@ int mode_to_acl(struct inode *inode, const char *path, __u64 nmode) | |||
694 | cFYI(DBG2, ("set ACL from mode for %s", path)); | 699 | cFYI(DBG2, ("set ACL from mode for %s", path)); |
695 | 700 | ||
696 | /* Get the security descriptor */ | 701 | /* Get the security descriptor */ |
697 | pntsd = get_cifs_acl(&acllen, inode, path); | 702 | pntsd = get_cifs_acl(&acllen, inode, path, NULL); |
698 | 703 | ||
699 | /* Add three ACEs for owner, group, everyone getting rid of | 704 | /* Add three ACEs for owner, group, everyone getting rid of |
700 | other ACEs as chmod disables ACEs and set the security descriptor */ | 705 | other ACEs as chmod disables ACEs and set the security descriptor */ |
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index 0af63e6b426b..7e5e0e78cd72 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h | |||
@@ -39,8 +39,8 @@ extern int smb_send(struct socket *, struct smb_hdr *, | |||
39 | unsigned int /* length */ , struct sockaddr *); | 39 | unsigned int /* length */ , struct sockaddr *); |
40 | extern unsigned int _GetXid(void); | 40 | extern unsigned int _GetXid(void); |
41 | extern void _FreeXid(unsigned int); | 41 | extern void _FreeXid(unsigned int); |
42 | #define GetXid() (int)_GetXid(); cFYI(1,("CIFS VFS: in %s as Xid: %d with uid: %d",__FUNCTION__, xid,current->fsuid)); | 42 | #define GetXid() (int)_GetXid(); cFYI(1,("CIFS VFS: in %s as Xid: %d with uid: %d",__func__, xid,current->fsuid)); |
43 | #define FreeXid(curr_xid) {_FreeXid(curr_xid); cFYI(1,("CIFS VFS: leaving %s (xid = %d) rc = %d",__FUNCTION__,curr_xid,(int)rc));} | 43 | #define FreeXid(curr_xid) {_FreeXid(curr_xid); cFYI(1,("CIFS VFS: leaving %s (xid = %d) rc = %d",__func__,curr_xid,(int)rc));} |
44 | extern char *build_path_from_dentry(struct dentry *); | 44 | extern char *build_path_from_dentry(struct dentry *); |
45 | extern char *build_wildcard_path_from_dentry(struct dentry *direntry); | 45 | extern char *build_wildcard_path_from_dentry(struct dentry *direntry); |
46 | /* extern void renew_parental_timestamps(struct dentry *direntry);*/ | 46 | /* extern void renew_parental_timestamps(struct dentry *direntry);*/ |
@@ -92,11 +92,12 @@ extern struct timespec cnvrtDosUnixTm(__u16 date, __u16 time); | |||
92 | extern int cifs_get_inode_info(struct inode **pinode, | 92 | extern int cifs_get_inode_info(struct inode **pinode, |
93 | const unsigned char *search_path, | 93 | const unsigned char *search_path, |
94 | FILE_ALL_INFO * pfile_info, | 94 | FILE_ALL_INFO * pfile_info, |
95 | struct super_block *sb, int xid); | 95 | struct super_block *sb, int xid, const __u16 *pfid); |
96 | extern int cifs_get_inode_info_unix(struct inode **pinode, | 96 | extern int cifs_get_inode_info_unix(struct inode **pinode, |
97 | const unsigned char *search_path, | 97 | const unsigned char *search_path, |
98 | struct super_block *sb, int xid); | 98 | struct super_block *sb, int xid); |
99 | extern void acl_to_uid_mode(struct inode *inode, const char *search_path); | 99 | extern void acl_to_uid_mode(struct inode *inode, const char *path, |
100 | const __u16 *pfid); | ||
100 | extern int mode_to_acl(struct inode *inode, const char *path, __u64); | 101 | extern int mode_to_acl(struct inode *inode, const char *path, __u64); |
101 | 102 | ||
102 | extern int cifs_mount(struct super_block *, struct cifs_sb_info *, char *, | 103 | extern int cifs_mount(struct super_block *, struct cifs_sb_info *, char *, |
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 4e83b47c4b34..0f5c62ba4038 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -229,7 +229,8 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, | |||
229 | inode->i_sb, xid); | 229 | inode->i_sb, xid); |
230 | else { | 230 | else { |
231 | rc = cifs_get_inode_info(&newinode, full_path, | 231 | rc = cifs_get_inode_info(&newinode, full_path, |
232 | buf, inode->i_sb, xid); | 232 | buf, inode->i_sb, xid, |
233 | &fileHandle); | ||
233 | if (newinode) { | 234 | if (newinode) { |
234 | newinode->i_mode = mode; | 235 | newinode->i_mode = mode; |
235 | if ((oplock & CIFS_CREATE_ACTION) && | 236 | if ((oplock & CIFS_CREATE_ACTION) && |
@@ -483,7 +484,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, | |||
483 | parent_dir_inode->i_sb, xid); | 484 | parent_dir_inode->i_sb, xid); |
484 | else | 485 | else |
485 | rc = cifs_get_inode_info(&newInode, full_path, NULL, | 486 | rc = cifs_get_inode_info(&newInode, full_path, NULL, |
486 | parent_dir_inode->i_sb, xid); | 487 | parent_dir_inode->i_sb, xid, NULL); |
487 | 488 | ||
488 | if ((rc == 0) && (newInode != NULL)) { | 489 | if ((rc == 0) && (newInode != NULL)) { |
489 | if (pTcon->nocase) | 490 | if (pTcon->nocase) |
diff --git a/fs/cifs/dns_resolve.c b/fs/cifs/dns_resolve.c index ef7f43824347..7cc86c418182 100644 --- a/fs/cifs/dns_resolve.c +++ b/fs/cifs/dns_resolve.c | |||
@@ -77,14 +77,14 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr) | |||
77 | /* search for server name delimiter */ | 77 | /* search for server name delimiter */ |
78 | len = strlen(unc); | 78 | len = strlen(unc); |
79 | if (len < 3) { | 79 | if (len < 3) { |
80 | cFYI(1, ("%s: unc is too short: %s", __FUNCTION__, unc)); | 80 | cFYI(1, ("%s: unc is too short: %s", __func__, unc)); |
81 | return -EINVAL; | 81 | return -EINVAL; |
82 | } | 82 | } |
83 | len -= 2; | 83 | len -= 2; |
84 | name = memchr(unc+2, '\\', len); | 84 | name = memchr(unc+2, '\\', len); |
85 | if (!name) { | 85 | if (!name) { |
86 | cFYI(1, ("%s: probably server name is whole unc: %s", | 86 | cFYI(1, ("%s: probably server name is whole unc: %s", |
87 | __FUNCTION__, unc)); | 87 | __func__, unc)); |
88 | } else { | 88 | } else { |
89 | len = (name - unc) - 2/* leading // */; | 89 | len = (name - unc) - 2/* leading // */; |
90 | } | 90 | } |
@@ -104,7 +104,7 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr) | |||
104 | if (*ip_addr) { | 104 | if (*ip_addr) { |
105 | memcpy(*ip_addr, rkey->payload.data, len); | 105 | memcpy(*ip_addr, rkey->payload.data, len); |
106 | (*ip_addr)[len] = '\0'; | 106 | (*ip_addr)[len] = '\0'; |
107 | cFYI(1, ("%s: resolved: %s to %s", __FUNCTION__, | 107 | cFYI(1, ("%s: resolved: %s to %s", __func__, |
108 | rkey->description, | 108 | rkey->description, |
109 | *ip_addr | 109 | *ip_addr |
110 | )); | 110 | )); |
@@ -114,7 +114,7 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr) | |||
114 | } | 114 | } |
115 | key_put(rkey); | 115 | key_put(rkey); |
116 | } else { | 116 | } else { |
117 | cERROR(1, ("%s: unable to resolve: %s", __FUNCTION__, name)); | 117 | cERROR(1, ("%s: unable to resolve: %s", __func__, name)); |
118 | } | 118 | } |
119 | 119 | ||
120 | kfree(name); | 120 | kfree(name); |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index fa849c91d323..40b690073fc1 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -145,7 +145,7 @@ client_can_cache: | |||
145 | full_path, inode->i_sb, xid); | 145 | full_path, inode->i_sb, xid); |
146 | else | 146 | else |
147 | rc = cifs_get_inode_info(&file->f_path.dentry->d_inode, | 147 | rc = cifs_get_inode_info(&file->f_path.dentry->d_inode, |
148 | full_path, buf, inode->i_sb, xid); | 148 | full_path, buf, inode->i_sb, xid, NULL); |
149 | 149 | ||
150 | if ((*oplock & 0xF) == OPLOCK_EXCLUSIVE) { | 150 | if ((*oplock & 0xF) == OPLOCK_EXCLUSIVE) { |
151 | pCifsInode->clientCanCacheAll = TRUE; | 151 | pCifsInode->clientCanCacheAll = TRUE; |
@@ -440,7 +440,7 @@ reopen_error_exit: | |||
440 | else | 440 | else |
441 | rc = cifs_get_inode_info(&inode, | 441 | rc = cifs_get_inode_info(&inode, |
442 | full_path, NULL, inode->i_sb, | 442 | full_path, NULL, inode->i_sb, |
443 | xid); | 443 | xid, NULL); |
444 | } /* else we are writing out data to server already | 444 | } /* else we are writing out data to server already |
445 | and could deadlock if we tried to flush data, and | 445 | and could deadlock if we tried to flush data, and |
446 | since we do not know if we have data that would | 446 | since we do not know if we have data that would |
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 24eb4d392155..bc673c8c1e6b 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include "cifs_fs_sb.h" | 30 | #include "cifs_fs_sb.h" |
31 | 31 | ||
32 | 32 | ||
33 | static void cifs_set_ops(struct inode *inode) | 33 | static void cifs_set_ops(struct inode *inode, const bool is_dfs_referral) |
34 | { | 34 | { |
35 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | 35 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); |
36 | 36 | ||
@@ -57,8 +57,16 @@ static void cifs_set_ops(struct inode *inode) | |||
57 | inode->i_data.a_ops = &cifs_addr_ops; | 57 | inode->i_data.a_ops = &cifs_addr_ops; |
58 | break; | 58 | break; |
59 | case S_IFDIR: | 59 | case S_IFDIR: |
60 | inode->i_op = &cifs_dir_inode_ops; | 60 | #ifdef CONFIG_CIFS_DFS_UPCALL |
61 | inode->i_fop = &cifs_dir_ops; | 61 | if (is_dfs_referral) { |
62 | inode->i_op = &cifs_dfs_referral_inode_operations; | ||
63 | } else { | ||
64 | #else /* NO DFS support, treat as a directory */ | ||
65 | { | ||
66 | #endif | ||
67 | inode->i_op = &cifs_dir_inode_ops; | ||
68 | inode->i_fop = &cifs_dir_ops; | ||
69 | } | ||
62 | break; | 70 | break; |
63 | case S_IFLNK: | 71 | case S_IFLNK: |
64 | inode->i_op = &cifs_symlink_inode_ops; | 72 | inode->i_op = &cifs_symlink_inode_ops; |
@@ -153,6 +161,30 @@ static void cifs_unix_info_to_inode(struct inode *inode, | |||
153 | spin_unlock(&inode->i_lock); | 161 | spin_unlock(&inode->i_lock); |
154 | } | 162 | } |
155 | 163 | ||
164 | static const unsigned char *cifs_get_search_path(struct cifsTconInfo *pTcon, | ||
165 | const char *search_path) | ||
166 | { | ||
167 | int tree_len; | ||
168 | int path_len; | ||
169 | char *tmp_path; | ||
170 | |||
171 | if (!(pTcon->Flags & SMB_SHARE_IS_IN_DFS)) | ||
172 | return search_path; | ||
173 | |||
174 | /* use full path name for working with DFS */ | ||
175 | tree_len = strnlen(pTcon->treeName, MAX_TREE_SIZE + 1); | ||
176 | path_len = strnlen(search_path, MAX_PATHCONF); | ||
177 | |||
178 | tmp_path = kmalloc(tree_len+path_len+1, GFP_KERNEL); | ||
179 | if (tmp_path == NULL) | ||
180 | return search_path; | ||
181 | |||
182 | strncpy(tmp_path, pTcon->treeName, tree_len); | ||
183 | strncpy(tmp_path+tree_len, search_path, path_len); | ||
184 | tmp_path[tree_len+path_len] = 0; | ||
185 | return tmp_path; | ||
186 | } | ||
187 | |||
156 | int cifs_get_inode_info_unix(struct inode **pinode, | 188 | int cifs_get_inode_info_unix(struct inode **pinode, |
157 | const unsigned char *search_path, struct super_block *sb, int xid) | 189 | const unsigned char *search_path, struct super_block *sb, int xid) |
158 | { | 190 | { |
@@ -161,41 +193,31 @@ int cifs_get_inode_info_unix(struct inode **pinode, | |||
161 | struct cifsTconInfo *pTcon; | 193 | struct cifsTconInfo *pTcon; |
162 | struct inode *inode; | 194 | struct inode *inode; |
163 | struct cifs_sb_info *cifs_sb = CIFS_SB(sb); | 195 | struct cifs_sb_info *cifs_sb = CIFS_SB(sb); |
164 | char *tmp_path; | 196 | const unsigned char *full_path; |
197 | bool is_dfs_referral = false; | ||
165 | 198 | ||
166 | pTcon = cifs_sb->tcon; | 199 | pTcon = cifs_sb->tcon; |
167 | cFYI(1, ("Getting info on %s", search_path)); | 200 | cFYI(1, ("Getting info on %s", search_path)); |
201 | |||
202 | full_path = cifs_get_search_path(pTcon, search_path); | ||
203 | |||
204 | try_again_CIFSSMBUnixQPathInfo: | ||
168 | /* could have done a find first instead but this returns more info */ | 205 | /* could have done a find first instead but this returns more info */ |
169 | rc = CIFSSMBUnixQPathInfo(xid, pTcon, search_path, &findData, | 206 | rc = CIFSSMBUnixQPathInfo(xid, pTcon, full_path, &findData, |
170 | cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & | 207 | cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & |
171 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 208 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
172 | /* dump_mem("\nUnixQPathInfo return data", &findData, | 209 | /* dump_mem("\nUnixQPathInfo return data", &findData, |
173 | sizeof(findData)); */ | 210 | sizeof(findData)); */ |
174 | if (rc) { | 211 | if (rc) { |
175 | if (rc == -EREMOTE) { | 212 | if (rc == -EREMOTE && !is_dfs_referral) { |
176 | tmp_path = | 213 | is_dfs_referral = true; |
177 | kmalloc(strnlen(pTcon->treeName, | 214 | if (full_path != search_path) { |
178 | MAX_TREE_SIZE + 1) + | 215 | kfree(full_path); |
179 | strnlen(search_path, MAX_PATHCONF) + 1, | 216 | full_path = search_path; |
180 | GFP_KERNEL); | 217 | } |
181 | if (tmp_path == NULL) | 218 | goto try_again_CIFSSMBUnixQPathInfo; |
182 | return -ENOMEM; | ||
183 | |||
184 | /* have to skip first of the double backslash of | ||
185 | UNC name */ | ||
186 | strncpy(tmp_path, pTcon->treeName, MAX_TREE_SIZE); | ||
187 | strncat(tmp_path, search_path, MAX_PATHCONF); | ||
188 | rc = connect_to_dfs_path(xid, pTcon->ses, | ||
189 | /* treename + */ tmp_path, | ||
190 | cifs_sb->local_nls, | ||
191 | cifs_sb->mnt_cifs_flags & | ||
192 | CIFS_MOUNT_MAP_SPECIAL_CHR); | ||
193 | kfree(tmp_path); | ||
194 | |||
195 | /* BB fix up inode etc. */ | ||
196 | } else if (rc) { | ||
197 | return rc; | ||
198 | } | 219 | } |
220 | goto cgiiu_exit; | ||
199 | } else { | 221 | } else { |
200 | struct cifsInodeInfo *cifsInfo; | 222 | struct cifsInodeInfo *cifsInfo; |
201 | __u64 num_of_bytes = le64_to_cpu(findData.NumOfBytes); | 223 | __u64 num_of_bytes = le64_to_cpu(findData.NumOfBytes); |
@@ -204,8 +226,10 @@ int cifs_get_inode_info_unix(struct inode **pinode, | |||
204 | /* get new inode */ | 226 | /* get new inode */ |
205 | if (*pinode == NULL) { | 227 | if (*pinode == NULL) { |
206 | *pinode = new_inode(sb); | 228 | *pinode = new_inode(sb); |
207 | if (*pinode == NULL) | 229 | if (*pinode == NULL) { |
208 | return -ENOMEM; | 230 | rc = -ENOMEM; |
231 | goto cgiiu_exit; | ||
232 | } | ||
209 | /* Is an i_ino of zero legal? */ | 233 | /* Is an i_ino of zero legal? */ |
210 | /* Are there sanity checks we can use to ensure that | 234 | /* Are there sanity checks we can use to ensure that |
211 | the server is really filling in that field? */ | 235 | the server is really filling in that field? */ |
@@ -237,8 +261,11 @@ int cifs_get_inode_info_unix(struct inode **pinode, | |||
237 | (unsigned long) inode->i_size, | 261 | (unsigned long) inode->i_size, |
238 | (unsigned long long)inode->i_blocks)); | 262 | (unsigned long long)inode->i_blocks)); |
239 | 263 | ||
240 | cifs_set_ops(inode); | 264 | cifs_set_ops(inode, is_dfs_referral); |
241 | } | 265 | } |
266 | cgiiu_exit: | ||
267 | if (full_path != search_path) | ||
268 | kfree(full_path); | ||
242 | return rc; | 269 | return rc; |
243 | } | 270 | } |
244 | 271 | ||
@@ -347,15 +374,16 @@ static int get_sfu_mode(struct inode *inode, | |||
347 | 374 | ||
348 | int cifs_get_inode_info(struct inode **pinode, | 375 | int cifs_get_inode_info(struct inode **pinode, |
349 | const unsigned char *search_path, FILE_ALL_INFO *pfindData, | 376 | const unsigned char *search_path, FILE_ALL_INFO *pfindData, |
350 | struct super_block *sb, int xid) | 377 | struct super_block *sb, int xid, const __u16 *pfid) |
351 | { | 378 | { |
352 | int rc = 0; | 379 | int rc = 0; |
353 | struct cifsTconInfo *pTcon; | 380 | struct cifsTconInfo *pTcon; |
354 | struct inode *inode; | 381 | struct inode *inode; |
355 | struct cifs_sb_info *cifs_sb = CIFS_SB(sb); | 382 | struct cifs_sb_info *cifs_sb = CIFS_SB(sb); |
356 | char *tmp_path; | 383 | const unsigned char *full_path = NULL; |
357 | char *buf = NULL; | 384 | char *buf = NULL; |
358 | int adjustTZ = FALSE; | 385 | int adjustTZ = FALSE; |
386 | bool is_dfs_referral = false; | ||
359 | 387 | ||
360 | pTcon = cifs_sb->tcon; | 388 | pTcon = cifs_sb->tcon; |
361 | cFYI(1, ("Getting info on %s", search_path)); | 389 | cFYI(1, ("Getting info on %s", search_path)); |
@@ -373,8 +401,12 @@ int cifs_get_inode_info(struct inode **pinode, | |||
373 | if (buf == NULL) | 401 | if (buf == NULL) |
374 | return -ENOMEM; | 402 | return -ENOMEM; |
375 | pfindData = (FILE_ALL_INFO *)buf; | 403 | pfindData = (FILE_ALL_INFO *)buf; |
404 | |||
405 | full_path = cifs_get_search_path(pTcon, search_path); | ||
406 | |||
407 | try_again_CIFSSMBQPathInfo: | ||
376 | /* could do find first instead but this returns more info */ | 408 | /* could do find first instead but this returns more info */ |
377 | rc = CIFSSMBQPathInfo(xid, pTcon, search_path, pfindData, | 409 | rc = CIFSSMBQPathInfo(xid, pTcon, full_path, pfindData, |
378 | 0 /* not legacy */, | 410 | 0 /* not legacy */, |
379 | cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & | 411 | cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & |
380 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 412 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
@@ -382,7 +414,7 @@ int cifs_get_inode_info(struct inode **pinode, | |||
382 | when server claims no NT SMB support and the above call | 414 | when server claims no NT SMB support and the above call |
383 | failed at least once - set flag in tcon or mount */ | 415 | failed at least once - set flag in tcon or mount */ |
384 | if ((rc == -EOPNOTSUPP) || (rc == -EINVAL)) { | 416 | if ((rc == -EOPNOTSUPP) || (rc == -EINVAL)) { |
385 | rc = SMBQueryInformation(xid, pTcon, search_path, | 417 | rc = SMBQueryInformation(xid, pTcon, full_path, |
386 | pfindData, cifs_sb->local_nls, | 418 | pfindData, cifs_sb->local_nls, |
387 | cifs_sb->mnt_cifs_flags & | 419 | cifs_sb->mnt_cifs_flags & |
388 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 420 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
@@ -391,31 +423,15 @@ int cifs_get_inode_info(struct inode **pinode, | |||
391 | } | 423 | } |
392 | /* dump_mem("\nQPathInfo return data",&findData, sizeof(findData)); */ | 424 | /* dump_mem("\nQPathInfo return data",&findData, sizeof(findData)); */ |
393 | if (rc) { | 425 | if (rc) { |
394 | if (rc == -EREMOTE) { | 426 | if (rc == -EREMOTE && !is_dfs_referral) { |
395 | tmp_path = | 427 | is_dfs_referral = true; |
396 | kmalloc(strnlen | 428 | if (full_path != search_path) { |
397 | (pTcon->treeName, | 429 | kfree(full_path); |
398 | MAX_TREE_SIZE + 1) + | 430 | full_path = search_path; |
399 | strnlen(search_path, MAX_PATHCONF) + 1, | ||
400 | GFP_KERNEL); | ||
401 | if (tmp_path == NULL) { | ||
402 | kfree(buf); | ||
403 | return -ENOMEM; | ||
404 | } | 431 | } |
405 | 432 | goto try_again_CIFSSMBQPathInfo; | |
406 | strncpy(tmp_path, pTcon->treeName, MAX_TREE_SIZE); | ||
407 | strncat(tmp_path, search_path, MAX_PATHCONF); | ||
408 | rc = connect_to_dfs_path(xid, pTcon->ses, | ||
409 | /* treename + */ tmp_path, | ||
410 | cifs_sb->local_nls, | ||
411 | cifs_sb->mnt_cifs_flags & | ||
412 | CIFS_MOUNT_MAP_SPECIAL_CHR); | ||
413 | kfree(tmp_path); | ||
414 | /* BB fix up inode etc. */ | ||
415 | } else if (rc) { | ||
416 | kfree(buf); | ||
417 | return rc; | ||
418 | } | 433 | } |
434 | goto cgii_exit; | ||
419 | } else { | 435 | } else { |
420 | struct cifsInodeInfo *cifsInfo; | 436 | struct cifsInodeInfo *cifsInfo; |
421 | __u32 attr = le32_to_cpu(pfindData->Attributes); | 437 | __u32 attr = le32_to_cpu(pfindData->Attributes); |
@@ -424,8 +440,8 @@ int cifs_get_inode_info(struct inode **pinode, | |||
424 | if (*pinode == NULL) { | 440 | if (*pinode == NULL) { |
425 | *pinode = new_inode(sb); | 441 | *pinode = new_inode(sb); |
426 | if (*pinode == NULL) { | 442 | if (*pinode == NULL) { |
427 | kfree(buf); | 443 | rc = -ENOMEM; |
428 | return -ENOMEM; | 444 | goto cgii_exit; |
429 | } | 445 | } |
430 | /* Is an i_ino of zero legal? Can we use that to check | 446 | /* Is an i_ino of zero legal? Can we use that to check |
431 | if the server supports returning inode numbers? Are | 447 | if the server supports returning inode numbers? Are |
@@ -559,7 +575,7 @@ int cifs_get_inode_info(struct inode **pinode, | |||
559 | /* fill in 0777 bits from ACL */ | 575 | /* fill in 0777 bits from ACL */ |
560 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { | 576 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { |
561 | cFYI(1, ("Getting mode bits from ACL")); | 577 | cFYI(1, ("Getting mode bits from ACL")); |
562 | acl_to_uid_mode(inode, search_path); | 578 | acl_to_uid_mode(inode, search_path, pfid); |
563 | } | 579 | } |
564 | #endif | 580 | #endif |
565 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) { | 581 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) { |
@@ -573,8 +589,11 @@ int cifs_get_inode_info(struct inode **pinode, | |||
573 | atomic_set(&cifsInfo->inUse, 1); | 589 | atomic_set(&cifsInfo->inUse, 1); |
574 | } | 590 | } |
575 | 591 | ||
576 | cifs_set_ops(inode); | 592 | cifs_set_ops(inode, is_dfs_referral); |
577 | } | 593 | } |
594 | cgii_exit: | ||
595 | if (full_path != search_path) | ||
596 | kfree(full_path); | ||
578 | kfree(buf); | 597 | kfree(buf); |
579 | return rc; | 598 | return rc; |
580 | } | 599 | } |
@@ -603,7 +622,8 @@ struct inode *cifs_iget(struct super_block *sb, unsigned long ino) | |||
603 | if (cifs_sb->tcon->unix_ext) | 622 | if (cifs_sb->tcon->unix_ext) |
604 | rc = cifs_get_inode_info_unix(&inode, "", inode->i_sb, xid); | 623 | rc = cifs_get_inode_info_unix(&inode, "", inode->i_sb, xid); |
605 | else | 624 | else |
606 | rc = cifs_get_inode_info(&inode, "", NULL, inode->i_sb, xid); | 625 | rc = cifs_get_inode_info(&inode, "", NULL, inode->i_sb, xid, |
626 | NULL); | ||
607 | if (rc && cifs_sb->tcon->ipc) { | 627 | if (rc && cifs_sb->tcon->ipc) { |
608 | cFYI(1, ("ipc connection - fake read inode")); | 628 | cFYI(1, ("ipc connection - fake read inode")); |
609 | inode->i_mode |= S_IFDIR; | 629 | inode->i_mode |= S_IFDIR; |
@@ -804,7 +824,7 @@ static void posix_fill_in_inode(struct inode *tmp_inode, | |||
804 | local_size = tmp_inode->i_size; | 824 | local_size = tmp_inode->i_size; |
805 | 825 | ||
806 | cifs_unix_info_to_inode(tmp_inode, pData, 1); | 826 | cifs_unix_info_to_inode(tmp_inode, pData, 1); |
807 | cifs_set_ops(tmp_inode); | 827 | cifs_set_ops(tmp_inode, false); |
808 | 828 | ||
809 | if (!S_ISREG(tmp_inode->i_mode)) | 829 | if (!S_ISREG(tmp_inode->i_mode)) |
810 | return; | 830 | return; |
@@ -936,7 +956,7 @@ mkdir_get_info: | |||
936 | inode->i_sb, xid); | 956 | inode->i_sb, xid); |
937 | else | 957 | else |
938 | rc = cifs_get_inode_info(&newinode, full_path, NULL, | 958 | rc = cifs_get_inode_info(&newinode, full_path, NULL, |
939 | inode->i_sb, xid); | 959 | inode->i_sb, xid, NULL); |
940 | 960 | ||
941 | if (pTcon->nocase) | 961 | if (pTcon->nocase) |
942 | direntry->d_op = &cifs_ci_dentry_ops; | 962 | direntry->d_op = &cifs_ci_dentry_ops; |
@@ -1218,7 +1238,7 @@ int cifs_revalidate(struct dentry *direntry) | |||
1218 | } | 1238 | } |
1219 | } else { | 1239 | } else { |
1220 | rc = cifs_get_inode_info(&direntry->d_inode, full_path, NULL, | 1240 | rc = cifs_get_inode_info(&direntry->d_inode, full_path, NULL, |
1221 | direntry->d_sb, xid); | 1241 | direntry->d_sb, xid, NULL); |
1222 | if (rc) { | 1242 | if (rc) { |
1223 | cFYI(1, ("error on getting revalidate info %d", rc)); | 1243 | cFYI(1, ("error on getting revalidate info %d", rc)); |
1224 | /* if (rc != -ENOENT) | 1244 | /* if (rc != -ENOENT) |
@@ -1407,11 +1427,10 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) | |||
1407 | } | 1427 | } |
1408 | cifsInode = CIFS_I(direntry->d_inode); | 1428 | cifsInode = CIFS_I(direntry->d_inode); |
1409 | 1429 | ||
1410 | /* BB check if we need to refresh inode from server now ? BB */ | 1430 | if ((attrs->ia_valid & ATTR_MTIME) || (attrs->ia_valid & ATTR_SIZE)) { |
1411 | |||
1412 | if (attrs->ia_valid & ATTR_SIZE) { | ||
1413 | /* | 1431 | /* |
1414 | Flush data before changing file size on server. If the | 1432 | Flush data before changing file size or changing the last |
1433 | write time of the file on the server. If the | ||
1415 | flush returns error, store it to report later and continue. | 1434 | flush returns error, store it to report later and continue. |
1416 | BB: This should be smarter. Why bother flushing pages that | 1435 | BB: This should be smarter. Why bother flushing pages that |
1417 | will be truncated anyway? Also, should we error out here if | 1436 | will be truncated anyway? Also, should we error out here if |
@@ -1422,7 +1441,9 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) | |||
1422 | CIFS_I(direntry->d_inode)->write_behind_rc = rc; | 1441 | CIFS_I(direntry->d_inode)->write_behind_rc = rc; |
1423 | rc = 0; | 1442 | rc = 0; |
1424 | } | 1443 | } |
1444 | } | ||
1425 | 1445 | ||
1446 | if (attrs->ia_valid & ATTR_SIZE) { | ||
1426 | /* To avoid spurious oplock breaks from server, in the case of | 1447 | /* To avoid spurious oplock breaks from server, in the case of |
1427 | inodes that we already have open, avoid doing path based | 1448 | inodes that we already have open, avoid doing path based |
1428 | setting of file size if we can do it by handle. | 1449 | setting of file size if we can do it by handle. |
diff --git a/fs/cifs/link.c b/fs/cifs/link.c index 1d6fb01b8e6d..d4e7ec93285f 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c | |||
@@ -205,7 +205,7 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname) | |||
205 | inode->i_sb, xid); | 205 | inode->i_sb, xid); |
206 | else | 206 | else |
207 | rc = cifs_get_inode_info(&newinode, full_path, NULL, | 207 | rc = cifs_get_inode_info(&newinode, full_path, NULL, |
208 | inode->i_sb, xid); | 208 | inode->i_sb, xid, NULL); |
209 | 209 | ||
210 | if (rc != 0) { | 210 | if (rc != 0) { |
211 | cFYI(1, ("Create symlink ok, getinodeinfo fail rc = %d", | 211 | cFYI(1, ("Create symlink ok, getinodeinfo fail rc = %d", |
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 4206454734e0..9dfb5ff24209 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
@@ -527,13 +527,21 @@ struct pagemapread { | |||
527 | char __user *out, *end; | 527 | char __user *out, *end; |
528 | }; | 528 | }; |
529 | 529 | ||
530 | #define PM_ENTRY_BYTES sizeof(u64) | 530 | #define PM_ENTRY_BYTES sizeof(u64) |
531 | #define PM_RESERVED_BITS 3 | 531 | #define PM_STATUS_BITS 3 |
532 | #define PM_RESERVED_OFFSET (64 - PM_RESERVED_BITS) | 532 | #define PM_STATUS_OFFSET (64 - PM_STATUS_BITS) |
533 | #define PM_RESERVED_MASK (((1LL<<PM_RESERVED_BITS)-1) << PM_RESERVED_OFFSET) | 533 | #define PM_STATUS_MASK (((1LL << PM_STATUS_BITS) - 1) << PM_STATUS_OFFSET) |
534 | #define PM_SPECIAL(nr) (((nr) << PM_RESERVED_OFFSET) & PM_RESERVED_MASK) | 534 | #define PM_STATUS(nr) (((nr) << PM_STATUS_OFFSET) & PM_STATUS_MASK) |
535 | #define PM_NOT_PRESENT PM_SPECIAL(1LL) | 535 | #define PM_PSHIFT_BITS 6 |
536 | #define PM_SWAP PM_SPECIAL(2LL) | 536 | #define PM_PSHIFT_OFFSET (PM_STATUS_OFFSET - PM_PSHIFT_BITS) |
537 | #define PM_PSHIFT_MASK (((1LL << PM_PSHIFT_BITS) - 1) << PM_PSHIFT_OFFSET) | ||
538 | #define PM_PSHIFT(x) (((u64) (x) << PM_PSHIFT_OFFSET) & PM_PSHIFT_MASK) | ||
539 | #define PM_PFRAME_MASK ((1LL << PM_PSHIFT_OFFSET) - 1) | ||
540 | #define PM_PFRAME(x) ((x) & PM_PFRAME_MASK) | ||
541 | |||
542 | #define PM_PRESENT PM_STATUS(4LL) | ||
543 | #define PM_SWAP PM_STATUS(2LL) | ||
544 | #define PM_NOT_PRESENT PM_PSHIFT(PAGE_SHIFT) | ||
537 | #define PM_END_OF_BUFFER 1 | 545 | #define PM_END_OF_BUFFER 1 |
538 | 546 | ||
539 | static int add_to_pagemap(unsigned long addr, u64 pfn, | 547 | static int add_to_pagemap(unsigned long addr, u64 pfn, |
@@ -574,7 +582,7 @@ static int pagemap_pte_hole(unsigned long start, unsigned long end, | |||
574 | u64 swap_pte_to_pagemap_entry(pte_t pte) | 582 | u64 swap_pte_to_pagemap_entry(pte_t pte) |
575 | { | 583 | { |
576 | swp_entry_t e = pte_to_swp_entry(pte); | 584 | swp_entry_t e = pte_to_swp_entry(pte); |
577 | return PM_SWAP | swp_type(e) | (swp_offset(e) << MAX_SWAPFILES_SHIFT); | 585 | return swp_type(e) | (swp_offset(e) << MAX_SWAPFILES_SHIFT); |
578 | } | 586 | } |
579 | 587 | ||
580 | static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, | 588 | static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, |
@@ -588,9 +596,11 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, | |||
588 | u64 pfn = PM_NOT_PRESENT; | 596 | u64 pfn = PM_NOT_PRESENT; |
589 | pte = pte_offset_map(pmd, addr); | 597 | pte = pte_offset_map(pmd, addr); |
590 | if (is_swap_pte(*pte)) | 598 | if (is_swap_pte(*pte)) |
591 | pfn = swap_pte_to_pagemap_entry(*pte); | 599 | pfn = PM_PFRAME(swap_pte_to_pagemap_entry(*pte)) |
600 | | PM_PSHIFT(PAGE_SHIFT) | PM_SWAP; | ||
592 | else if (pte_present(*pte)) | 601 | else if (pte_present(*pte)) |
593 | pfn = pte_pfn(*pte); | 602 | pfn = PM_PFRAME(pte_pfn(*pte)) |
603 | | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT; | ||
594 | /* unmap so we're not in atomic when we copy to userspace */ | 604 | /* unmap so we're not in atomic when we copy to userspace */ |
595 | pte_unmap(pte); | 605 | pte_unmap(pte); |
596 | err = add_to_pagemap(addr, pfn, pm); | 606 | err = add_to_pagemap(addr, pfn, pm); |
@@ -611,12 +621,20 @@ static struct mm_walk pagemap_walk = { | |||
611 | /* | 621 | /* |
612 | * /proc/pid/pagemap - an array mapping virtual pages to pfns | 622 | * /proc/pid/pagemap - an array mapping virtual pages to pfns |
613 | * | 623 | * |
614 | * For each page in the address space, this file contains one 64-bit | 624 | * For each page in the address space, this file contains one 64-bit entry |
615 | * entry representing the corresponding physical page frame number | 625 | * consisting of the following: |
616 | * (PFN) if the page is present. If there is a swap entry for the | 626 | * |
617 | * physical page, then an encoding of the swap file number and the | 627 | * Bits 0-55 page frame number (PFN) if present |
618 | * page's offset into the swap file are returned. If no page is | 628 | * Bits 0-4 swap type if swapped |
619 | * present at all, PM_NOT_PRESENT is returned. This allows determining | 629 | * Bits 5-55 swap offset if swapped |
630 | * Bits 55-60 page shift (page size = 1<<page shift) | ||
631 | * Bit 61 reserved for future use | ||
632 | * Bit 62 page swapped | ||
633 | * Bit 63 page present | ||
634 | * | ||
635 | * If the page is not present but in swap, then the PFN contains an | ||
636 | * encoding of the swap file number and the page's offset into the | ||
637 | * swap. Unmapped pages return a null PFN. This allows determining | ||
620 | * precisely which pages are mapped (or in swap) and comparing mapped | 638 | * precisely which pages are mapped (or in swap) and comparing mapped |
621 | * pages between processes. | 639 | * pages between processes. |
622 | * | 640 | * |
diff --git a/include/asm-x86/pci_64.h b/include/asm-x86/pci_64.h index da8266a08005..374690314539 100644 --- a/include/asm-x86/pci_64.h +++ b/include/asm-x86/pci_64.h | |||
@@ -25,7 +25,6 @@ extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int l | |||
25 | 25 | ||
26 | 26 | ||
27 | 27 | ||
28 | extern void dma32_reserve_bootmem(void); | ||
29 | extern void pci_iommu_alloc(void); | 28 | extern void pci_iommu_alloc(void); |
30 | 29 | ||
31 | /* The PCI address space does equal the physical memory | 30 | /* The PCI address space does equal the physical memory |
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index cd6332b88829..29dd55838e84 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <linux/mod_devicetable.h> | 14 | #include <linux/mod_devicetable.h> |
15 | 15 | ||
16 | #define PNP_MAX_PORT 40 | 16 | #define PNP_MAX_PORT 40 |
17 | #define PNP_MAX_MEM 12 | 17 | #define PNP_MAX_MEM 24 |
18 | #define PNP_MAX_IRQ 2 | 18 | #define PNP_MAX_IRQ 2 |
19 | #define PNP_MAX_DMA 2 | 19 | #define PNP_MAX_DMA 2 |
20 | #define PNP_NAME_LEN 50 | 20 | #define PNP_NAME_LEN 50 |