aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/xtensa/platforms/iss/simdisk.c2
-rw-r--r--drivers/hwmon/abx500.c2
-rw-r--r--drivers/nubus/proc.c15
-rw-r--r--drivers/scsi/sun3_NCR5380.c183
-rw-r--r--drivers/scsi/sun3_scsi.c1
-rw-r--r--drivers/scsi/sun3_scsi.h2
-rw-r--r--fs/compat.c2
-rw-r--r--fs/compat_ioctl.c1
-rw-r--r--fs/coredump.c9
-rw-r--r--fs/dcache.c34
-rw-r--r--fs/hostfs/hostfs_kern.c8
-rw-r--r--fs/namespace.c7
-rw-r--r--fs/proc/proc_devtree.c2
-rw-r--r--fs/read_write.c5
-rw-r--r--fs/read_write.h9
-rw-r--r--include/linux/fs.h7
-rw-r--r--include/linux/nubus.h1
-rw-r--r--include/uapi/linux/magic.h1
-rw-r--r--kernel/acct.c7
19 files changed, 123 insertions, 175 deletions
diff --git a/arch/xtensa/platforms/iss/simdisk.c b/arch/xtensa/platforms/iss/simdisk.c
index 4a06d70ddf5e..88608cc11b8c 100644
--- a/arch/xtensa/platforms/iss/simdisk.c
+++ b/arch/xtensa/platforms/iss/simdisk.c
@@ -231,7 +231,7 @@ static ssize_t proc_read_simdisk(struct file *file, char __user *buf,
231} 231}
232 232
233static ssize_t proc_write_simdisk(struct file *file, const char __user *buf, 233static ssize_t proc_write_simdisk(struct file *file, const char __user *buf,
234 size_t size, loff_t *ppos) 234 size_t count, loff_t *ppos)
235{ 235{
236 char *tmp = kmalloc(count + 1, GFP_KERNEL); 236 char *tmp = kmalloc(count + 1, GFP_KERNEL);
237 struct simdisk *dev = PDE_DATA(file_inode(file)); 237 struct simdisk *dev = PDE_DATA(file_inode(file));
diff --git a/drivers/hwmon/abx500.c b/drivers/hwmon/abx500.c
index b4ad87b31a37..eee1134274c8 100644
--- a/drivers/hwmon/abx500.c
+++ b/drivers/hwmon/abx500.c
@@ -260,7 +260,7 @@ static ssize_t show_max_alarm(struct device *dev,
260 return sprintf(buf, "%d\n", data->max_alarm[attr->index]); 260 return sprintf(buf, "%d\n", data->max_alarm[attr->index]);
261} 261}
262 262
263static mode_t abx500_attrs_visible(struct kobject *kobj, 263static umode_t abx500_attrs_visible(struct kobject *kobj,
264 struct attribute *attr, int n) 264 struct attribute *attr, int n)
265{ 265{
266 struct device *dev = container_of(kobj, struct device, kobj); 266 struct device *dev = container_of(kobj, struct device, kobj);
diff --git a/drivers/nubus/proc.c b/drivers/nubus/proc.c
index b8286ed65919..5371b374f1fe 100644
--- a/drivers/nubus/proc.c
+++ b/drivers/nubus/proc.c
@@ -147,21 +147,6 @@ int nubus_proc_attach_device(struct nubus_dev *dev)
147} 147}
148EXPORT_SYMBOL(nubus_proc_attach_device); 148EXPORT_SYMBOL(nubus_proc_attach_device);
149 149
150/* FIXME: this is certainly broken! */
151int nubus_proc_detach_device(struct nubus_dev *dev)
152{
153 struct proc_dir_entry *e;
154
155 if ((e = dev->procdir)) {
156 if (atomic_read(&e->count))
157 return -EBUSY;
158 remove_proc_entry(e->name, proc_bus_nubus_dir);
159 dev->procdir = NULL;
160 }
161 return 0;
162}
163EXPORT_SYMBOL(nubus_proc_detach_device);
164
165/* 150/*
166 * /proc/nubus stuff 151 * /proc/nubus stuff
167 */ 152 */
diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c
index 7e12a2e4e0a3..636bbe0ea84c 100644
--- a/drivers/scsi/sun3_NCR5380.c
+++ b/drivers/scsi/sun3_NCR5380.c
@@ -661,121 +661,94 @@ static void __init NCR5380_print_options (struct Scsi_Host *instance)
661 * Inputs : instance, pointer to this instance. 661 * Inputs : instance, pointer to this instance.
662 */ 662 */
663 663
664static void NCR5380_print_status (struct Scsi_Host *instance) 664static void lprint_Scsi_Cmnd(Scsi_Cmnd *cmd)
665{ 665{
666 char *pr_bfr; 666 int i, s;
667 char *start; 667 unsigned char *command;
668 int len; 668 printk("scsi%d: destination target %d, lun %d\n",
669 669 H_NO(cmd), cmd->device->id, cmd->device->lun);
670 NCR_PRINT(NDEBUG_ANY); 670 printk(KERN_CONT " command = ");
671 NCR_PRINT_PHASE(NDEBUG_ANY); 671 command = cmd->cmnd;
672 672 printk(KERN_CONT "%2d (0x%02x)", command[0], command[0]);
673 pr_bfr = (char *) __get_free_page(GFP_ATOMIC); 673 for (i = 1, s = COMMAND_SIZE(command[0]); i < s; ++i)
674 if (!pr_bfr) { 674 printk(KERN_CONT " %02x", command[i]);
675 printk("NCR5380_print_status: no memory for print buffer\n"); 675 printk("\n");
676 return;
677 }
678 len = NCR5380_proc_info(instance, pr_bfr, &start, 0, PAGE_SIZE, 0);
679 pr_bfr[len] = 0;
680 printk("\n%s\n", pr_bfr);
681 free_page((unsigned long) pr_bfr);
682} 676}
683 677
684 678static void NCR5380_print_status(struct Scsi_Host *instance)
685/******************************************/
686/*
687 * /proc/scsi/[dtc pas16 t128 generic]/[0-ASC_NUM_BOARD_SUPPORTED]
688 *
689 * *buffer: I/O buffer
690 * **start: if inout == FALSE pointer into buffer where user read should start
691 * offset: current offset
692 * length: length of buffer
693 * hostno: Scsi_Host host_no
694 * inout: TRUE - user is writing; FALSE - user is reading
695 *
696 * Return the number of bytes read from or written
697*/
698
699#undef SPRINTF
700#define SPRINTF(fmt,args...) \
701 do { if (pos + strlen(fmt) + 20 /* slop */ < buffer + length) \
702 pos += sprintf(pos, fmt , ## args); } while(0)
703static
704char *lprint_Scsi_Cmnd(struct scsi_cmnd *cmd, char *pos, char *buffer,
705 int length);
706
707static int NCR5380_proc_info(struct Scsi_Host *instance, char *buffer,
708 char **start, off_t offset, int length, int inout)
709{ 679{
710 char *pos = buffer; 680 struct NCR5380_hostdata *hostdata;
711 struct NCR5380_hostdata *hostdata; 681 Scsi_Cmnd *ptr;
712 struct scsi_cmnd *ptr; 682 unsigned long flags;
713 unsigned long flags; 683
714 off_t begin = 0; 684 NCR_PRINT(NDEBUG_ANY);
715#define check_offset() \ 685 NCR_PRINT_PHASE(NDEBUG_ANY);
716 do { \ 686
717 if (pos - buffer < offset - begin) { \ 687 hostdata = (struct NCR5380_hostdata *)instance->hostdata;
718 begin += pos - buffer; \ 688
719 pos = buffer; \ 689 printk("\nNCR5380 core release=%d.\n", NCR5380_PUBLIC_RELEASE);
720 } \ 690 local_irq_save(flags);
721 } while (0) 691 printk("NCR5380: coroutine is%s running.\n",
722 692 main_running ? "" : "n't");
723 hostdata = (struct NCR5380_hostdata *)instance->hostdata; 693 if (!hostdata->connected)
724 694 printk("scsi%d: no currently connected command\n", HOSTNO);
725 if (inout) { /* Has data been written to the file ? */ 695 else
726 return(-ENOSYS); /* Currently this is a no-op */ 696 lprint_Scsi_Cmnd((Scsi_Cmnd *) hostdata->connected);
727 } 697 printk("scsi%d: issue_queue\n", HOSTNO);
728 SPRINTF("NCR5380 core release=%d.\n", NCR5380_PUBLIC_RELEASE); 698 for (ptr = (Scsi_Cmnd *)hostdata->issue_queue; ptr; ptr = NEXT(ptr))
729 check_offset(); 699 lprint_Scsi_Cmnd(ptr);
730 local_irq_save(flags); 700
731 SPRINTF("NCR5380: coroutine is%s running.\n", main_running ? "" : "n't"); 701 printk("scsi%d: disconnected_queue\n", HOSTNO);
732 check_offset(); 702 for (ptr = (Scsi_Cmnd *) hostdata->disconnected_queue; ptr;
733 if (!hostdata->connected) 703 ptr = NEXT(ptr))
734 SPRINTF("scsi%d: no currently connected command\n", HOSTNO); 704 lprint_Scsi_Cmnd(ptr);
735 else
736 pos = lprint_Scsi_Cmnd ((struct scsi_cmnd *) hostdata->connected,
737 pos, buffer, length);
738 SPRINTF("scsi%d: issue_queue\n", HOSTNO);
739 check_offset();
740 for (ptr = (struct scsi_cmnd *) hostdata->issue_queue; ptr; ptr = NEXT(ptr))
741 {
742 pos = lprint_Scsi_Cmnd (ptr, pos, buffer, length);
743 check_offset();
744 }
745
746 SPRINTF("scsi%d: disconnected_queue\n", HOSTNO);
747 check_offset();
748 for (ptr = (struct scsi_cmnd *) hostdata->disconnected_queue; ptr;
749 ptr = NEXT(ptr)) {
750 pos = lprint_Scsi_Cmnd (ptr, pos, buffer, length);
751 check_offset();
752 }
753 705
754 local_irq_restore(flags); 706 local_irq_restore(flags);
755 *start = buffer + (offset - begin); 707 printk("\n");
756 if (pos - buffer < offset - begin)
757 return 0;
758 else if (pos - buffer - (offset - begin) < length)
759 return pos - buffer - (offset - begin);
760 return length;
761} 708}
762 709
763static char *lprint_Scsi_Cmnd(struct scsi_cmnd *cmd, char *pos, char *buffer, 710static void show_Scsi_Cmnd(Scsi_Cmnd *cmd, struct seq_file *m)
764 int length)
765{ 711{
766 int i, s; 712 int i, s;
767 unsigned char *command; 713 unsigned char *command;
768 SPRINTF("scsi%d: destination target %d, lun %d\n", 714 seq_printf(m, "scsi%d: destination target %d, lun %d\n",
769 H_NO(cmd), cmd->device->id, cmd->device->lun); 715 H_NO(cmd), cmd->device->id, cmd->device->lun);
770 SPRINTF(" command = "); 716 seq_printf(m, " command = ");
771 command = cmd->cmnd; 717 command = cmd->cmnd;
772 SPRINTF("%2d (0x%02x)", command[0], command[0]); 718 seq_printf(m, "%2d (0x%02x)", command[0], command[0]);
773 for (i = 1, s = COMMAND_SIZE(command[0]); i < s; ++i) 719 for (i = 1, s = COMMAND_SIZE(command[0]); i < s; ++i)
774 SPRINTF(" %02x", command[i]); 720 seq_printf(m, " %02x", command[i]);
775 SPRINTF("\n"); 721 seq_printf(m, "\n");
776 return pos;
777} 722}
778 723
724static int NCR5380_show_info(struct seq_file *m, struct Scsi_Host *instance)
725{
726 struct NCR5380_hostdata *hostdata;
727 Scsi_Cmnd *ptr;
728 unsigned long flags;
729
730 hostdata = (struct NCR5380_hostdata *)instance->hostdata;
731
732 seq_printf(m, "NCR5380 core release=%d.\n", NCR5380_PUBLIC_RELEASE);
733 local_irq_save(flags);
734 seq_printf(m, "NCR5380: coroutine is%s running.\n",
735 main_running ? "" : "n't");
736 if (!hostdata->connected)
737 seq_printf(m, "scsi%d: no currently connected command\n", HOSTNO);
738 else
739 show_Scsi_Cmnd((Scsi_Cmnd *) hostdata->connected, m);
740 seq_printf(m, "scsi%d: issue_queue\n", HOSTNO);
741 for (ptr = (Scsi_Cmnd *)hostdata->issue_queue; ptr; ptr = NEXT(ptr))
742 show_Scsi_Cmnd(ptr, m);
743
744 seq_printf(m, "scsi%d: disconnected_queue\n", HOSTNO);
745 for (ptr = (Scsi_Cmnd *) hostdata->disconnected_queue; ptr;
746 ptr = NEXT(ptr))
747 show_Scsi_Cmnd(ptr, m);
748
749 local_irq_restore(flags);
750 return 0;
751}
779 752
780/* 753/*
781 * Function : void NCR5380_init (struct Scsi_Host *instance) 754 * Function : void NCR5380_init (struct Scsi_Host *instance)
diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c
index 6e25889db9d4..e2c009b033ce 100644
--- a/drivers/scsi/sun3_scsi.c
+++ b/drivers/scsi/sun3_scsi.c
@@ -626,6 +626,7 @@ static int sun3scsi_dma_finish(int write_flag)
626#include "sun3_NCR5380.c" 626#include "sun3_NCR5380.c"
627 627
628static struct scsi_host_template driver_template = { 628static struct scsi_host_template driver_template = {
629 .show_info = sun3scsi_show_info,
629 .name = SUN3_SCSI_NAME, 630 .name = SUN3_SCSI_NAME,
630 .detect = sun3scsi_detect, 631 .detect = sun3scsi_detect,
631 .release = sun3scsi_release, 632 .release = sun3scsi_release,
diff --git a/drivers/scsi/sun3_scsi.h b/drivers/scsi/sun3_scsi.h
index bcefd8458e65..a8da9c710fea 100644
--- a/drivers/scsi/sun3_scsi.h
+++ b/drivers/scsi/sun3_scsi.h
@@ -100,7 +100,7 @@ static int sun3scsi_release (struct Scsi_Host *);
100#define NCR5380_queue_command sun3scsi_queue_command 100#define NCR5380_queue_command sun3scsi_queue_command
101#define NCR5380_bus_reset sun3scsi_bus_reset 101#define NCR5380_bus_reset sun3scsi_bus_reset
102#define NCR5380_abort sun3scsi_abort 102#define NCR5380_abort sun3scsi_abort
103#define NCR5380_proc_info sun3scsi_proc_info 103#define NCR5380_show_info sun3scsi_show_info
104#define NCR5380_dma_xfer_len(i, cmd, phase) \ 104#define NCR5380_dma_xfer_len(i, cmd, phase) \
105 sun3scsi_dma_xfer_len(cmd->SCp.this_residual,cmd,((phase) & SR_IO) ? 0 : 1) 105 sun3scsi_dma_xfer_len(cmd->SCp.this_residual,cmd,((phase) & SR_IO) ? 0 : 1)
106 106
diff --git a/fs/compat.c b/fs/compat.c
index d0560c93973d..93f7d021b716 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -67,8 +67,6 @@ int compat_printk(const char *fmt, ...)
67 return ret; 67 return ret;
68} 68}
69 69
70#include "read_write.h"
71
72/* 70/*
73 * Not all architectures have sys_utime, so implement this in terms 71 * Not all architectures have sys_utime, so implement this in terms
74 * of sys_utimes. 72 * of sys_utimes.
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index 3ced75f765ca..996cdc5abb85 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -608,7 +608,6 @@ struct serial_struct32 {
608static int serial_struct_ioctl(unsigned fd, unsigned cmd, 608static int serial_struct_ioctl(unsigned fd, unsigned cmd,
609 struct serial_struct32 __user *ss32) 609 struct serial_struct32 __user *ss32)
610{ 610{
611 typedef struct serial_struct SS;
612 typedef struct serial_struct32 SS32; 611 typedef struct serial_struct32 SS32;
613 int err; 612 int err;
614 struct serial_struct ss; 613 struct serial_struct ss;
diff --git a/fs/coredump.c b/fs/coredump.c
index a9abe313e8d5..dafafbafa731 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -654,10 +654,11 @@ void do_coredump(siginfo_t *siginfo)
654 goto close_fail; 654 goto close_fail;
655 if (displaced) 655 if (displaced)
656 put_files_struct(displaced); 656 put_files_struct(displaced);
657 file_start_write(cprm.file); 657 if (!dump_interrupted()) {
658 core_dumped = !dump_interrupted() && binfmt->core_dump(&cprm); 658 file_start_write(cprm.file);
659 file_end_write(cprm.file); 659 core_dumped = binfmt->core_dump(&cprm);
660 660 file_end_write(cprm.file);
661 }
661 if (ispipe && core_pipe_limit) 662 if (ispipe && core_pipe_limit)
662 wait_for_dump_helpers(cprm.file); 663 wait_for_dump_helpers(cprm.file);
663close_fail: 664close_fail:
diff --git a/fs/dcache.c b/fs/dcache.c
index e689268046c3..f09b9085f7d8 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -337,23 +337,6 @@ static void dentry_lru_del(struct dentry *dentry)
337 } 337 }
338} 338}
339 339
340/*
341 * Remove a dentry that is unreferenced and about to be pruned
342 * (unhashed and destroyed) from the LRU, and inform the file system.
343 * This wrapper should be called _prior_ to unhashing a victim dentry.
344 */
345static void dentry_lru_prune(struct dentry *dentry)
346{
347 if (!list_empty(&dentry->d_lru)) {
348 if (dentry->d_flags & DCACHE_OP_PRUNE)
349 dentry->d_op->d_prune(dentry);
350
351 spin_lock(&dcache_lru_lock);
352 __dentry_lru_del(dentry);
353 spin_unlock(&dcache_lru_lock);
354 }
355}
356
357static void dentry_lru_move_list(struct dentry *dentry, struct list_head *list) 340static void dentry_lru_move_list(struct dentry *dentry, struct list_head *list)
358{ 341{
359 spin_lock(&dcache_lru_lock); 342 spin_lock(&dcache_lru_lock);
@@ -486,11 +469,13 @@ relock:
486 if (ref) 469 if (ref)
487 dentry->d_count--; 470 dentry->d_count--;
488 /* 471 /*
489 * if dentry was on the d_lru list delete it from there.
490 * inform the fs via d_prune that this dentry is about to be 472 * inform the fs via d_prune that this dentry is about to be
491 * unhashed and destroyed. 473 * unhashed and destroyed.
492 */ 474 */
493 dentry_lru_prune(dentry); 475 if (dentry->d_flags & DCACHE_OP_PRUNE)
476 dentry->d_op->d_prune(dentry);
477
478 dentry_lru_del(dentry);
494 /* if it was on the hash then remove it */ 479 /* if it was on the hash then remove it */
495 __d_drop(dentry); 480 __d_drop(dentry);
496 return d_kill(dentry, parent); 481 return d_kill(dentry, parent);
@@ -919,11 +904,13 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry)
919 struct inode *inode; 904 struct inode *inode;
920 905
921 /* 906 /*
922 * remove the dentry from the lru, and inform 907 * inform the fs that this dentry is about to be
923 * the fs that this dentry is about to be
924 * unhashed and destroyed. 908 * unhashed and destroyed.
925 */ 909 */
926 dentry_lru_prune(dentry); 910 if (dentry->d_flags & DCACHE_OP_PRUNE)
911 dentry->d_op->d_prune(dentry);
912
913 dentry_lru_del(dentry);
927 __d_shrink(dentry); 914 __d_shrink(dentry);
928 915
929 if (dentry->d_count != 0) { 916 if (dentry->d_count != 0) {
@@ -2410,8 +2397,7 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon)
2410 dentry->d_parent = dentry; 2397 dentry->d_parent = dentry;
2411 list_del_init(&dentry->d_u.d_child); 2398 list_del_init(&dentry->d_u.d_child);
2412 anon->d_parent = dparent; 2399 anon->d_parent = dparent;
2413 list_del(&anon->d_u.d_child); 2400 list_move(&anon->d_u.d_child, &dparent->d_subdirs);
2414 list_add(&anon->d_u.d_child, &dparent->d_subdirs);
2415 2401
2416 write_seqcount_end(&dentry->d_seq); 2402 write_seqcount_end(&dentry->d_seq);
2417 write_seqcount_end(&anon->d_seq); 2403 write_seqcount_end(&anon->d_seq);
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index 0f6e52d22b84..32f35f187989 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -7,6 +7,7 @@
7 */ 7 */
8 8
9#include <linux/fs.h> 9#include <linux/fs.h>
10#include <linux/magic.h>
10#include <linux/module.h> 11#include <linux/module.h>
11#include <linux/mm.h> 12#include <linux/mm.h>
12#include <linux/pagemap.h> 13#include <linux/pagemap.h>
@@ -45,8 +46,6 @@ static const struct dentry_operations hostfs_dentry_ops = {
45static char *root_ino = ""; 46static char *root_ino = "";
46static int append = 0; 47static int append = 0;
47 48
48#define HOSTFS_SUPER_MAGIC 0x00c0ffee
49
50static const struct inode_operations hostfs_iops; 49static const struct inode_operations hostfs_iops;
51static const struct inode_operations hostfs_dir_iops; 50static const struct inode_operations hostfs_dir_iops;
52static const struct inode_operations hostfs_link_iops; 51static const struct inode_operations hostfs_link_iops;
@@ -121,7 +120,7 @@ static char *dentry_name(struct dentry *dentry)
121 if (!name) 120 if (!name)
122 return NULL; 121 return NULL;
123 122
124 return __dentry_name(dentry, name); /* will unlock */ 123 return __dentry_name(dentry, name);
125} 124}
126 125
127static char *inode_name(struct inode *ino) 126static char *inode_name(struct inode *ino)
@@ -229,10 +228,11 @@ static struct inode *hostfs_alloc_inode(struct super_block *sb)
229{ 228{
230 struct hostfs_inode_info *hi; 229 struct hostfs_inode_info *hi;
231 230
232 hi = kzalloc(sizeof(*hi), GFP_KERNEL); 231 hi = kmalloc(sizeof(*hi), GFP_KERNEL);
233 if (hi == NULL) 232 if (hi == NULL)
234 return NULL; 233 return NULL;
235 hi->fd = -1; 234 hi->fd = -1;
235 hi->mode = 0;
236 inode_init_once(&hi->vfs_inode); 236 inode_init_once(&hi->vfs_inode);
237 return &hi->vfs_inode; 237 return &hi->vfs_inode;
238} 238}
diff --git a/fs/namespace.c b/fs/namespace.c
index b4f96a5230a3..7b1ca9ba0b0a 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2284,12 +2284,11 @@ long do_mount(const char *dev_name, const char *dir_name,
2284 2284
2285 retval = security_sb_mount(dev_name, &path, 2285 retval = security_sb_mount(dev_name, &path,
2286 type_page, flags, data_page); 2286 type_page, flags, data_page);
2287 if (!retval && !may_mount())
2288 retval = -EPERM;
2287 if (retval) 2289 if (retval)
2288 goto dput_out; 2290 goto dput_out;
2289 2291
2290 if (!may_mount())
2291 return -EPERM;
2292
2293 /* Default to relatime unless overriden */ 2292 /* Default to relatime unless overriden */
2294 if (!(flags & MS_NOATIME)) 2293 if (!(flags & MS_NOATIME))
2295 mnt_flags |= MNT_RELATIME; 2294 mnt_flags |= MNT_RELATIME;
@@ -2464,7 +2463,7 @@ static struct mnt_namespace *create_mnt_ns(struct vfsmount *m)
2464 struct mount *mnt = real_mount(m); 2463 struct mount *mnt = real_mount(m);
2465 mnt->mnt_ns = new_ns; 2464 mnt->mnt_ns = new_ns;
2466 new_ns->root = mnt; 2465 new_ns->root = mnt;
2467 list_add(&new_ns->list, &mnt->mnt_list); 2466 list_add(&mnt->mnt_list, &new_ns->list);
2468 } else { 2467 } else {
2469 mntput(m); 2468 mntput(m);
2470 } 2469 }
diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c
index 505afc950e0a..106a83570630 100644
--- a/fs/proc/proc_devtree.c
+++ b/fs/proc/proc_devtree.c
@@ -12,7 +12,7 @@
12#include <linux/stat.h> 12#include <linux/stat.h>
13#include <linux/string.h> 13#include <linux/string.h>
14#include <linux/of.h> 14#include <linux/of.h>
15#include <linux/module.h> 15#include <linux/export.h>
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <asm/prom.h> 17#include <asm/prom.h>
18#include <asm/uaccess.h> 18#include <asm/uaccess.h>
diff --git a/fs/read_write.c b/fs/read_write.c
index 605dbbcb1973..90ba3b350e50 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -16,12 +16,15 @@
16#include <linux/pagemap.h> 16#include <linux/pagemap.h>
17#include <linux/splice.h> 17#include <linux/splice.h>
18#include <linux/compat.h> 18#include <linux/compat.h>
19#include "read_write.h"
20#include "internal.h" 19#include "internal.h"
21 20
22#include <asm/uaccess.h> 21#include <asm/uaccess.h>
23#include <asm/unistd.h> 22#include <asm/unistd.h>
24 23
24typedef ssize_t (*io_fn_t)(struct file *, char __user *, size_t, loff_t *);
25typedef ssize_t (*iov_fn_t)(struct kiocb *, const struct iovec *,
26 unsigned long, loff_t);
27
25const struct file_operations generic_ro_fops = { 28const struct file_operations generic_ro_fops = {
26 .llseek = generic_file_llseek, 29 .llseek = generic_file_llseek,
27 .read = do_sync_read, 30 .read = do_sync_read,
diff --git a/fs/read_write.h b/fs/read_write.h
deleted file mode 100644
index 0ec530d9305b..000000000000
--- a/fs/read_write.h
+++ /dev/null
@@ -1,9 +0,0 @@
1/*
2 * This file is only for sharing some helpers from read_write.c with compat.c.
3 * Don't use anywhere else.
4 */
5
6
7typedef ssize_t (*io_fn_t)(struct file *, char __user *, size_t, loff_t *);
8typedef ssize_t (*iov_fn_t)(struct kiocb *, const struct iovec *,
9 unsigned long, loff_t);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index e8cd6b839675..b5a24ba83b6f 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2227,6 +2227,13 @@ static inline void file_start_write(struct file *file)
2227 __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, true); 2227 __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, true);
2228} 2228}
2229 2229
2230static inline bool file_start_write_trylock(struct file *file)
2231{
2232 if (!S_ISREG(file_inode(file)->i_mode))
2233 return true;
2234 return __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, false);
2235}
2236
2230static inline void file_end_write(struct file *file) 2237static inline void file_end_write(struct file *file)
2231{ 2238{
2232 if (!S_ISREG(file_inode(file)->i_mode)) 2239 if (!S_ISREG(file_inode(file)->i_mode))
diff --git a/include/linux/nubus.h b/include/linux/nubus.h
index b3740527571a..6165b2c62040 100644
--- a/include/linux/nubus.h
+++ b/include/linux/nubus.h
@@ -87,7 +87,6 @@ static inline void nubus_proc_init(void) {}
87#endif 87#endif
88int get_nubus_list(char *buf); 88int get_nubus_list(char *buf);
89int nubus_proc_attach_device(struct nubus_dev *dev); 89int nubus_proc_attach_device(struct nubus_dev *dev);
90int nubus_proc_detach_device(struct nubus_dev *dev);
91/* If we need more precision we can add some more of these */ 90/* If we need more precision we can add some more of these */
92struct nubus_dev* nubus_find_device(unsigned short category, 91struct nubus_dev* nubus_find_device(unsigned short category,
93 unsigned short type, 92 unsigned short type,
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index 249df3720be2..2944278a8ba7 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -30,6 +30,7 @@
30#define JFFS2_SUPER_MAGIC 0x72b6 30#define JFFS2_SUPER_MAGIC 0x72b6
31#define PSTOREFS_MAGIC 0x6165676C 31#define PSTOREFS_MAGIC 0x6165676C
32#define EFIVARFS_MAGIC 0xde5e81e4 32#define EFIVARFS_MAGIC 0xde5e81e4
33#define HOSTFS_SUPER_MAGIC 0x00c0ffee
33 34
34#define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */ 35#define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */
35#define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */ 36#define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */
diff --git a/kernel/acct.c b/kernel/acct.c
index 85389fe2abd0..8d6e145138bb 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -540,10 +540,15 @@ static void do_acct_process(struct bsd_acct_struct *acct,
540 ac.ac_swaps = encode_comp_t(0); 540 ac.ac_swaps = encode_comp_t(0);
541 541
542 /* 542 /*
543 * Get freeze protection. If the fs is frozen, just skip the write
544 * as we could deadlock the system otherwise.
545 */
546 if (!file_start_write_trylock(file))
547 goto out;
548 /*
543 * Kernel segment override to datasegment and write it 549 * Kernel segment override to datasegment and write it
544 * to the accounting file. 550 * to the accounting file.
545 */ 551 */
546 file_start_write(file);
547 fs = get_fs(); 552 fs = get_fs();
548 set_fs(KERNEL_DS); 553 set_fs(KERNEL_DS);
549 /* 554 /*