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
# 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
# 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
.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 */
.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)
.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)
.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)
.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)
* 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.
*
/*
* 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
* 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
__initfunc(void setup_APIC_clock (void))
{
- int cpu = smp_processor_id();
unsigned long flags;
static volatile int calibration_lock;
}
/*
- * 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.
#include <linux/stat.h>
#include <linux/mman.h>
#include <linux/file.h>
+#include <linux/utsname.h>
#include <asm/uaccess.h>
#include <asm/ipc.h>
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;
+}
+
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
* 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:
*
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. */
}
#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
}
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;
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;
}
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;
}
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;
}
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)
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;
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");
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
#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);
}
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;
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);
#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;
#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 *);
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))
{
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;
{
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;
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 */
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;
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;
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 ();
}
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);
}
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 *);
}
}
-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;
ino_t ino;
char * tempname;
long old_pos;
+ struct inode *inode = filp->f_dentry->d_inode;
if (inode == 0
|| inode->i_sb == 0
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;
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 };
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;
}
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);
}
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));
}
/*
if (dev && sb->s_dev != dev)
continue;
- sync_list(&sb->s_dirty, &inode_in_use);
+ sync_list(&sb->s_dirty);
if (dev)
break;
}
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
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)
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;
}
#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 =
{
* 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;
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 */
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;
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
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);
unsigned long tmp;
int bufsize;
int pos;
- unsigned short fs;
+ unsigned long fs;
page = __get_free_page(GFP_KERNEL);
if (!page)
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;
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);
* 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;
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)) {
#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);
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);
* 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;
#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 = {
#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;
*/
#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};
* 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;
#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;
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;
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;
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;
}
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;
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);
}
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;
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)
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;
/* 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;
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) {
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;
* 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;
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;
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;
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;
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)
}
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++ = '\\';
*/
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;
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)
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)
}
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;
}
-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;
}
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);
}
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);
}
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);
}
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);
}
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);
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;
}
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. */
}
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,
}
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);
}
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;
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);
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;
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;
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];
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]));
}
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;
}
{
unsigned char peek_buf[4];
int result;
- unsigned short fs;
+ unsigned long fs;
fs = get_fs();
set_fs(get_ds());
{
int result;
unsigned char peek_buf[4];
- unsigned short fs;
+ unsigned long fs;
re_recv:
fs = get_fs();
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;
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",
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 */
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;
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);
}
* 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;
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);
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);
*/
#include <linux/config.h>
+#include <asm/processor.h>
#define CONFIG_BUGi386
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) {
"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))
#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;
}
};
/* 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);
}
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 *);
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" */
};
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);
* 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 {
__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)
{
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);
struct udphdr {
- u16 source;
- u16 dest;
- u16 len;
- u16 check;
+ __u16 source;
+ __u16 dest;
+ __u16 len;
+ __u16 check;
};
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);
*(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;
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);
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
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())
-------------------+-------------------------------------------
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
{
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 */
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]);
* 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.
*
*/
#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>
/* 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)
{
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;
}
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