Commit 47844733 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.55pre1

parent 12e35fae
......@@ -138,9 +138,9 @@ L: linux-net@vger.rutgers.edu
S: Maintained
APPLETALK NETWORK LAYER
P: Alan Cox & University Of Michigan
M: net-patches@lxorguk.ukuu.org.uk
L: netatalk@umich.edu
P: Jay Schulist
M: Jay.Schulist@spacs.k12.wi.us
L: linux-atalk@netspace.org
S: Maintained
DECnet NETWORK LAYER
......
......@@ -149,8 +149,6 @@ CONFIG_SCSI_OMIT_FLASHPOINT=y
# CONFIG_SCSI_T128 is not set
# CONFIG_SCSI_U14_34F is not set
# CONFIG_SCSI_ULTRASTOR is not set
# CONFIG_SCSI_MESH is not set
# CONFIG_SCSI_MAC53C94 is not set
#
# Network device support
......@@ -240,7 +238,6 @@ CONFIG_82C710_MOUSE=y
# CONFIG_APM is not set
# CONFIG_WATCHDOG is not set
# CONFIG_RTC is not set
# CONFIG_H8 is not set
# CONFIG_NVRAM is not set
# CONFIG_JOYSTICK is not set
......
......@@ -373,7 +373,7 @@ ENTRY(sys_call_table)
.long SYMBOL_NAME(sys_mknod)
.long SYMBOL_NAME(sys_chmod) /* 15 */
.long SYMBOL_NAME(sys_chown)
.long SYMBOL_NAME(sys_break)
.long 0 /* old break syscall holder */
.long SYMBOL_NAME(sys_stat)
.long SYMBOL_NAME(sys_lseek)
.long SYMBOL_NAME(sys_getpid) /* 20 */
......@@ -387,11 +387,11 @@ ENTRY(sys_call_table)
.long SYMBOL_NAME(sys_fstat)
.long SYMBOL_NAME(sys_pause)
.long SYMBOL_NAME(sys_utime) /* 30 */
.long SYMBOL_NAME(sys_stty)
.long SYMBOL_NAME(sys_gtty)
.long 0 /* old stty syscall holder */
.long 0 /* old gtty syscall holder */
.long SYMBOL_NAME(sys_access)
.long SYMBOL_NAME(sys_nice)
.long SYMBOL_NAME(sys_ftime) /* 35 */
.long 0 /* 35 */ /* old ftime syscall holder */
.long SYMBOL_NAME(sys_sync)
.long SYMBOL_NAME(sys_kill)
.long SYMBOL_NAME(sys_rename)
......@@ -400,7 +400,7 @@ ENTRY(sys_call_table)
.long SYMBOL_NAME(sys_dup)
.long SYMBOL_NAME(sys_pipe)
.long SYMBOL_NAME(sys_times)
.long SYMBOL_NAME(sys_prof)
.long 0 /* old prof syscall holder */
.long SYMBOL_NAME(sys_brk) /* 45 */
.long SYMBOL_NAME(sys_setgid)
.long SYMBOL_NAME(sys_getgid)
......@@ -408,13 +408,13 @@ ENTRY(sys_call_table)
.long SYMBOL_NAME(sys_geteuid)
.long SYMBOL_NAME(sys_getegid) /* 50 */
.long SYMBOL_NAME(sys_acct)
.long SYMBOL_NAME(sys_phys)
.long SYMBOL_NAME(sys_lock)
.long 0 /* old phys syscall holder */
.long 0 /* old lock syscall holder */
.long SYMBOL_NAME(sys_ioctl)
.long SYMBOL_NAME(sys_fcntl) /* 55 */
.long SYMBOL_NAME(sys_mpx)
.long 0 /* old mpx syscall holder */
.long SYMBOL_NAME(sys_setpgid)
.long SYMBOL_NAME(sys_ulimit)
.long 0 /* old ulimit syscall holder */
.long SYMBOL_NAME(sys_olduname)
.long SYMBOL_NAME(sys_umask) /* 60 */
.long SYMBOL_NAME(sys_chroot)
......@@ -454,7 +454,7 @@ ENTRY(sys_call_table)
.long SYMBOL_NAME(sys_fchown) /* 95 */
.long SYMBOL_NAME(sys_getpriority)
.long SYMBOL_NAME(sys_setpriority)
.long SYMBOL_NAME(sys_profil)
.long 0 /* old profil syscall holder */
.long SYMBOL_NAME(sys_statfs)
.long SYMBOL_NAME(sys_fstatfs) /* 100 */
.long SYMBOL_NAME(sys_ioperm)
......
......@@ -85,7 +85,7 @@ extern void update_one_process( struct task_struct *p,
* 5AP. Remote read is never used
* 9AP. XXX NEED TO CHECK WE HANDLE THIS XXX
* 10AP. XXX NEED TO CHECK WE HANDLE THIS XXX
* 11AP. Linux read the APIC between writes to avoid this, as per
* 11AP. Linux reads the APIC between writes to avoid this, as per
* the documentation. Make sure you preserve this as it affects
* the C stepping chips too.
*
......@@ -887,10 +887,14 @@ __initfunc(void smp_boot_cpus(void))
/*
* Initialize the logical to physical cpu number mapping
* and the per-CPU profiling counter/multiplier
*/
for (i = 0; i < NR_CPUS; i++)
for (i = 0; i < NR_CPUS; i++) {
cpu_number_map[i] = -1;
prof_counter[i] = 1;
prof_multiplier[i] = 1;
}
/*
* Setup boot CPU information
......@@ -917,15 +921,8 @@ __initfunc(void smp_boot_cpus(void))
* of here now!
*/
if (!smp_found_config) {
/*
* For SMP-simulation on one CPU to work, we must initialize these
* values for the single CPU here:
*/
prof_counter[0] = prof_multiplier[0] = 1;
if (!smp_found_config)
return;
}
/*
* Map the local APIC into kernel space
......@@ -1625,7 +1622,6 @@ static unsigned int calibration_result;
__initfunc(void setup_APIC_clock (void))
{
int cpu = smp_processor_id();
unsigned long flags;
static volatile int calibration_lock;
......@@ -1658,11 +1654,10 @@ __initfunc(void setup_APIC_clock (void))
}
/*
* Now set up the timer for real. Profiling multiplier is 1.
* Now set up the timer for real.
*/
setup_APIC_timer (calibration_result);
prof_counter[cpu] = prof_multiplier[cpu] = 1;
setup_APIC_timer (calibration_result);
/*
* We ACK the APIC, just in case there is something pending.
......
......@@ -17,6 +17,7 @@
#include <linux/stat.h>
#include <linux/mman.h>
#include <linux/file.h>
#include <linux/utsname.h>
#include <asm/uaccess.h>
#include <asm/ipc.h>
......@@ -203,3 +204,45 @@ asmlinkage int sys_ipc (uint call, int first, int second, int third, void *ptr,
unlock_kernel();
return ret;
}
/*
* Old cruft
*/
asmlinkage int sys_uname(struct old_utsname * name)
{
if (name && !copy_to_user(name, &system_utsname, sizeof (*name)))
return 0;
return -EFAULT;
}
asmlinkage int sys_olduname(struct oldold_utsname * name)
{
int error;
if (!name)
return -EFAULT;
if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
return -EFAULT;
error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN);
error -= __put_user(0,name->sysname+__OLD_UTS_LEN);
error -= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN);
error -= __put_user(0,name->nodename+__OLD_UTS_LEN);
error -= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN);
error -= __put_user(0,name->release+__OLD_UTS_LEN);
error -= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN);
error -= __put_user(0,name->version+__OLD_UTS_LEN);
error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN);
error = __put_user(0,name->machine+__OLD_UTS_LEN);
error = error ? -EFAULT : 0;
return error;
}
asmlinkage int sys_pause(void)
{
current->state = TASK_INTERRUPTIBLE;
schedule();
return -ERESTARTNOHAND;
}
......@@ -104,7 +104,9 @@ if [ "$CONFIG_WATCHDOG" != "n" ]; then
tristate ' Acquire SBC Watchdog Timer' CONFIG_ACQUIRE_WDT
fi
bool 'Enhanced Real Time Clock Support' CONFIG_RTC
bool 'Tadpole ANA H8 Support' CONFIG_H8
if [ "$CONFIG_PPC" == "y" ]; then
bool 'Tadpole ANA H8 Support' CONFIG_H8
fi
tristate '/dev/nvram support' CONFIG_NVRAM
tristate 'PC joystick support' CONFIG_JOYSTICK
endmenu
......@@ -40,6 +40,10 @@
* is only incorrect by 30-60mS (vs. 1S previously) (Gabor J. Toth
* <jtoth@princeton.edu>); improve interaction between
* screen-blanking and gpm (Stephen Rothwell); Linux 1.99.4
* 1.2a:Simple change to stop mysterious bug reports with SMP also added
* levels to the printk calls. APM is not defined for SMP machines.
* The new replacment for it is, but Linux doesn't yet support this.
* Alan Cox Linux 2.1.55
*
* Reference:
*
......@@ -492,9 +496,9 @@ static void apm_error(char *str, int err)
for (i = 0; i < ERROR_COUNT; i++)
if (error_table[i].key == err) break;
if (i < ERROR_COUNT)
printk("apm_bios: %s: %s\n", str, error_table[i].msg);
printk(KERN_NOTICE "apm_bios: %s: %s\n", str, error_table[i].msg);
else
printk("apm_bios: %s: unknown error code %#2.2x\n", str, err);
printk(KERN_NOTICE "apm_bios: %s: unknown error code %#2.2x\n", str, err);
}
/* Called from console driver -- must make sure apm_enabled. */
......@@ -725,10 +729,10 @@ static void check_events(void)
}
#ifdef APM_DEBUG
if (event <= NR_APM_EVENT_NAME)
printk("APM BIOS received %s notify\n",
printk(KERN_DEBUG "APM BIOS received %s notify\n",
apm_event_name[event - 1]);
else
printk("APM BIOS received unknown event 0x%02x\n",
printk(KERN_DEBUG "APM BIOS received unknown event 0x%02x\n",
event);
#endif
}
......@@ -802,7 +806,7 @@ void apm_do_busy(void)
static int check_apm_bios_struct(struct apm_bios_struct *as, const char *func)
{
if ((as == NULL) || (as->magic != APM_BIOS_MAGIC)) {
printk("apm_bios: %s passed bad filp", func);
printk(KERN_ERR "apm_bios: %s passed bad filp", func);
return 1;
}
return 0;
......@@ -940,7 +944,7 @@ static int do_release(struct inode * inode, struct file * filp)
as1 = as1->next)
;
if (as1 == NULL)
printk("apm_bios: filp not in user list");
printk(KERN_ERR "apm_bios: filp not in user list");
else
as1->next = as->next;
}
......@@ -954,7 +958,7 @@ static int do_open(struct inode * inode, struct file * filp)
as = (struct apm_bios_struct *)kmalloc(sizeof(*as), GFP_KERNEL);
if (as == NULL) {
printk("apm_bios: cannot allocate struct of size %d bytes",
printk(KERN_ERR "apm_bios: cannot allocate struct of size %d bytes",
sizeof(*as));
return -ENOMEM;
}
......@@ -1070,17 +1074,21 @@ __initfunc(void apm_bios_init(void))
char * bat_stat;
static struct proc_dir_entry *ent;
#ifdef __SMP__
printk(KERN_NOTICE "APM disabled: APM is not SMP safe.\n");
return;
#endif
if (apm_bios_info.version == 0) {
printk("APM BIOS not found.\n");
printk(KERN_INFO "APM BIOS not found.\n");
return;
}
printk("APM BIOS version %c.%c Flags 0x%02x (Driver version %s)\n",
printk(KERN_INFO "APM BIOS version %c.%c Flags 0x%02x (Driver version %s)\n",
((apm_bios_info.version >> 8) & 0xff) + '0',
(apm_bios_info.version & 0xff) + '0',
apm_bios_info.flags,
driver_version);
if ((apm_bios_info.flags & APM_32_BIT_SUPPORT) == 0) {
printk(" No 32 bit BIOS support\n");
printk(KERN_INFO " No 32 bit BIOS support\n");
return;
}
......@@ -1091,7 +1099,7 @@ __initfunc(void apm_bios_init(void))
if (apm_bios_info.version == 0x001)
apm_bios_info.version = 0x100;
printk(" Entry %x:%lx cseg16 %x dseg %x",
printk(KERN_INFO " Entry %x:%lx cseg16 %x dseg %x",
apm_bios_info.cseg, apm_bios_info.offset,
apm_bios_info.cseg_16, apm_bios_info.dseg);
if (apm_bios_info.version > 0x100)
......@@ -1139,7 +1147,7 @@ __initfunc(void apm_bios_init(void))
error = apm_get_power_status(&bx, &cx, &dx);
if (error)
printk(" Power status not available\n");
printk(KERN_INFO " Power status not available\n");
else {
switch ((bx >> 8) & 0xff) {
case 0: power_stat = "off line"; break;
......@@ -1154,7 +1162,7 @@ __initfunc(void apm_bios_init(void))
case 3: bat_stat = "charging"; break;
default: bat_stat = "unknown"; break;
}
printk(" AC %s, battery status %s, battery life ",
printk(KERN_INFO " AC %s, battery status %s, battery life ",
power_stat, bat_stat);
if ((cx & 0xff) == 0xff)
printk("unknown\n");
......
......@@ -108,9 +108,11 @@ dep_tristate 'UltraStor 14F/34F support' CONFIG_SCSI_U14_34F $CONFIG_SCSI
fi
dep_tristate 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR $CONFIG_SCSI
#dep_tristate 'SCSI debugging host adapter' CONFIG_SCSI_DEBUG $CONFIG_SCSI
dep_tristate 'MESH (Power Mac internal SCSI) support' CONFIG_SCSI_MESH $CONFIG_SCSI
if [ "$CONFIG_SCSI_MESH" != "n" ]; then
int ' maximum synchronous transfer rate (MB/s) (0 = async)' CONFIG_SCSI_MESH_SYNC_RATE 5
if [ "$CONFIG_PPC" == "y" ]; then
dep_tristate 'MESH (Power Mac internal SCSI) support' CONFIG_SCSI_MESH $CONFIG_SCSI
if [ "$CONFIG_SCSI_MESH" != "n" ]; then
int ' maximum synchronous transfer rate (MB/s) (0 = async)' CONFIG_SCSI_MESH_SYNC_RATE 5
fi
dep_tristate '53C94 (Power Mac external SCSI) support' CONFIG_SCSI_MAC53C94 $CONFIG_SCSI
fi
dep_tristate '53C94 (Power Mac external SCSI) support' CONFIG_SCSI_MAC53C94 $CONFIG_SCSI
endmenu
......@@ -23,7 +23,7 @@
#include <linux/mm.h>
#include <linux/amigaffs.h>
static int affs_readdir(struct inode *, struct file *, void *, filldir_t);
static int affs_readdir(struct file *, void *, filldir_t);
static long affs_dir_read(struct inode * inode, struct file * filp, char * buf,
unsigned long count);
......@@ -69,7 +69,7 @@ affs_dir_read(struct inode *inode, struct file *filp, char *buf, unsigned long c
}
static int
affs_readdir(struct inode *inode, struct file *filp, void *dirent, filldir_t filldir)
affs_readdir(struct file *filp, void *dirent, filldir_t filldir)
{
int j, namelen;
s32 i;
......@@ -82,6 +82,7 @@ affs_readdir(struct inode *inode, struct file *filp, void *dirent, filldir_t fil
struct buffer_head *dir_bh;
struct buffer_head *fh_bh;
struct inode *dir;
struct inode *inode = file->f_dentry->d_inode;
pr_debug("AFFS: readdir(ino=%ld,f_pos=%lu)\n",inode->i_ino,filp->f_pos);
......
......@@ -12,9 +12,10 @@
#include "autofs_i.h"
static int autofs_dir_readdir(struct inode *inode, struct file *filp,
static int autofs_dir_readdir(struct file *filp,
void *dirent, filldir_t filldir)
{
struct inode *inode=filp->f_dentry->d_inode;
if (!inode || !S_ISDIR(inode->i_mode))
return -ENOTDIR;
......
......@@ -15,7 +15,7 @@
#include <linux/param.h>
#include "autofs_i.h"
static int autofs_root_readdir(struct inode *,struct file *,void *,filldir_t);
static int autofs_root_readdir(struct file *,void *,filldir_t);
static int autofs_root_lookup(struct inode *,struct dentry *);
static int autofs_root_symlink(struct inode *,struct dentry *,const char *);
static int autofs_root_unlink(struct inode *,struct dentry *);
......@@ -63,11 +63,11 @@ struct inode_operations autofs_root_inode_operations = {
NULL /* revalidate */
};
static int autofs_root_readdir(struct inode *inode, struct file *filp,
void *dirent, filldir_t filldir)
static int autofs_root_readdir(struct file *filp, void *dirent, filldir_t filldir)
{
struct autofs_dir_ent *ent;
struct autofs_dirhash *dirhash;
struct inode * inode = filp->f_dentry->d_inode;
off_t onr, nr;
if (!inode || !S_ISDIR(inode->i_mode))
......
......@@ -222,7 +222,7 @@ static void write_dquot(struct dquot *dquot)
{
short type = dquot->dq_type;
struct file *filp = dquot->dq_mnt->mnt_quotas[type];
unsigned short fs;
unsigned long fs;
if (!(dquot->dq_flags & DQ_MOD) || (filp == (struct file *)NULL))
return;
......@@ -254,7 +254,7 @@ static void read_dquot(struct dquot *dquot)
{
short type = dquot->dq_type;
struct file *filp = dquot->dq_mnt->mnt_quotas[type];
unsigned short fs;
unsigned long fs;
if (filp == (struct file *)NULL)
return;
......
......@@ -32,7 +32,7 @@ static long ext2_dir_read (struct inode * inode, struct file * filp,
return -EISDIR;
}
static int ext2_readdir (struct inode *, struct file *, void *, filldir_t);
static int ext2_readdir(struct file *, void *, filldir_t);
static struct file_operations ext2_dir_operations = {
NULL, /* lseek - default */
......@@ -101,7 +101,7 @@ int ext2_check_dir_entry (const char * function, struct inode * dir,
return error_msg == NULL ? 1 : 0;
}
static int ext2_readdir (struct inode * inode, struct file * filp,
static int ext2_readdir(struct file * filp,
void * dirent, filldir_t filldir)
{
int error = 0;
......@@ -111,6 +111,7 @@ static int ext2_readdir (struct inode * inode, struct file * filp,
struct ext2_dir_entry * de;
struct super_block * sb;
int err;
struct inode *inode = filp->f_dentry->d_inode;
if (!inode || !S_ISDIR(inode->i_mode))
return -EBADF;
......
......@@ -347,7 +347,7 @@ void ext2_truncate (struct inode * inode)
retry |= trunc_tindirect (inode);
if (!retry)
break;
if (IS_SYNC(inode) && test_bit(I_DIRTY, &inode->i_state))
if (IS_SYNC(inode) && (inode->i_state & I_DIRTY))
ext2_sync_inode (inode);
current->counter = 0;
schedule ();
......
......@@ -316,11 +316,11 @@ static int fat_filldir(
}
int fat_readdir(
struct inode *inode,
struct file *filp,
void *dirent,
filldir_t filldir)
{
struct inode *inode = filp->f_dentry->d_inode;
return fat_readdirx(inode, filp, dirent, fat_filldir, filldir,
0, 1, 0);
}
......
......@@ -189,7 +189,7 @@ static const struct inode_operations hpfs_file_iops =
static long hpfs_dir_read(struct inode *inode, struct file *filp,
char *buf, unsigned long count);
static int hpfs_readdir(struct inode *inode, struct file *filp,
static int hpfs_readdir(struct file *filp,
void *dirent, filldir_t filldir);
static int hpfs_lookup(struct inode *, struct dentry *);
......@@ -1362,7 +1362,7 @@ static void translate_hpfs_name(const unsigned char * from, int len, char * to,
}
}
static int hpfs_readdir(struct inode *inode, struct file *filp, void * dirent,
static int hpfs_readdir(struct file *filp, void * dirent,
filldir_t filldir)
{
struct quad_buffer_head qbh;
......@@ -1371,6 +1371,7 @@ static int hpfs_readdir(struct inode *inode, struct file *filp, void * dirent,
ino_t ino;
char * tempname;
long old_pos;
struct inode *inode = filp->f_dentry->d_inode;
if (inode == 0
|| inode->i_sb == 0
......
......@@ -43,7 +43,10 @@ static LIST_HEAD(inode_unused);
static struct list_head inode_hashtable[HASH_SIZE];
/*
* A simple spinlock to protect the list manipulations
* A simple spinlock to protect the list manipulations.
*
* NOTE! You also have to own the lock if you change
* the i_state of an inode while it is in use..
*/
spinlock_t inode_lock = SPIN_LOCK_UNLOCKED;
......@@ -67,18 +70,18 @@ void __mark_inode_dirty(struct inode *inode)
if (sb) {
spin_lock(&inode_lock);
list_del(&inode->i_list);
list_add(&inode->i_list, &sb->s_dirty);
if (!(inode->i_state & I_DIRTY)) {
inode->i_state |= I_DIRTY;
/* Only add valid (ie hashed) inodes to the dirty list */
if (!list_empty(&inode->i_hash)) {
list_del(&inode->i_list);
list_add(&inode->i_list, &sb->s_dirty);
}
}
spin_unlock(&inode_lock);
}
}
static inline void unlock_inode(struct inode *inode)
{
clear_bit(I_LOCK, &inode->i_state);
wake_up(&inode->i_wait);
}
static void __wait_on_inode(struct inode * inode)
{
struct wait_queue wait = { current, NULL };
......@@ -86,7 +89,7 @@ static void __wait_on_inode(struct inode * inode)
add_wait_queue(&inode->i_wait, &wait);
repeat:
current->state = TASK_UNINTERRUPTIBLE;
if (test_bit(I_LOCK, &inode->i_state)) {
if (inode->i_state & I_LOCK) {
schedule();
goto repeat;
}
......@@ -96,7 +99,7 @@ static void __wait_on_inode(struct inode * inode)
static inline void wait_on_inode(struct inode *inode)
{
if (test_bit(I_LOCK, &inode->i_state))
if (inode->i_state & I_LOCK)
__wait_on_inode(inode);
}
......@@ -146,31 +149,34 @@ static inline void write_inode(struct inode *inode)
inode->i_sb->s_op->write_inode(inode);
}
static inline void sync_one(struct list_head *head, struct list_head *clean,
struct list_head *placement, struct inode *inode)
static inline void sync_one(struct inode *inode)
{
list_del(placement);
if (test_bit(I_LOCK, &inode->i_state)) {
list_add(placement, head);
if (inode->i_state & I_LOCK) {
spin_unlock(&inode_lock);
__wait_on_inode(inode);
spin_lock(&inode_lock);
} else {
list_add(placement, clean);
clear_bit(I_DIRTY, &inode->i_state);
set_bit(I_LOCK, &inode->i_state);
list_del(&inode->i_list);
list_add(&inode->i_list, &inode_in_use);
/* Set I_LOCK, reset I_DIRTY */
inode->i_state ^= I_DIRTY | I_LOCK;
spin_unlock(&inode_lock);
write_inode(inode);
unlock_inode(inode);
spin_lock(&inode_lock);
inode->i_state &= ~I_LOCK;
wake_up(&inode->i_wait);
}
spin_lock(&inode_lock);
}
static inline void sync_list(struct list_head *head, struct list_head *clean)
static inline void sync_list(struct list_head *head)
{
struct list_head * tmp;
while ((tmp = head->prev) != head)
sync_one(head, clean, tmp, list_entry(tmp, struct inode, i_list));
sync_one(list_entry(tmp, struct inode, i_list));
}
/*
......@@ -192,7 +198,7 @@ void sync_inodes(kdev_t dev)
if (dev && sb->s_dev != dev)
continue;
sync_list(&sb->s_dirty, &inode_in_use);
sync_list(&sb->s_dirty);
if (dev)
break;
}
......@@ -208,9 +214,8 @@ void write_inode_now(struct inode *inode)
if (sb) {
spin_lock(&inode_lock);
if (test_bit(I_DIRTY, &inode->i_state))
sync_one(&sb->s_dirty, &inode_in_use, &inode->i_list,
inode);
if (inode->i_state & I_DIRTY)
sync_one(inode);
spin_unlock(&inode_lock);
}
else
......@@ -393,7 +398,6 @@ void clean_inode(struct inode *inode)
static inline void read_inode(struct inode *inode, struct super_block *sb)
{
sb->s_op->read_inode(inode);
unlock_inode(inode);
}
struct inode * get_empty_inode(void)
......@@ -451,10 +455,24 @@ static struct inode * get_new_inode(struct super_block *sb, unsigned long ino, s
inode->i_ino = ino;
inode->i_flags = sb->s_flags;
inode->i_count = 1;
inode->i_state = 1 << I_LOCK;
inode->i_state = I_LOCK;
spin_unlock(&inode_lock);
clean_inode(inode);
read_inode(inode, sb);
/*
* This is special! We do not need the spinlock
* when clearing I_LOCK, because we're guaranteed
* that nobody else tries to do anything about the
* state of the inode when it is locked, as we
* just created it (so there can be no old holders
* that haven't tested I_LOCK).
*
* Verify this some day!
*/
inode->i_state &= ~I_LOCK;
return inode;
}
......
......@@ -23,7 +23,7 @@
#include <asm/uaccess.h>
static int isofs_readdir(struct inode *, struct file *, void *, filldir_t);
static int isofs_readdir(struct file *, void *, filldir_t);
static struct file_operations isofs_dir_operations =
{
......@@ -241,12 +241,13 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
* handling split directory entries.. The real work is done by
* "do_isofs_readdir()".
*/
static int isofs_readdir(struct inode *inode, struct file *filp,
static int isofs_readdir(struct file *filp,
void *dirent, filldir_t filldir)
{
int result;
char * tmpname;
struct iso_directory_record * tmpde;
struct inode *inode = filp->f_dentry->d_inode;
if (!inode || !S_ISDIR(inode->i_mode))
return -EBADF;
......
......@@ -20,7 +20,7 @@ static long minix_dir_read(struct inode * inode, struct file * filp,
return -EISDIR;
}
static int minix_readdir(struct inode *, struct file *, void *, filldir_t);
static int minix_readdir(struct file *, void *, filldir_t);
static struct file_operations minix_dir_operations = {
NULL, /* lseek - default */
......@@ -58,13 +58,14 @@ struct inode_operations minix_dir_inode_operations = {
NULL /* permission */
};
static int minix_readdir(struct inode * inode, struct file * filp,
static int minix_readdir(struct file * filp,
void * dirent, filldir_t filldir)
{
unsigned int offset;
struct buffer_head * bh;
struct minix_dir_entry * de;
struct minix_sb_info * info;
struct inode *inode = filp->f_dentry->d_inode;
if (!inode || !inode->i_sb || !S_ISDIR(inode->i_mode))
return -EBADF;
......
......@@ -31,7 +31,7 @@ static long
ncp_dir_read(struct inode *inode, struct file *filp, char *buf, unsigned long count);
static int
ncp_readdir(struct inode *inode, struct file *filp,
ncp_readdir(struct file *filp,
void *dirent, filldir_t filldir);
static int
......@@ -210,12 +210,13 @@ static inline void ncp_unlock_dircache(void)
wake_up(&c_wait);
}
static int ncp_readdir(struct inode *inode, struct file *filp,
static int ncp_readdir(struct file *filp,
void *dirent, filldir_t filldir)
{
int result = 0;
int i = 0;
int index = 0;
struct inode *inode = file->f_dentry->d_inode;
struct ncp_dirent *entry = NULL;
struct ncp_server *server = NCP_SERVER(inode);
struct ncp_inode_info *dir = NCP_INOP(inode);
......
......@@ -38,7 +38,7 @@ static unsigned long ncp_file_mmap_nopage(struct vm_area_struct *area,
unsigned long tmp;
int bufsize;
int pos;
unsigned short fs;
unsigned long fs;
page = __get_free_page(GFP_KERNEL);
if (!page)
......
......@@ -82,7 +82,7 @@ static int do_ncp_rpc_call(struct ncp_server *server, int size)
struct file *file;
struct inode *inode;
struct socket *sock;
unsigned short fs;
unsigned long fs;
int result;
char *start = server->packet;
poll_table wait_table;
......
......@@ -48,7 +48,7 @@ struct nfs_dirent {
static int nfs_dir_open(struct inode * inode, struct file * file);
static long nfs_dir_read(struct inode *, struct file *, char *, unsigned long);
static int nfs_readdir(struct inode *, struct file *, void *, filldir_t);
static int nfs_readdir(struct file *, void *, filldir_t);
static int nfs_lookup(struct inode *, struct dentry *);
static int nfs_create(struct inode *, struct dentry *, int);
static int nfs_mkdir(struct inode *, struct dentry *, int);
......@@ -121,9 +121,7 @@ static struct nfs_dirent dircache[NFS_MAX_DIRCACHE];
* page cache (may require some fiddling for rsize < PAGE_SIZE).
*/
static int
nfs_readdir(struct inode *inode, struct file *filp, void *dirent,
filldir_t filldir)
static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
{
static struct wait_queue *readdir_wait = NULL;
struct wait_queue **waitp = NULL;
......@@ -133,6 +131,7 @@ nfs_readdir(struct inode *inode, struct file *filp, void *dirent,
u32 cookie;
int ismydir, result;
int i, j, index = 0;
struct inode *inode = filp->f_dentry->d_inode;
dfprintk(VFS, "NFS: nfs_readdir(%x/%ld)\n", inode->i_dev, inode->i_ino);
if (!inode || !S_ISDIR(inode->i_mode)) {
......
......@@ -476,7 +476,7 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
#endif
}
if (test_bit(I_DIRTY, &inode->i_state)) {
if (inode->i_state & I_DIRTY) {
dprintk("nfsd: write sync %d\n", current->pid);
nfsd_sync(inode, &file);
write_inode_now(inode);
......@@ -928,8 +928,7 @@ nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
file.f_inode->i_dev, file.f_inode->i_ino,
(int) file.f_pos, (int) oldlen, (int) cd.buflen);
*/
err = file.f_op->readdir(inode, &file,
&cd, (filldir_t) func);
err = file.f_op->readdir(&file, &cd, (filldir_t) func);
if (err < 0) {
nfsd_close(&file);
......
......@@ -402,7 +402,7 @@ static struct inode * get_pipe_inode(void)
* list because "mark_inode_dirty()" will think
* that it already _is_ on the dirty list.
*/
inode->i_state = 1 << I_DIRTY;
inode->i_state = I_DIRTY;
inode->i_mode = S_IFIFO | S_IRUSR | S_IWUSR;
inode->i_uid = current->fsuid;
inode->i_gid = current->fsgid;
......
......@@ -13,7 +13,7 @@
#include <linux/proc_fs.h>
#include <linux/stat.h>
static int proc_readfd(struct inode *, struct file *, void *, filldir_t);
static int proc_readfd(struct file *, void *, filldir_t);
static int proc_lookupfd(struct inode *, struct dentry *);
static struct file_operations proc_fd_operations = {
......@@ -124,13 +124,14 @@ static int proc_lookupfd(struct inode * dir, struct dentry * dentry)
#define NUMBUF 10
static int proc_readfd(struct inode * inode, struct file * filp,
static int proc_readfd(struct file * filp,
void * dirent, filldir_t filldir)
{
char buf[NUMBUF];
struct task_struct * p, **tarrayp;
unsigned int fd, pid, ino;
unsigned long i,j;
struct inode *inode = filp->f_dentry->d_inode;
if (!inode || !S_ISDIR(inode->i_mode))
return -EBADF;
......
......@@ -23,7 +23,7 @@
*/
#define FIRST_PROCESS_ENTRY 256
static int proc_root_readdir(struct inode *, struct file *, void *, filldir_t);
static int proc_root_readdir(struct file *, void *, filldir_t);
static int proc_root_lookup(struct inode *,struct dentry *);
static unsigned char proc_alloc_map[PROC_NDYNAMIC / 8] = {0};
......@@ -734,12 +734,13 @@ static int proc_root_lookup(struct inode * dir, struct dentry * dentry)
* value of the readdir() call, as long as it's non-negative
* for success..
*/
int proc_readdir(struct inode * inode, struct file * filp,
int proc_readdir(struct file * filp,
void * dirent, filldir_t filldir)
{
struct proc_dir_entry * de;
unsigned int ino;
int i;
struct inode *inode = filp->f_dentry->d_inode;
if (!inode || !S_ISDIR(inode->i_mode))
return -ENOTDIR;
......@@ -786,7 +787,7 @@ int proc_readdir(struct inode * inode, struct file * filp,
#define NUMBUF 10
static int proc_root_readdir(struct inode * inode, struct file * filp,
static int proc_root_readdir(struct file * filp,
void * dirent, filldir_t filldir)
{
struct task_struct *p;
......@@ -794,7 +795,7 @@ static int proc_root_readdir(struct inode * inode, struct file * filp,
unsigned int nr = filp->f_pos;
if (nr < FIRST_PROCESS_ENTRY) {
int error = proc_readdir(inode, filp, dirent, filldir);
int error = proc_readdir(filp, dirent, filldir);
if (error <= 0)
return error;
filp->f_pos = FIRST_PROCESS_ENTRY;
......
......@@ -87,7 +87,7 @@ asmlinkage int old_readdir(unsigned int fd, void * dirent, unsigned int count)
if (!file->f_op || !file->f_op->readdir)
goto out;
error = file->f_op->readdir(inode, file, &buf, fillonedir);
error = file->f_op->readdir(file, &buf, fillonedir);
if (error < 0)
goto out;
error = buf.count;
......@@ -173,7 +173,7 @@ asmlinkage int sys_getdents(unsigned int fd, void * dirent, unsigned int count)
if (!file->f_op || !file->f_op->readdir)
goto out;
error = file->f_op->readdir(inode, file, &buf, filldir);
error = file->f_op->readdir(file, &buf, filldir);
if (error < 0)
goto out;
lastdirent = buf.previous;
......
......@@ -261,8 +261,9 @@ romfs_copyfrom(struct inode *i, void *dest, unsigned long offset, unsigned long
}
static int
romfs_readdir(struct inode *i, struct file *filp, void *dirent, filldir_t filldir)
romfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
{
struct inode *i = filp->f_dentry->d_inode;
struct romfs_inode ri;
unsigned long offset, maxoff;
int j, ino, nextfh;
......
......@@ -24,8 +24,7 @@ smb_dir_read(struct inode *inode, struct file *filp,
char *buf, unsigned long count);
static int
smb_readdir(struct inode *inode, struct file *filp,
void *dirent, filldir_t filldir);
smb_readdir(struct file *filp, void *dirent, filldir_t filldir);
static int smb_lookup(struct inode *, struct dentry *);
static int smb_create(struct inode *, struct dentry *, int);
......@@ -105,9 +104,10 @@ smb_search_in_cache(struct inode *dir, unsigned long f_pos)
}
static int
smb_refill_dir_cache(struct inode *dir, unsigned long f_pos)
smb_refill_dir_cache(struct dentry *dentry, unsigned long f_pos)
{
int result;
struct inode *dir = dentry->d_inode;
static struct semaphore sem = MUTEX;
int i;
ino_t ino;
......@@ -115,7 +115,7 @@ smb_refill_dir_cache(struct inode *dir, unsigned long f_pos)
do
{
down(&sem);
result = smb_proc_readdir(dir, f_pos,
result = smb_proc_readdir(dentry, f_pos,
SMB_READDIR_CACHE_SIZE, c_entry);
if (result <= 0)
......@@ -142,10 +142,11 @@ smb_refill_dir_cache(struct inode *dir, unsigned long f_pos)
return result;
}
static int
smb_readdir(struct inode *dir, struct file *filp,
static int smb_readdir(struct file *filp,
void *dirent, filldir_t filldir)
{
struct dentry *dentry = filp->f_dentry;
struct inode *dir = dentry->d_inode;
int result, i = 0;
struct smb_dirent *entry = NULL;
......@@ -194,7 +195,7 @@ smb_readdir(struct inode *dir, struct file *filp,
/* End of directory */
return 0;
}
result = smb_refill_dir_cache(dir, filp->f_pos);
result = smb_refill_dir_cache(dentry, filp->f_pos);
if (result <= 0)
{
return result;
......@@ -266,7 +267,7 @@ smb_lookup(struct inode *dir, struct dentry *d_entry)
if (len > SMB_MAXNAMELEN)
return -ENAMETOOLONG;
error = smb_proc_getattr(dir, &(d_entry->d_name), &finfo);
error = smb_proc_getattr(d_entry, &(d_entry->d_name), &finfo);
inode = NULL;
if (!error) {
......@@ -297,7 +298,7 @@ static int smb_create(struct inode *dir, struct dentry *dentry, int mode)
if (dentry->d_name.len > SMB_MAXNAMELEN)
return -ENAMETOOLONG;
error = smb_proc_create(dir, &(dentry->d_name), 0, CURRENT_TIME);
error = smb_proc_create(dentry, &(dentry->d_name), 0, CURRENT_TIME);
if (error < 0)
return error;
......@@ -307,7 +308,7 @@ static int smb_create(struct inode *dir, struct dentry *dentry, int mode)
* state. Currently we close it directly again, although this
* is not necessary anymore. */
error = smb_proc_getattr(dir, &(dentry->d_name), &fattr);
error = smb_proc_getattr(dentry, &(dentry->d_name), &fattr);
if (error < 0)
return error;
......@@ -337,13 +338,13 @@ smb_mkdir(struct inode *dir, struct dentry *dentry, int mode)
if (dentry->d_name.len > SMB_MAXNAMELEN)
return -ENAMETOOLONG;
error = smb_proc_mkdir(dir, &(dentry->d_name));
error = smb_proc_mkdir(dentry, &(dentry->d_name));
if (error)
return error;
smb_invalid_dir_cache(dir->i_ino);
error = smb_proc_getattr(dir, &(dentry->d_name), &fattr);
error = smb_proc_getattr(dentry, &(dentry->d_name), &fattr);
if (error < 0)
return error;
......@@ -371,7 +372,7 @@ smb_rmdir(struct inode *dir, struct dentry *dentry)
if (dentry->d_name.len > NFS_MAXNAMLEN)
return -ENAMETOOLONG;
error = smb_proc_rmdir(dir, &(dentry->d_name));
error = smb_proc_rmdir(dentry, &(dentry->d_name));
if (error)
return error;
......@@ -393,7 +394,7 @@ smb_unlink(struct inode *dir, struct dentry *dentry)
if (dentry->d_name.len > SMB_MAXNAMELEN)
return -ENAMETOOLONG;
error = smb_proc_unlink(dir, &(dentry->d_name));
error = smb_proc_unlink(dentry, &(dentry->d_name));
if (error)
return error;
......@@ -424,18 +425,18 @@ static int smb_rename(struct inode *old_dir, struct dentry *old_dentry,
new_dentry->d_name.len > SMB_MAXNAMELEN)
return -ENAMETOOLONG;
error = smb_proc_mv(old_dir, &(old_dentry->d_name),
new_dir, &(new_dentry->d_name));
error = smb_proc_mv(old_dentry, &(old_dentry->d_name),
new_dentry, &(new_dentry->d_name));
if (error == -EEXIST)
{
error = smb_proc_unlink(old_dir, &(new_dentry->d_name));
error = smb_proc_unlink(old_dentry, &(new_dentry->d_name));
if (error)
return error;
error = smb_proc_mv(old_dir, &(old_dentry->d_name),
new_dir, &(new_dentry->d_name));
error = smb_proc_mv(old_dentry, &(old_dentry->d_name),
new_dentry, &(new_dentry->d_name));
}
if (error)
......
......@@ -98,12 +98,12 @@ static int smb_d_path(struct dentry * entry, char * buf)
}
static char *smb_encode_path(struct smb_sb_info *server, char *buf,
struct inode *dir, struct qstr *name)
struct dentry *dir, struct qstr *name)
{
char *start = buf;
if (dir != NULL)
buf += smb_d_path(i_dentry(dir), buf);
buf += smb_d_path(dir, buf);
if (name != NULL) {
*buf++ = '\\';
......@@ -510,8 +510,9 @@ smb_setup_bcc(struct smb_sb_info *server, __u8 * p)
*/
static int
smb_proc_open(struct inode *ino)
smb_proc_open(struct dentry *dir)
{
struct inode *ino = dir->d_inode;
struct smb_sb_info *server = SMB_SERVER(ino);
int error;
char *p;
......@@ -521,7 +522,7 @@ smb_proc_open(struct inode *ino)
WSET(server->packet, smb_vwv0, 0x42); /* read/write */
WSET(server->packet, smb_vwv1, aSYSTEM | aHIDDEN | aDIR);
*p++ = 4;
p = smb_encode_path(server, p, ino, NULL);
p = smb_encode_path(server, p, dir, NULL);
smb_setup_bcc(server, p);
if ((error = smb_request_ok(server, SMBopen, 7, 0)) != 0)
......@@ -537,7 +538,7 @@ smb_proc_open(struct inode *ino)
WSET(server->packet, smb_vwv0, 0x40); /* read only */
WSET(server->packet, smb_vwv1, aSYSTEM | aHIDDEN | aDIR);
*p++ = 4;
p = smb_encode_path(server, p, ino, NULL);
p = smb_encode_path(server, p, dir, NULL);
smb_setup_bcc(server, p);
if ((error = smb_request_ok(server, SMBopen, 7, 0)) != 0)
......@@ -562,15 +563,16 @@ smb_proc_open(struct inode *ino)
}
int
smb_open(struct inode *i, int wish)
smb_open(struct dentry *dir, int wish)
{
struct inode *i=dir->d_inode;
struct smb_sb_info *server = SMB_SERVER(i);
int result = -EACCES;
smb_lock_server(server);
if (!smb_is_open(i)) {
int error = smb_proc_open(i);
int error = smb_proc_open(dir);
if (error) {
smb_unlock_server(server);
return error;
......@@ -600,8 +602,9 @@ static int smb_proc_close(struct smb_sb_info *server,
}
int smb_close(struct inode *ino)
int smb_close(struct dentry *dir)
{
struct inode *ino = dir->d_inode;
struct smb_sb_info *server = SMB_SERVER(ino);
int result;
......@@ -691,12 +694,13 @@ smb_proc_write(struct inode *ino, off_t offset, int count, const char *data)
}
int
smb_proc_create(struct inode *dir, struct qstr *name,
smb_proc_create(struct dentry *dir, struct qstr *name,
__u16 attr, time_t ctime)
{
int error;
char *p;
struct smb_sb_info *server = SMB_SERVER(dir);
struct inode *i=dir->d_inode;
struct smb_sb_info *server = SMB_SERVER(i);
char *buf;
smb_lock_server(server);
......@@ -725,11 +729,11 @@ smb_proc_create(struct inode *dir, struct qstr *name,
}
int
smb_proc_mv(struct inode *odir, struct qstr *oname,
struct inode *ndir, struct qstr *nname)
smb_proc_mv(struct dentry *odir, struct qstr *oname,
struct dentry *ndir, struct qstr *nname)
{
char *p;
struct smb_sb_info *server = SMB_SERVER(odir);
struct smb_sb_info *server = SMB_SERVER(odir->d_inode);
int result;
smb_lock_server(server);
......@@ -755,11 +759,11 @@ smb_proc_mv(struct inode *odir, struct qstr *oname,
}
int
smb_proc_mkdir(struct inode *dir, struct qstr *name)
smb_proc_mkdir(struct dentry *dir, struct qstr *name)
{
char *p;
int result;
struct smb_sb_info *server = SMB_SERVER(dir);
struct smb_sb_info *server = SMB_SERVER(dir->d_inode);
smb_lock_server(server);
......@@ -781,11 +785,11 @@ smb_proc_mkdir(struct inode *dir, struct qstr *name)
}
int
smb_proc_rmdir(struct inode *dir, struct qstr *name)
smb_proc_rmdir(struct dentry *dir, struct qstr *name)
{
char *p;
int result;
struct smb_sb_info *server = SMB_SERVER(dir);
struct smb_sb_info *server = SMB_SERVER(dir->d_inode);
smb_lock_server(server);
......@@ -807,10 +811,10 @@ smb_proc_rmdir(struct inode *dir, struct qstr *name)
}
int
smb_proc_unlink(struct inode *dir, struct qstr *name)
smb_proc_unlink(struct dentry *dir, struct qstr *name)
{
char *p;
struct smb_sb_info *server = SMB_SERVER(dir);
struct smb_sb_info *server = SMB_SERVER(dir->d_inode);
int result;
smb_lock_server(server);
......@@ -956,7 +960,7 @@ smb_decode_dirent(struct smb_sb_info *server, __u8 *p,
SMB_PROTOCOL_LANMAN2 */
static int
smb_proc_readdir_short(struct smb_sb_info *server, struct inode *dir, int fpos,
smb_proc_readdir_short(struct smb_sb_info *server, struct dentry *dir, int fpos,
int cache_size, struct smb_dirent *entry)
{
char *p;
......@@ -1135,7 +1139,7 @@ smb_decode_long_dirent(struct smb_sb_info *server, char *p,
}
static int
smb_proc_readdir_long(struct smb_sb_info *server, struct inode *dir, int fpos,
smb_proc_readdir_long(struct smb_sb_info *server, struct dentry *dir, int fpos,
int cache_size, struct smb_dirent *cache)
{
/* NT uses 260, OS/2 uses 2. Both accept 1. */
......@@ -1335,10 +1339,10 @@ smb_proc_readdir_long(struct smb_sb_info *server, struct inode *dir, int fpos,
}
int
smb_proc_readdir(struct inode *dir, int fpos,
smb_proc_readdir(struct dentry *dir, int fpos,
int cache_size, struct smb_dirent *entry)
{
struct smb_sb_info *server = SMB_SERVER(dir);
struct smb_sb_info *server = SMB_SERVER(dir->d_inode);
if (server->opt.protocol >= SMB_PROTOCOL_LANMAN2)
return smb_proc_readdir_long(server, dir, fpos, cache_size,
......@@ -1349,12 +1353,12 @@ smb_proc_readdir(struct inode *dir, int fpos,
}
static int
smb_proc_getattr_core(struct inode *dir, struct qstr *name,
smb_proc_getattr_core(struct dentry *dir, struct qstr *name,
struct smb_fattr *attr)
{
int result;
char *p;
struct smb_sb_info *server = SMB_SERVER(dir);
struct smb_sb_info *server = SMB_SERVER(dir->d_inode);
char *buf;
smb_lock_server(server);
......@@ -1385,10 +1389,10 @@ smb_proc_getattr_core(struct inode *dir, struct qstr *name,
}
static int
smb_proc_getattr_trans2(struct inode *dir, struct qstr *name,
smb_proc_getattr_trans2(struct dentry *dir, struct qstr *name,
struct smb_fattr *attr)
{
struct smb_sb_info *server = SMB_SERVER(dir);
struct smb_sb_info *server = SMB_SERVER(dir->d_inode);
char param[SMB_MAXPATHLEN + 20];
char *p;
int result;
......@@ -1441,10 +1445,10 @@ smb_proc_getattr_trans2(struct inode *dir, struct qstr *name,
return 0;
}
int smb_proc_getattr(struct inode *dir, struct qstr *name,
int smb_proc_getattr(struct dentry *dir, struct qstr *name,
struct smb_fattr *fattr)
{
struct smb_sb_info *server = SMB_SERVER(dir);
struct smb_sb_info *server = SMB_SERVER(dir->d_inode);
int result = 0;
smb_init_dirent(server, fattr);
......@@ -1465,7 +1469,7 @@ int smb_proc_getattr(struct inode *dir, struct qstr *name,
entry->f_mtime, to make touch work. */
static int
smb_proc_setattr_core(struct smb_sb_info *server,
struct inode *i, struct smb_fattr *fattr)
struct dentry *dir, struct smb_fattr *fattr)
{
char *p;
char *buf;
......@@ -1479,7 +1483,7 @@ smb_proc_setattr_core(struct smb_sb_info *server,
WSET(buf, smb_vwv0, fattr->attr);
DSET(buf, smb_vwv1, utc2local(fattr->f_mtime));
*p++ = 4;
p = smb_encode_path(server, p, i, NULL);
p = smb_encode_path(server, p, dir, NULL);
*p++ = 4;
*p++ = 0;
......@@ -1494,7 +1498,7 @@ smb_proc_setattr_core(struct smb_sb_info *server,
static int
smb_proc_setattr_trans2(struct smb_sb_info *server,
struct inode *i, struct smb_fattr *fattr)
struct dentry *dir, struct smb_fattr *fattr)
{
char param[SMB_MAXPATHLEN + 20];
char data[26];
......@@ -1508,7 +1512,7 @@ smb_proc_setattr_trans2(struct smb_sb_info *server,
WSET(param, 0, 1); /* Info level SMB_INFO_STANDARD */
DSET(param, 2, 0);
p = smb_encode_path(server, param + 6, i, NULL);
p = smb_encode_path(server, param + 6, dir, NULL);
date_unix2dos(fattr->f_ctime, &(data[0]), &(data[2]));
date_unix2dos(fattr->f_atime, &(data[4]), &(data[6]));
......@@ -1539,16 +1543,16 @@ smb_proc_setattr_trans2(struct smb_sb_info *server,
}
int
smb_proc_setattr(struct smb_sb_info *server, struct inode *inode,
smb_proc_setattr(struct smb_sb_info *server, struct dentry *dir,
struct smb_fattr *fattr)
{
int result;
if (server->opt.protocol >= SMB_PROTOCOL_LANMAN2)
result = smb_proc_setattr_trans2(server, inode, fattr);
result = smb_proc_setattr_trans2(server, dir, fattr);
if ((server->opt.protocol < SMB_PROTOCOL_LANMAN2) || (result < 0))
result = smb_proc_setattr_core(server, inode, fattr);
result = smb_proc_setattr_core(server, dir, fattr);
return result;
}
......
......@@ -86,7 +86,7 @@ smb_data_callback(struct sock *sk, int len)
{
unsigned char peek_buf[4];
int result;
unsigned short fs;
unsigned long fs;
fs = get_fs();
set_fs(get_ds());
......@@ -276,7 +276,7 @@ smb_get_length(struct socket *sock, unsigned char *header)
{
int result;
unsigned char peek_buf[4];
unsigned short fs;
unsigned long fs;
re_recv:
fs = get_fs();
......@@ -500,7 +500,7 @@ int
smb_request(struct smb_sb_info *server)
{
unsigned long old_mask;
unsigned short fs;
unsigned long fs;
int len, result;
unsigned char *buffer = (server == NULL) ? NULL : server->packet;
......@@ -649,7 +649,7 @@ smb_trans2_request(struct smb_sb_info *server, __u16 trans2_command,
int *lrparam, unsigned char **rparam)
{
unsigned long old_mask;
unsigned short fs;
unsigned long fs;
int result;
pr_debug("smb_trans2_request: com=%d, ld=%d, lp=%d\n",
......
......@@ -27,7 +27,7 @@ static long sysv_dir_read(struct inode * inode, struct file * filp,
return -EISDIR;
}
static int sysv_readdir(struct inode *, struct file *, void *, filldir_t);
static int sysv_readdir(struct file *, void *, filldir_t);
static struct file_operations sysv_dir_operations = {
NULL, /* lseek - default */
......@@ -65,9 +65,9 @@ struct inode_operations sysv_dir_inode_operations = {
NULL /* permission */
};
static int sysv_readdir(struct inode * inode, struct file * filp,
void * dirent, filldir_t filldir)
static int sysv_readdir(struct file * filp, void * dirent, filldir_t filldir)
{
struct inode *inode = filp->f_dentry->d_inode;
struct super_block * sb;
unsigned int offset,i;
struct buffer_head * bh;
......
......@@ -257,14 +257,13 @@ static int trunc_tindirect(struct inode * inode, unsigned long offset, unsigned
static int trunc_all(struct inode * inode)
{
struct super_block * sb;
char * res;
char dirty;
sb = inode->i_sb;
res = (char *)test_bit(I_DIRTY,&inode->i_state);
return trunc_direct(inode)
| trunc_indirect(inode,sb->sv_ind0_size,&inode->u.sysv_i.i_data[10],0,res)
| trunc_dindirect(inode,sb->sv_ind1_size,&inode->u.sysv_i.i_data[11],0,res)
| trunc_tindirect(inode,sb->sv_ind2_size,&inode->u.sysv_i.i_data[12],0,res);
| trunc_indirect(inode,sb->sv_ind0_size,&inode->u.sysv_i.i_data[10],0,&dirty)
| trunc_dindirect(inode,sb->sv_ind1_size,&inode->u.sysv_i.i_data[11],0,&dirty)
| trunc_tindirect(inode,sb->sv_ind2_size,&inode->u.sysv_i.i_data[12],0,&dirty);
}
......
......@@ -17,9 +17,9 @@
* This is blatantly stolen from ext2fs
*/
static int
ufs_readdir (struct inode * inode, struct file * filp, void * dirent,
filldir_t filldir)
ufs_readdir (struct file * filp, void * dirent, filldir_t filldir)
{
struct inode *inode = filp->f_dentry->d_inode;
int error = 0;
unsigned long offset, lblk, blk;
int i, stored;
......
......@@ -29,7 +29,7 @@ long umsdos_file_read_kmem (struct inode *inode,
unsigned long count)
{
int ret;
int old_fs = get_fs();
unsigned long old_fs = get_fs();
set_fs (KERNEL_DS);
ret = fat_file_read(inode,filp,buf,count);
set_fs (old_fs);
......@@ -44,7 +44,7 @@ long umsdos_file_write_kmem (struct inode *inode,
unsigned long count)
{
int ret;
int old_fs = get_fs();
unsigned long old_fs = get_fs();
set_fs (KERNEL_DS);
ret = fat_file_write(inode,filp,buf,count);
set_fs (old_fs);
......
......@@ -12,6 +12,7 @@
*/
#include <linux/config.h>
#include <asm/processor.h>
#define CONFIG_BUGi386
......@@ -41,10 +42,11 @@ __initfunc(static void copro_timeout(void))
outb_p(0,0xf0);
}
static double __initdata x = 4195835.0;
static double __initdata y = 3145727.0;
__initfunc(static void check_fpu(void))
{
static double x = 4195835.0;
static double y = 3145727.0;
unsigned short control_word;
if (!hard_math) {
......@@ -91,12 +93,10 @@ __initfunc(static void check_fpu(void))
"fninit"
: "=m" (*&fdiv_bug)
: "m" (*&x), "m" (*&y));
if (!fdiv_bug) {
if (!fdiv_bug)
printk("Ok, fpu using exception 16 error reporting.\n");
return;
}
printk("Hmm, FDIV bug i%c86 system\n", '0'+x86);
else
printk("Hmm, fpu using exception 16 error reporting with FDIV bug.\n");
}
__initfunc(static void check_hlt(void))
......@@ -125,10 +125,53 @@ __initfunc(static void check_tlb(void))
#endif
}
/*
* Most 386 processors have a bug where a POPAD can lock the
* machine even from user space.
*/
__initfunc(static void check_popad(void))
{
#ifdef CONFIG_M386
int res, inp = (int) &res;
printk(KERN_INFO "Checking for popad bug... ");
__asm__ __volatile__(
"movl $12345678,%%eax; movl $0,%%edi; pusha; popa; movl (%%edx,%%edi),%%ecx "
: "=eax" (res)
: "edx" (inp)
: "eax", "ecx", "edx", "edi" );
/* If this fails, it means that any user program may lock CPU hard. Too bad. */
if (res != 12345678) printk( "Bad.\n" );
else printk( "Ok.\n" );
#endif
}
/*
* B step AMD K6 before B 9729AIJW have hardware bugs that can cause
* misexecution of code under Linux. Owners of such processors should
* contact AMD for precise details and a CPU swap.
*
* See http://www.creaweb.fr/bpc/k6bug_faq.html
* http://www.amd.com/K6/k6docs/revgd.html
*/
__initfunc(static void check_amd_k6(void))
{
/* B Step AMD K6 */
if(x86_model==6 && x86_mask==1 && memcmp(x86_vendor_id, "AuthenticAMD", 12)==0)
{
printk(KERN_INFO "AMD K6 stepping B detected - system stability may be impaired. Please see.\n");
printk(KERN_INFO "http://www.creaweb.fr/bpc/k6bug_faq.html");
}
}
__initfunc(static void check_bugs(void))
{
check_tlb();
check_fpu();
check_hlt();
check_popad();
check_amd_k6();
system_utsname.machine[1] = '0' + x86;
}
......@@ -356,14 +356,14 @@ struct inode {
};
/* Inode state bits.. */
#define I_DIRTY 0
#define I_LOCK 1
#define I_FREEING 2
#define I_DIRTY 1
#define I_LOCK 2
#define I_FREEING 4
extern void __mark_inode_dirty(struct inode *);
static inline void mark_inode_dirty(struct inode *inode)
{
if (!test_and_set_bit(I_DIRTY, &inode->i_state))
if (!(inode->i_state & I_DIRTY))
__mark_inode_dirty(inode);
}
......@@ -532,7 +532,7 @@ struct file_operations {
long long (*llseek) (struct inode *, struct file *, long long, int);
long (*read) (struct inode *, struct file *, char *, unsigned long);
long (*write) (struct inode *, struct file *, const char *, unsigned long);
int (*readdir) (struct inode *, struct file *, void *, filldir_t);
int (*readdir) (struct file *, void *, filldir_t);
unsigned int (*poll) (struct file *, poll_table *);
int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);
int (*mmap) (struct inode *, struct file *, struct vm_area_struct *);
......
......@@ -65,15 +65,15 @@ struct ip_fw
struct in_addr fw_smsk, fw_dmsk; /* Mask for src and dest IP addr */
struct in_addr fw_via; /* IP address of interface "via" */
struct device *fw_viadev; /* device of interface "via" */
unsigned short fw_flg; /* Flags word */
unsigned short fw_nsp, fw_ndp; /* N'of src ports and # of dst ports */
__u16 fw_flg; /* Flags word */
__u16 fw_nsp, fw_ndp; /* N'of src ports and # of dst ports */
/* in ports array (dst ports follow */
/* src ports; max of 10 ports in all; */
/* count of 0 means match all ports) */
#define IP_FW_MAX_PORTS 10 /* A reasonable maximum */
unsigned short fw_pts[IP_FW_MAX_PORTS]; /* Array of port numbers to match */
__u16 fw_pts[IP_FW_MAX_PORTS]; /* Array of port numbers to match */
unsigned long fw_pcnt,fw_bcnt; /* Packet and byte counters */
unsigned char fw_tosand, fw_tosxor; /* Revised packet priority */
__u8 fw_tosand, fw_tosxor; /* Revised packet priority */
char fw_vianame[IFNAMSIZ]; /* name of interface "via" */
};
......
......@@ -219,7 +219,7 @@ extern struct file_operations fat_dir_operations;
extern int fat_readdirx(struct inode *inode, struct file *filp, void *dirent,
fat_filldir_t fat_filldir, filldir_t filldir,
int shortnames, int longnames, int both);
extern int fat_readdir(struct inode *inode, struct file *filp,
extern int fat_readdir(struct file *filp,
void *dirent, filldir_t);
extern int fat_dir_ioctl(struct inode * inode, struct file * filp,
unsigned int cmd, unsigned long arg);
......
......@@ -325,7 +325,7 @@ extern int proc_match(int, const char *,struct proc_dir_entry *);
* The /proc root directory has extended versions to take care
* of the /proc/<pid> subdirectories.
*/
extern int proc_readdir(struct inode *, struct file *, void *, filldir_t);
extern int proc_readdir(struct file *, void *, filldir_t);
extern int proc_lookup(struct inode *, struct dentry *);
struct openpromfs_dev {
......
......@@ -104,8 +104,8 @@ __u8 *smb_setup_header(struct smb_sb_info *server, __u8 command,
__u16 wct, __u16 bcc);
int smb_offerconn(struct smb_sb_info *server);
int smb_newconn(struct smb_sb_info *server, struct smb_conn_opt *opt);
int smb_close(struct inode *);
int smb_open(struct inode *, int);
int smb_close(struct dentry *);
int smb_open(struct dentry *, int);
static inline int
smb_is_open(struct inode *i)
{
......@@ -114,18 +114,16 @@ smb_is_open(struct inode *i)
int smb_proc_read(struct inode *, off_t, long, char *);
int smb_proc_write(struct inode *, off_t, int, const char *);
int smb_proc_create(struct inode *, struct qstr *, __u16, time_t);
int smb_proc_mv(struct inode *, struct qstr *, struct inode *, struct qstr *);
int smb_proc_mkdir(struct inode *, struct qstr *);
int smb_proc_rmdir(struct inode *, struct qstr *);
int smb_proc_unlink(struct inode *dir, struct qstr *);
int smb_proc_readdir(struct inode *dir,
int fpos, int cache_size,
struct smb_dirent *entry);
int smb_proc_getattr(struct inode *dir, struct qstr *name,
int smb_proc_create(struct dentry *, struct qstr *, __u16, time_t);
int smb_proc_mv(struct dentry *, struct qstr *, struct dentry *, struct qstr *);
int smb_proc_mkdir(struct dentry *, struct qstr *);
int smb_proc_rmdir(struct dentry *, struct qstr *);
int smb_proc_unlink(struct dentry *dir, struct qstr *);
int smb_proc_readdir(struct dentry *dir, int fpos, int cache_size, struct smb_dirent *entry);
int smb_proc_getattr(struct dentry *dir, struct qstr *name,
struct smb_fattr *entry);
int smb_proc_setattr(struct smb_sb_info *server,
struct inode *ino,
struct dentry *dir,
struct smb_fattr *new_finfo);
int smb_proc_dskattr(struct super_block *sb, struct statfs *attr);
int smb_proc_reconnect(struct smb_sb_info *server);
......
......@@ -19,10 +19,10 @@
struct udphdr {
u16 source;
u16 dest;
u16 len;
u16 check;
__u16 source;
__u16 dest;
__u16 len;
__u16 check;
};
......
......@@ -155,6 +155,8 @@ EXPORT_SYMBOL(d_validate);
EXPORT_SYMBOL(d_add);
EXPORT_SYMBOL(d_move);
EXPORT_SYMBOL(d_instantiate);
EXPORT_SYMBOL(d_alloc);
EXPORT_SYMBOL(d_lookup);
EXPORT_SYMBOL(__mark_inode_dirty);
EXPORT_SYMBOL(init_private_file);
EXPORT_SYMBOL(insert_file_free);
......
......@@ -492,20 +492,6 @@ asmlinkage void schedule(void)
*(int *)0 = 0;
}
#ifndef __alpha__
/*
* For backwards compatibility? This can be done in libc so Alpha
* and all newer ports shouldn't need it.
*/
asmlinkage int sys_pause(void)
{
current->state = TASK_INTERRUPTIBLE;
schedule();
return -ERESTARTNOHAND;
}
#endif
rwlock_t waitqueue_lock = RW_LOCK_UNLOCKED;
......
......@@ -158,45 +158,6 @@ asmlinkage int sys_getpriority(int which, int who)
return max_prio;
}
#ifndef __alpha__
/*
* Why do these exist? Binary compatibility with some other standard?
* If so, maybe they should be moved into the appropriate arch
* directory.
*/
asmlinkage int sys_profil(void)
{
return -ENOSYS;
}
asmlinkage int sys_ftime(void)
{
return -ENOSYS;
}
asmlinkage int sys_break(void)
{
return -ENOSYS;
}
asmlinkage int sys_stty(void)
{
return -ENOSYS;
}
asmlinkage int sys_gtty(void)
{
return -ENOSYS;
}
asmlinkage int sys_prof(void)
{
return -ENOSYS;
}
#endif
extern asmlinkage int sys_kill(int, int);
......@@ -480,40 +441,6 @@ asmlinkage int sys_acct(const char *name)
return error;
}
#ifndef __alpha__
/*
* Why do these exist? Binary compatibility with some other standard?
* If so, maybe they should be moved into the appropriate arch
* directory.
*/
asmlinkage int sys_phys(void)
{
return -ENOSYS;
}
asmlinkage int sys_lock(void)
{
return -ENOSYS;
}
asmlinkage int sys_mpx(void)
{
return -ENOSYS;
}
asmlinkage int sys_ulimit(void)
{
return -ENOSYS;
}
asmlinkage int sys_old_syscall(void)
{
return -ENOSYS;
}
#endif
/*
* Unprivileged users may change the real uid to the effective uid
......@@ -938,48 +865,6 @@ asmlinkage int sys_newuname(struct new_utsname * name)
return 0;
}
#ifndef __alpha__
/*
* Move these to arch dependent dir since they are for
* backward compatibility only?
*/
#ifndef __sparc__
asmlinkage int sys_uname(struct old_utsname * name)
{
if (name && !copy_to_user(name, &system_utsname, sizeof (*name)))
return 0;
return -EFAULT;
}
#endif
asmlinkage int sys_olduname(struct oldold_utsname * name)
{
int error;
if (!name)
return -EFAULT;
if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
return -EFAULT;
error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN);
error -= __put_user(0,name->sysname+__OLD_UTS_LEN);
error -= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN);
error -= __put_user(0,name->nodename+__OLD_UTS_LEN);
error -= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN);
error -= __put_user(0,name->release+__OLD_UTS_LEN);
error -= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN);
error -= __put_user(0,name->version+__OLD_UTS_LEN);
error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN);
error = __put_user(0,name->machine+__OLD_UTS_LEN);
error = error ? -EFAULT : 0;
return error;
}
#endif
asmlinkage int sys_sethostname(char *name, int len)
{
if (!suser())
......
......@@ -5,7 +5,7 @@ Code Section Bug Report Contact
-------------------+-------------------------------------------
802 [other ] alan@lxorguk.ukuu.org.uk
[token ring ] pnorton@cts.com
appletalk alan@lxorguk.ukuu.org.uk and netatalk@umich.edu
appletalk Jay.Schulist@spacs.k12.wi.us
ax25 g4klx@g4klx.demon.co.uk
core alan@lxorguk.ukuu.org.uk
decnet SteveW@ACM.org
......
......@@ -1545,8 +1545,6 @@ static int br_port_cost(struct device *dev) /* 4.10.2 */
{
if (strncmp(dev->name, "eth", 3) == 0) /* ethernet */
return(100);
if (strncmp(dev->name, "wic", 3) == 0) /* wic */
return(1600);
if (strncmp(dev->name, "plip",4) == 0) /* plip */
return (1600);
return(100); /* default */
......
......@@ -1120,7 +1120,9 @@ static int ip_chain_procinfo(int stage, char *buffer, char **start,
ntohl(i->fw_dst.s_addr),ntohl(i->fw_dmsk.s_addr),
(i->fw_vianame)[0] ? i->fw_vianame : "-",
ntohl(i->fw_via.s_addr),i->fw_flg);
len+=sprintf(buffer+len,"%u %u %-9lu %-9lu",
/* 9 is enough for a 32 bit box but the counters are 64bit on
the Alpha and Ultrapenguin */
len+=sprintf(buffer+len,"%u %u %-19lu %-19lu",
i->fw_nsp,i->fw_ndp, i->fw_pcnt,i->fw_bcnt);
for (p = 0; p < IP_FW_MAX_PORTS; p++)
len+=sprintf(buffer+len, " %u", i->fw_pts[p]);
......
......@@ -29,6 +29,8 @@
* 2 of the License, or (at your option) any later version.
*
* Fixes:
* Alan Cox 07 Sept 1997 Vmalloc internal stack as needed.
* Cope with changing max_files.
*
*/
......@@ -49,6 +51,8 @@
#include <linux/in.h>
#include <linux/fs.h>
#include <linux/malloc.h>
#include <linux/vmalloc.h>
#include <asm/uaccess.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
......@@ -60,10 +64,9 @@
/* Internal data structures and random procedures: */
#define MAX_STACK 1000 /* Maximum depth of tree (about 1 page) */
static unix_socket **stack; /* stack of objects to mark */
static int in_stack = 0; /* first free entry in stack */
static int max_stack; /* Top of stack */
extern inline unix_socket *unix_get_socket(struct file *filp)
{
......@@ -112,7 +115,7 @@ void unix_notinflight(struct file *fp)
extern inline void push_stack(unix_socket *x)
{
if (in_stack == MAX_STACK)
if (in_stack == max_stack)
panic("can't push onto full stack");
stack[in_stack++] = x;
}
......@@ -155,7 +158,19 @@ void unix_gc(void)
return;
in_unix_gc=1;
stack=(unix_socket **)get_free_page(GFP_KERNEL);
if(stack==NULL || max_files>max_stack)
{
if(stack)
vfree(stack);
stack=(unix_socket **)vmalloc(max_files*sizeof(struct unix_socket *));
if(stack==NULL)
{
printk(KERN_NOTICE "unix_gc: deferred due to low memory.\n");
in_unix_gc=0;
return;
}
max_stack=max_files;
}
/*
* Assume everything is now unmarked
......
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