Commit bd932ae1 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull second round of VFS updates from Al Viro:
 "Assorted fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  xtensa simdisk: fix braino in "xtensa simdisk: switch to proc_create_data()"
  hostfs: use kmalloc instead of kzalloc
  hostfs: move HOSTFS_SUPER_MAGIC to <linux/magic.h>
  hostfs: remove "will unlock" comment
  vfs: use list_move instead of list_del/list_add
  proc_devtree: Replace include linux/module.h with linux/export.h
  create_mnt_ns: unidiomatic use of list_add()
  fs: remove dentry_lru_prune()
  Removed unused typedef to avoid "unused local typedef" warnings.
  kill fs/read_write.h
  fs: Fix hang with BSD accounting on frozen filesystem
  sun3_scsi: add ->show_info()
  nubus: Kill nubus_proc_detach_device()
  more mode_t whack-a-mole...
  do_coredump(): don't wait for thaw if coredump has already been interrupted
  do_mount(): fix a leak introduced in 3.9 ("mount: consolidate permission checks")
parents 150a8dcf 4fe56e80
...@@ -231,7 +231,7 @@ static ssize_t proc_read_simdisk(struct file *file, char __user *buf, ...@@ -231,7 +231,7 @@ static ssize_t proc_read_simdisk(struct file *file, char __user *buf,
} }
static ssize_t proc_write_simdisk(struct file *file, const char __user *buf, static ssize_t proc_write_simdisk(struct file *file, const char __user *buf,
size_t size, loff_t *ppos) size_t count, loff_t *ppos)
{ {
char *tmp = kmalloc(count + 1, GFP_KERNEL); char *tmp = kmalloc(count + 1, GFP_KERNEL);
struct simdisk *dev = PDE_DATA(file_inode(file)); struct simdisk *dev = PDE_DATA(file_inode(file));
......
...@@ -260,7 +260,7 @@ static ssize_t show_max_alarm(struct device *dev, ...@@ -260,7 +260,7 @@ static ssize_t show_max_alarm(struct device *dev,
return sprintf(buf, "%d\n", data->max_alarm[attr->index]); return sprintf(buf, "%d\n", data->max_alarm[attr->index]);
} }
static mode_t abx500_attrs_visible(struct kobject *kobj, static umode_t abx500_attrs_visible(struct kobject *kobj,
struct attribute *attr, int n) struct attribute *attr, int n)
{ {
struct device *dev = container_of(kobj, struct device, kobj); struct device *dev = container_of(kobj, struct device, kobj);
......
...@@ -147,21 +147,6 @@ int nubus_proc_attach_device(struct nubus_dev *dev) ...@@ -147,21 +147,6 @@ int nubus_proc_attach_device(struct nubus_dev *dev)
} }
EXPORT_SYMBOL(nubus_proc_attach_device); EXPORT_SYMBOL(nubus_proc_attach_device);
/* FIXME: this is certainly broken! */
int nubus_proc_detach_device(struct nubus_dev *dev)
{
struct proc_dir_entry *e;
if ((e = dev->procdir)) {
if (atomic_read(&e->count))
return -EBUSY;
remove_proc_entry(e->name, proc_bus_nubus_dir);
dev->procdir = NULL;
}
return 0;
}
EXPORT_SYMBOL(nubus_proc_detach_device);
/* /*
* /proc/nubus stuff * /proc/nubus stuff
*/ */
......
...@@ -661,121 +661,94 @@ static void __init NCR5380_print_options (struct Scsi_Host *instance) ...@@ -661,121 +661,94 @@ static void __init NCR5380_print_options (struct Scsi_Host *instance)
* Inputs : instance, pointer to this instance. * Inputs : instance, pointer to this instance.
*/ */
static void NCR5380_print_status (struct Scsi_Host *instance) static void lprint_Scsi_Cmnd(Scsi_Cmnd *cmd)
{ {
char *pr_bfr; int i, s;
char *start; unsigned char *command;
int len; printk("scsi%d: destination target %d, lun %d\n",
H_NO(cmd), cmd->device->id, cmd->device->lun);
NCR_PRINT(NDEBUG_ANY); printk(KERN_CONT " command = ");
NCR_PRINT_PHASE(NDEBUG_ANY); command = cmd->cmnd;
printk(KERN_CONT "%2d (0x%02x)", command[0], command[0]);
pr_bfr = (char *) __get_free_page(GFP_ATOMIC); for (i = 1, s = COMMAND_SIZE(command[0]); i < s; ++i)
if (!pr_bfr) { printk(KERN_CONT " %02x", command[i]);
printk("NCR5380_print_status: no memory for print buffer\n"); printk("\n");
return;
}
len = NCR5380_proc_info(instance, pr_bfr, &start, 0, PAGE_SIZE, 0);
pr_bfr[len] = 0;
printk("\n%s\n", pr_bfr);
free_page((unsigned long) pr_bfr);
} }
static void NCR5380_print_status(struct Scsi_Host *instance)
/******************************************/
/*
* /proc/scsi/[dtc pas16 t128 generic]/[0-ASC_NUM_BOARD_SUPPORTED]
*
* *buffer: I/O buffer
* **start: if inout == FALSE pointer into buffer where user read should start
* offset: current offset
* length: length of buffer
* hostno: Scsi_Host host_no
* inout: TRUE - user is writing; FALSE - user is reading
*
* Return the number of bytes read from or written
*/
#undef SPRINTF
#define SPRINTF(fmt,args...) \
do { if (pos + strlen(fmt) + 20 /* slop */ < buffer + length) \
pos += sprintf(pos, fmt , ## args); } while(0)
static
char *lprint_Scsi_Cmnd(struct scsi_cmnd *cmd, char *pos, char *buffer,
int length);
static int NCR5380_proc_info(struct Scsi_Host *instance, char *buffer,
char **start, off_t offset, int length, int inout)
{ {
char *pos = buffer; struct NCR5380_hostdata *hostdata;
struct NCR5380_hostdata *hostdata; Scsi_Cmnd *ptr;
struct scsi_cmnd *ptr; unsigned long flags;
unsigned long flags;
off_t begin = 0; NCR_PRINT(NDEBUG_ANY);
#define check_offset() \ NCR_PRINT_PHASE(NDEBUG_ANY);
do { \
if (pos - buffer < offset - begin) { \ hostdata = (struct NCR5380_hostdata *)instance->hostdata;
begin += pos - buffer; \
pos = buffer; \ printk("\nNCR5380 core release=%d.\n", NCR5380_PUBLIC_RELEASE);
} \ local_irq_save(flags);
} while (0) printk("NCR5380: coroutine is%s running.\n",
main_running ? "" : "n't");
hostdata = (struct NCR5380_hostdata *)instance->hostdata; if (!hostdata->connected)
printk("scsi%d: no currently connected command\n", HOSTNO);
if (inout) { /* Has data been written to the file ? */ else
return(-ENOSYS); /* Currently this is a no-op */ lprint_Scsi_Cmnd((Scsi_Cmnd *) hostdata->connected);
} printk("scsi%d: issue_queue\n", HOSTNO);
SPRINTF("NCR5380 core release=%d.\n", NCR5380_PUBLIC_RELEASE); for (ptr = (Scsi_Cmnd *)hostdata->issue_queue; ptr; ptr = NEXT(ptr))
check_offset(); lprint_Scsi_Cmnd(ptr);
local_irq_save(flags);
SPRINTF("NCR5380: coroutine is%s running.\n", main_running ? "" : "n't"); printk("scsi%d: disconnected_queue\n", HOSTNO);
check_offset(); for (ptr = (Scsi_Cmnd *) hostdata->disconnected_queue; ptr;
if (!hostdata->connected) ptr = NEXT(ptr))
SPRINTF("scsi%d: no currently connected command\n", HOSTNO); lprint_Scsi_Cmnd(ptr);
else
pos = lprint_Scsi_Cmnd ((struct scsi_cmnd *) hostdata->connected,
pos, buffer, length);
SPRINTF("scsi%d: issue_queue\n", HOSTNO);
check_offset();
for (ptr = (struct scsi_cmnd *) hostdata->issue_queue; ptr; ptr = NEXT(ptr))
{
pos = lprint_Scsi_Cmnd (ptr, pos, buffer, length);
check_offset();
}
SPRINTF("scsi%d: disconnected_queue\n", HOSTNO);
check_offset();
for (ptr = (struct scsi_cmnd *) hostdata->disconnected_queue; ptr;
ptr = NEXT(ptr)) {
pos = lprint_Scsi_Cmnd (ptr, pos, buffer, length);
check_offset();
}
local_irq_restore(flags); local_irq_restore(flags);
*start = buffer + (offset - begin); printk("\n");
if (pos - buffer < offset - begin)
return 0;
else if (pos - buffer - (offset - begin) < length)
return pos - buffer - (offset - begin);
return length;
} }
static char *lprint_Scsi_Cmnd(struct scsi_cmnd *cmd, char *pos, char *buffer, static void show_Scsi_Cmnd(Scsi_Cmnd *cmd, struct seq_file *m)
int length)
{ {
int i, s; int i, s;
unsigned char *command; unsigned char *command;
SPRINTF("scsi%d: destination target %d, lun %d\n", seq_printf(m, "scsi%d: destination target %d, lun %d\n",
H_NO(cmd), cmd->device->id, cmd->device->lun); H_NO(cmd), cmd->device->id, cmd->device->lun);
SPRINTF(" command = "); seq_printf(m, " command = ");
command = cmd->cmnd; command = cmd->cmnd;
SPRINTF("%2d (0x%02x)", command[0], command[0]); seq_printf(m, "%2d (0x%02x)", command[0], command[0]);
for (i = 1, s = COMMAND_SIZE(command[0]); i < s; ++i) for (i = 1, s = COMMAND_SIZE(command[0]); i < s; ++i)
SPRINTF(" %02x", command[i]); seq_printf(m, " %02x", command[i]);
SPRINTF("\n"); seq_printf(m, "\n");
return pos;
} }
static int NCR5380_show_info(struct seq_file *m, struct Scsi_Host *instance)
{
struct NCR5380_hostdata *hostdata;
Scsi_Cmnd *ptr;
unsigned long flags;
hostdata = (struct NCR5380_hostdata *)instance->hostdata;
seq_printf(m, "NCR5380 core release=%d.\n", NCR5380_PUBLIC_RELEASE);
local_irq_save(flags);
seq_printf(m, "NCR5380: coroutine is%s running.\n",
main_running ? "" : "n't");
if (!hostdata->connected)
seq_printf(m, "scsi%d: no currently connected command\n", HOSTNO);
else
show_Scsi_Cmnd((Scsi_Cmnd *) hostdata->connected, m);
seq_printf(m, "scsi%d: issue_queue\n", HOSTNO);
for (ptr = (Scsi_Cmnd *)hostdata->issue_queue; ptr; ptr = NEXT(ptr))
show_Scsi_Cmnd(ptr, m);
seq_printf(m, "scsi%d: disconnected_queue\n", HOSTNO);
for (ptr = (Scsi_Cmnd *) hostdata->disconnected_queue; ptr;
ptr = NEXT(ptr))
show_Scsi_Cmnd(ptr, m);
local_irq_restore(flags);
return 0;
}
/* /*
* Function : void NCR5380_init (struct Scsi_Host *instance) * Function : void NCR5380_init (struct Scsi_Host *instance)
......
...@@ -626,6 +626,7 @@ static int sun3scsi_dma_finish(int write_flag) ...@@ -626,6 +626,7 @@ static int sun3scsi_dma_finish(int write_flag)
#include "sun3_NCR5380.c" #include "sun3_NCR5380.c"
static struct scsi_host_template driver_template = { static struct scsi_host_template driver_template = {
.show_info = sun3scsi_show_info,
.name = SUN3_SCSI_NAME, .name = SUN3_SCSI_NAME,
.detect = sun3scsi_detect, .detect = sun3scsi_detect,
.release = sun3scsi_release, .release = sun3scsi_release,
......
...@@ -100,7 +100,7 @@ static int sun3scsi_release (struct Scsi_Host *); ...@@ -100,7 +100,7 @@ static int sun3scsi_release (struct Scsi_Host *);
#define NCR5380_queue_command sun3scsi_queue_command #define NCR5380_queue_command sun3scsi_queue_command
#define NCR5380_bus_reset sun3scsi_bus_reset #define NCR5380_bus_reset sun3scsi_bus_reset
#define NCR5380_abort sun3scsi_abort #define NCR5380_abort sun3scsi_abort
#define NCR5380_proc_info sun3scsi_proc_info #define NCR5380_show_info sun3scsi_show_info
#define NCR5380_dma_xfer_len(i, cmd, phase) \ #define NCR5380_dma_xfer_len(i, cmd, phase) \
sun3scsi_dma_xfer_len(cmd->SCp.this_residual,cmd,((phase) & SR_IO) ? 0 : 1) sun3scsi_dma_xfer_len(cmd->SCp.this_residual,cmd,((phase) & SR_IO) ? 0 : 1)
......
...@@ -67,8 +67,6 @@ int compat_printk(const char *fmt, ...) ...@@ -67,8 +67,6 @@ int compat_printk(const char *fmt, ...)
return ret; return ret;
} }
#include "read_write.h"
/* /*
* Not all architectures have sys_utime, so implement this in terms * Not all architectures have sys_utime, so implement this in terms
* of sys_utimes. * of sys_utimes.
......
...@@ -608,7 +608,6 @@ struct serial_struct32 { ...@@ -608,7 +608,6 @@ struct serial_struct32 {
static int serial_struct_ioctl(unsigned fd, unsigned cmd, static int serial_struct_ioctl(unsigned fd, unsigned cmd,
struct serial_struct32 __user *ss32) struct serial_struct32 __user *ss32)
{ {
typedef struct serial_struct SS;
typedef struct serial_struct32 SS32; typedef struct serial_struct32 SS32;
int err; int err;
struct serial_struct ss; struct serial_struct ss;
......
...@@ -654,10 +654,11 @@ void do_coredump(siginfo_t *siginfo) ...@@ -654,10 +654,11 @@ void do_coredump(siginfo_t *siginfo)
goto close_fail; goto close_fail;
if (displaced) if (displaced)
put_files_struct(displaced); put_files_struct(displaced);
file_start_write(cprm.file); if (!dump_interrupted()) {
core_dumped = !dump_interrupted() && binfmt->core_dump(&cprm); file_start_write(cprm.file);
file_end_write(cprm.file); core_dumped = binfmt->core_dump(&cprm);
file_end_write(cprm.file);
}
if (ispipe && core_pipe_limit) if (ispipe && core_pipe_limit)
wait_for_dump_helpers(cprm.file); wait_for_dump_helpers(cprm.file);
close_fail: close_fail:
......
...@@ -337,23 +337,6 @@ static void dentry_lru_del(struct dentry *dentry) ...@@ -337,23 +337,6 @@ static void dentry_lru_del(struct dentry *dentry)
} }
} }
/*
* Remove a dentry that is unreferenced and about to be pruned
* (unhashed and destroyed) from the LRU, and inform the file system.
* This wrapper should be called _prior_ to unhashing a victim dentry.
*/
static void dentry_lru_prune(struct dentry *dentry)
{
if (!list_empty(&dentry->d_lru)) {
if (dentry->d_flags & DCACHE_OP_PRUNE)
dentry->d_op->d_prune(dentry);
spin_lock(&dcache_lru_lock);
__dentry_lru_del(dentry);
spin_unlock(&dcache_lru_lock);
}
}
static void dentry_lru_move_list(struct dentry *dentry, struct list_head *list) static void dentry_lru_move_list(struct dentry *dentry, struct list_head *list)
{ {
spin_lock(&dcache_lru_lock); spin_lock(&dcache_lru_lock);
...@@ -486,11 +469,13 @@ static inline struct dentry *dentry_kill(struct dentry *dentry, int ref) ...@@ -486,11 +469,13 @@ static inline struct dentry *dentry_kill(struct dentry *dentry, int ref)
if (ref) if (ref)
dentry->d_count--; dentry->d_count--;
/* /*
* if dentry was on the d_lru list delete it from there.
* inform the fs via d_prune that this dentry is about to be * inform the fs via d_prune that this dentry is about to be
* unhashed and destroyed. * unhashed and destroyed.
*/ */
dentry_lru_prune(dentry); if (dentry->d_flags & DCACHE_OP_PRUNE)
dentry->d_op->d_prune(dentry);
dentry_lru_del(dentry);
/* if it was on the hash then remove it */ /* if it was on the hash then remove it */
__d_drop(dentry); __d_drop(dentry);
return d_kill(dentry, parent); return d_kill(dentry, parent);
...@@ -919,11 +904,13 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry) ...@@ -919,11 +904,13 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry)
struct inode *inode; struct inode *inode;
/* /*
* remove the dentry from the lru, and inform * inform the fs that this dentry is about to be
* the fs that this dentry is about to be
* unhashed and destroyed. * unhashed and destroyed.
*/ */
dentry_lru_prune(dentry); if (dentry->d_flags & DCACHE_OP_PRUNE)
dentry->d_op->d_prune(dentry);
dentry_lru_del(dentry);
__d_shrink(dentry); __d_shrink(dentry);
if (dentry->d_count != 0) { if (dentry->d_count != 0) {
...@@ -2410,8 +2397,7 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon) ...@@ -2410,8 +2397,7 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon)
dentry->d_parent = dentry; dentry->d_parent = dentry;
list_del_init(&dentry->d_u.d_child); list_del_init(&dentry->d_u.d_child);
anon->d_parent = dparent; anon->d_parent = dparent;
list_del(&anon->d_u.d_child); list_move(&anon->d_u.d_child, &dparent->d_subdirs);
list_add(&anon->d_u.d_child, &dparent->d_subdirs);
write_seqcount_end(&dentry->d_seq); write_seqcount_end(&dentry->d_seq);
write_seqcount_end(&anon->d_seq); write_seqcount_end(&anon->d_seq);
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
*/ */
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/magic.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/pagemap.h> #include <linux/pagemap.h>
...@@ -45,8 +46,6 @@ static const struct dentry_operations hostfs_dentry_ops = { ...@@ -45,8 +46,6 @@ static const struct dentry_operations hostfs_dentry_ops = {
static char *root_ino = ""; static char *root_ino = "";
static int append = 0; static int append = 0;
#define HOSTFS_SUPER_MAGIC 0x00c0ffee
static const struct inode_operations hostfs_iops; static const struct inode_operations hostfs_iops;
static const struct inode_operations hostfs_dir_iops; static const struct inode_operations hostfs_dir_iops;
static const struct inode_operations hostfs_link_iops; static const struct inode_operations hostfs_link_iops;
...@@ -121,7 +120,7 @@ static char *dentry_name(struct dentry *dentry) ...@@ -121,7 +120,7 @@ static char *dentry_name(struct dentry *dentry)
if (!name) if (!name)
return NULL; return NULL;
return __dentry_name(dentry, name); /* will unlock */ return __dentry_name(dentry, name);
} }
static char *inode_name(struct inode *ino) static char *inode_name(struct inode *ino)
...@@ -229,10 +228,11 @@ static struct inode *hostfs_alloc_inode(struct super_block *sb) ...@@ -229,10 +228,11 @@ static struct inode *hostfs_alloc_inode(struct super_block *sb)
{ {
struct hostfs_inode_info *hi; struct hostfs_inode_info *hi;
hi = kzalloc(sizeof(*hi), GFP_KERNEL); hi = kmalloc(sizeof(*hi), GFP_KERNEL);
if (hi == NULL) if (hi == NULL)
return NULL; return NULL;
hi->fd = -1; hi->fd = -1;
hi->mode = 0;
inode_init_once(&hi->vfs_inode); inode_init_once(&hi->vfs_inode);
return &hi->vfs_inode; return &hi->vfs_inode;
} }
......
...@@ -2284,12 +2284,11 @@ long do_mount(const char *dev_name, const char *dir_name, ...@@ -2284,12 +2284,11 @@ long do_mount(const char *dev_name, const char *dir_name,
retval = security_sb_mount(dev_name, &path, retval = security_sb_mount(dev_name, &path,
type_page, flags, data_page); type_page, flags, data_page);
if (!retval && !may_mount())
retval = -EPERM;
if (retval) if (retval)
goto dput_out; goto dput_out;
if (!may_mount())
return -EPERM;
/* Default to relatime unless overriden */ /* Default to relatime unless overriden */
if (!(flags & MS_NOATIME)) if (!(flags & MS_NOATIME))
mnt_flags |= MNT_RELATIME; mnt_flags |= MNT_RELATIME;
...@@ -2464,7 +2463,7 @@ static struct mnt_namespace *create_mnt_ns(struct vfsmount *m) ...@@ -2464,7 +2463,7 @@ static struct mnt_namespace *create_mnt_ns(struct vfsmount *m)
struct mount *mnt = real_mount(m); struct mount *mnt = real_mount(m);
mnt->mnt_ns = new_ns; mnt->mnt_ns = new_ns;
new_ns->root = mnt; new_ns->root = mnt;
list_add(&new_ns->list, &mnt->mnt_list); list_add(&mnt->mnt_list, &new_ns->list);
} else { } else {
mntput(m); mntput(m);
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <linux/stat.h> #include <linux/stat.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/module.h> #include <linux/export.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
......
...@@ -16,12 +16,15 @@ ...@@ -16,12 +16,15 @@
#include <linux/pagemap.h> #include <linux/pagemap.h>
#include <linux/splice.h> #include <linux/splice.h>
#include <linux/compat.h> #include <linux/compat.h>
#include "read_write.h"
#include "internal.h" #include "internal.h"
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/unistd.h> #include <asm/unistd.h>
typedef ssize_t (*io_fn_t)(struct file *, char __user *, size_t, loff_t *);
typedef ssize_t (*iov_fn_t)(struct kiocb *, const struct iovec *,
unsigned long, loff_t);
const struct file_operations generic_ro_fops = { const struct file_operations generic_ro_fops = {
.llseek = generic_file_llseek, .llseek = generic_file_llseek,
.read = do_sync_read, .read = do_sync_read,
......
/*
* This file is only for sharing some helpers from read_write.c with compat.c.
* Don't use anywhere else.
*/
typedef ssize_t (*io_fn_t)(struct file *, char __user *, size_t, loff_t *);
typedef ssize_t (*iov_fn_t)(struct kiocb *, const struct iovec *,
unsigned long, loff_t);
...@@ -2227,6 +2227,13 @@ static inline void file_start_write(struct file *file) ...@@ -2227,6 +2227,13 @@ static inline void file_start_write(struct file *file)
__sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, true); __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, true);
} }
static inline bool file_start_write_trylock(struct file *file)
{
if (!S_ISREG(file_inode(file)->i_mode))
return true;
return __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, false);
}
static inline void file_end_write(struct file *file) static inline void file_end_write(struct file *file)
{ {
if (!S_ISREG(file_inode(file)->i_mode)) if (!S_ISREG(file_inode(file)->i_mode))
......
...@@ -87,7 +87,6 @@ static inline void nubus_proc_init(void) {} ...@@ -87,7 +87,6 @@ static inline void nubus_proc_init(void) {}
#endif #endif
int get_nubus_list(char *buf); int get_nubus_list(char *buf);
int nubus_proc_attach_device(struct nubus_dev *dev); int nubus_proc_attach_device(struct nubus_dev *dev);
int nubus_proc_detach_device(struct nubus_dev *dev);
/* If we need more precision we can add some more of these */ /* If we need more precision we can add some more of these */
struct nubus_dev* nubus_find_device(unsigned short category, struct nubus_dev* nubus_find_device(unsigned short category,
unsigned short type, unsigned short type,
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#define JFFS2_SUPER_MAGIC 0x72b6 #define JFFS2_SUPER_MAGIC 0x72b6
#define PSTOREFS_MAGIC 0x6165676C #define PSTOREFS_MAGIC 0x6165676C
#define EFIVARFS_MAGIC 0xde5e81e4 #define EFIVARFS_MAGIC 0xde5e81e4
#define HOSTFS_SUPER_MAGIC 0x00c0ffee
#define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */ #define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */
#define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */ #define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */
......
...@@ -539,11 +539,16 @@ static void do_acct_process(struct bsd_acct_struct *acct, ...@@ -539,11 +539,16 @@ static void do_acct_process(struct bsd_acct_struct *acct,
ac.ac_rw = encode_comp_t(ac.ac_io / 1024); ac.ac_rw = encode_comp_t(ac.ac_io / 1024);
ac.ac_swaps = encode_comp_t(0); ac.ac_swaps = encode_comp_t(0);
/*
* Get freeze protection. If the fs is frozen, just skip the write
* as we could deadlock the system otherwise.
*/
if (!file_start_write_trylock(file))
goto out;
/* /*
* Kernel segment override to datasegment and write it * Kernel segment override to datasegment and write it
* to the accounting file. * to the accounting file.
*/ */
file_start_write(file);
fs = get_fs(); fs = get_fs();
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment