Commit 2730f0af authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.45pre2

parent 0d1267fe
......@@ -107,7 +107,9 @@ S: USA
N: Randolph Bentson
E: bentson@grieg.seaslug.org
D: author of driver for Cyclades Cyclom-Y async mux
D: author of driver for Cyclom-Y and Cyclades-Z async mux
P: 1024/39ED5729 5C A8 7A F4 B2 7A D1 3E B5 3B 81 CF 47 30 11 71
W: http://www.aa.net/~bentson/
S: 2322 37th Ave SW
S: Seattle, Washington 98126-2010
S: USA
......@@ -793,6 +795,12 @@ S: Schlehenweg 9
S: D-91080 Uttenreuth
S: Germany
N: Jaroslav Kysela
E: perex@jcu.cz
D: Original Author and Maintainer for HP 10/100 Mbit Network Adapters
W: http://www.pf.jcu.cz/~perex
S: Unix Centre of Pedagogical Faculty, University of South Bohemia
N: Bas Laarhoven
E: bas@vimec.nl
D: Loadable modules and ftape driver
......@@ -842,6 +850,13 @@ S: PO Box 371
S: North Little Rock, Arkansas 72115
S: US
N: Siegfried "Frieder" Loeffler (dg1sek)
E: floeff@tunix.mathematik.uni-stuttgart.de, fl@LF.net
W: http://www.mathematik.uni-stuttgart.de/~floeff
D: Busmaster driver for HP 10/100 Mbit Network Adapters
S: University of Stuttgart, Germany and
S: Ecole Nationale Superieure des Telecommunications, Paris
N: Martin von Loewis
E: loewis@informatik.hu-berlin.de
D: script binary format
......
......@@ -107,6 +107,11 @@ P: Jean Tourrilhes
M: jt@hplb.hpl.hp.com
S: Maintained
HP100: Driver for HP 10/100 Mbit/s Network Adapter Series
P: Jarsolav Kysela
M: perex@jcu.cz
S: Maintained
APM DRIVER
P: Rik Faith & Stephen Rothwell
M: faith@cs.unc.edu, Stephen.Rothwell@canb.auug.org.au
......
VERSION = 2
PATCHLEVEL = 1
SUBLEVEL = 44
SUBLEVEL = 45
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
......
......@@ -195,9 +195,6 @@ CONFIG_DE4X5=y
# Filesystems
#
# CONFIG_QUOTA is not set
# CONFIG_DCACHE_PRELOAD is not set
# CONFIG_OMIRR is not set
# CONFIG_TRANS_NAMES is not set
# CONFIG_MINIX_FS is not set
CONFIG_EXT2_FS=y
# CONFIG_FAT_FS is not set
......@@ -205,12 +202,13 @@ CONFIG_EXT2_FS=y
# CONFIG_VFAT_FS is not set
# CONFIG_UMSDOS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_NFS_FS is not set
CONFIG_NFS_FS=y
# CONFIG_ROOT_NFS is not set
# CONFIG_NFSD is not set
# CONFIG_SUNRPC is not set
# CONFIG_LOCKD is not set
CONFIG_SUNRPC=y
CONFIG_LOCKD=y
# CONFIG_SMB_FS is not set
# CONFIG_ISO9660_FS is not set
CONFIG_ISO9660_FS=y
# CONFIG_HPFS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_AFFS_FS is not set
......
......@@ -192,9 +192,6 @@ CONFIG_EEXPRESS_PRO100=y
# Filesystems
#
# CONFIG_QUOTA is not set
# CONFIG_DCACHE_PRELOAD is not set
# CONFIG_OMIRR is not set
# CONFIG_TRANS_NAMES is not set
# CONFIG_MINIX_FS is not set
CONFIG_EXT2_FS=y
# CONFIG_FAT_FS is not set
......@@ -208,7 +205,7 @@ CONFIG_NFS_FS=y
CONFIG_SUNRPC=y
CONFIG_LOCKD=y
# CONFIG_SMB_FS is not set
# CONFIG_ISO9660_FS is not set
CONFIG_ISO9660_FS=y
# CONFIG_HPFS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_AFFS_FS is not set
......
This diff is collapsed.
......@@ -168,6 +168,11 @@ static void aux_write_dev(int val)
outb_p(val, KBD_DATA_REG); /* Write data */
}
/*
* Write to device & handle returned ack
*/
#ifdef INITIALIZE_DEVICE
__initfunc(static void aux_write_dev_nosleep(int val))
{
poll_aux_status_nosleep();
......@@ -176,11 +181,6 @@ __initfunc(static void aux_write_dev_nosleep(int val))
outb_p(val, KBD_DATA_REG);
}
/*
* Write to device & handle returned ack
*/
#ifdef INITIALIZE_DEVICE
__initfunc(static int aux_write_ack(int val))
{
aux_write_dev_nosleep(val);
......
......@@ -29,6 +29,7 @@
#include <linux/config.h>
/*
Define types for some of the structures that interface with the rest
of the Linux Kernel and SCSI Subsystem.
......
......@@ -50,13 +50,8 @@
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/config.h>
#include <linux/version.h>
#if LINUX_VERSION_CODE < 66354 /* 1.3.50 */
#include "../block/blk.h"
#else
#include <linux/init.h>
#include <linux/blk.h>
#endif
#include "scsi.h"
#include "hosts.h"
......@@ -69,13 +64,10 @@
#define PCI_DEVICE_ID_AMD53C974 PCI_DEVICE_ID_AMD_SCSI
#ifndef VERSION_ELF_1_2_13
struct proc_dir_entry proc_scsi_tmscsim ={
PROC_SCSI_DC390T, 7 ,"tmscsim",
S_IFDIR | S_IRUGO | S_IXUGO, 2
};
#endif
static USHORT DC390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB );
static void DC390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
......@@ -675,11 +667,7 @@ DoNextCmd( PACB pACB, PDCB pDCB )
* Description:
* Return the disk geometry for the given SCSI device.
***********************************************************************/
#ifdef VERSION_ELF_1_2_13
int DC390_bios_param(Disk *disk, int devno, int geom[])
#else
int DC390_bios_param(Disk *disk, kdev_t devno, int geom[])
#endif
{
int heads, sectors, cylinders;
PACB pACB;
......@@ -1046,14 +1034,10 @@ void DC390_initDCB( PACB pACB, PDCB pDCB, PSCSICMD cmd )
***********************************************************************/
void DC390_initSRB( PSRB psrb )
{
#ifndef VERSION_ELF_1_2_13
#ifdef DC390_DEBUG0
printk("DC390 init: %08lx %08lx,",(ULONG)psrb,(ULONG)virt_to_bus(psrb));
#endif
psrb->PhysSRB = virt_to_bus( psrb );
#else
psrb->PhysSRB = (ULONG) psrb;
#endif
}
......@@ -1084,7 +1068,7 @@ void DC390_linkSRB( PACB pACB )
* Inputs : psh - pointer to this host adapter's structure
*
***********************************************************************/
void DC390_initACB( PSH psh, ULONG io_port, UCHAR Irq, USHORT index )
__initfunc(void DC390_initACB( PSH psh, ULONG io_port, UCHAR Irq, USHORT index ))
{
PACB pACB;
USHORT i;
......@@ -1098,7 +1082,6 @@ void DC390_initACB( PSH psh, ULONG io_port, UCHAR Irq, USHORT index )
pACB = (PACB) psh->hostdata;
#ifndef VERSION_ELF_1_2_13
psh->max_id = 8;
#ifdef CONFIG_SCSI_MULTI_LUN
if( eepromBuf[index][EE_MODE2] & LUN_CHECK )
......@@ -1106,7 +1089,6 @@ void DC390_initACB( PSH psh, ULONG io_port, UCHAR Irq, USHORT index )
else
#endif
psh->max_lun = 1;
#endif
pACB->max_id = 7;
if( pACB->max_id == eepromBuf[index][EE_ADAPT_SCSI_ID] )
......@@ -1155,7 +1137,7 @@ void DC390_initACB( PSH psh, ULONG io_port, UCHAR Irq, USHORT index )
* Inputs : psh - pointer to this host adapter's structure
*
***********************************************************************/
int DC390_initAdapter( PSH psh, ULONG io_port, UCHAR Irq, USHORT index )
__initfunc(int DC390_initAdapter( PSH psh, ULONG io_port, UCHAR Irq, USHORT index))
{
USHORT ioport;
UCHAR bval;
......@@ -1179,11 +1161,7 @@ int DC390_initAdapter( PSH psh, ULONG io_port, UCHAR Irq, USHORT index )
if( !used_irq )
{
#ifdef VERSION_ELF_1_2_13
if( request_irq(Irq, DC390_Interrupt, SA_INTERRUPT, "tmscsim"))
#else
if( request_irq(Irq, DC390_Interrupt, SA_INTERRUPT, "tmscsim", NULL))
#endif
{
printk("DC390: register IRQ error!\n");
return( -1 );
......@@ -1533,8 +1511,8 @@ DC390_ToMech( USHORT Mechnum, USHORT BusDevFunNum )
* field of the pACB structure MUST have been set.
***********************************************************************/
static int
DC390_init (PSHT psht, ULONG io_port, UCHAR Irq, USHORT index, USHORT MechNum)
__initfunc(static int
DC390_init (PSHT psht, ULONG io_port, UCHAR Irq, USHORT index, USHORT MechNum))
{
PSH psh;
PACB pACB;
......@@ -1614,8 +1592,8 @@ DC390_init (PSHT psht, ULONG io_port, UCHAR Irq, USHORT index, USHORT MechNum)
*
***********************************************************************/
int
DC390_detect(Scsi_Host_Template *psht)
__initfunc(int
DC390_detect(Scsi_Host_Template *psht))
{
#ifdef FOR_PCI_OK
UCHAR pci_bus, pci_device_fn;
......@@ -1626,19 +1604,13 @@ DC390_detect(Scsi_Host_Template *psht)
UCHAR irq;
UCHAR istatus;
#ifndef VERSION_ELF_1_2_13
UINT io_port;
#else
ULONG io_port;
#endif
USHORT adaptCnt = 0; /* Number of boards detected */
USHORT pci_index = 0; /* Device index to PCI BIOS calls */
USHORT MechNum, BusDevFunNum;
ULONG wlval;
#ifndef VERSION_ELF_1_2_13
psht->proc_dir = &proc_scsi_tmscsim;
#endif
InitialTime = 1;
pSHT_start = psht;
......@@ -1726,8 +1698,6 @@ DC390_detect(Scsi_Host_Template *psht)
}
#ifndef VERSION_ELF_1_2_13
/********************************************************************
* Function: tmscsim_set_info()
*
......@@ -1848,7 +1818,6 @@ int tmscsim_proc_info(char *buffer, char **start,
else
return length;
}
#endif /* VERSION_ELF_1_2_13 */
#ifdef MODULE
......@@ -1909,11 +1878,7 @@ int DC390_release(struct Scsi_Host *host)
#ifdef DC390_DEBUG0
printk("DC390: Free IRQ %i.",host->irq);
#endif
#ifndef VERSION_ELF_1_2_13
free_irq(host->irq,NULL);
#else
free_irq(host->irq);
#endif
}
}
......
......@@ -5,26 +5,6 @@ mainmenu_option next_comment
comment 'Filesystems'
bool 'Quota support' CONFIG_QUOTA
bool 'Preload dcache entries in readdir() [ALPHA, currently dangerous!]' CONFIG_DCACHE_PRELOAD
bool 'Include support for omirr online mirror' CONFIG_OMIRR
bool 'Translate filename suffixes' CONFIG_TRANS_NAMES
if [ "$CONFIG_TRANS_NAMES" = "y" ]; then
bool ' Restrict translation to specific gid' CONFIG_TRANS_RESTRICT
if [ "$CONFIG_TRANS_RESTRICT" = "y" ]; then
int ' Enter gid to compile in' CONFIG_TRANS_GID 4
fi
bool ' Translate nodename' CONFIG_TR_NODENAME
bool ' Translate compiled-in kernelname' CONFIG_TR_KERNNAME
if [ "$CONFIG_TR_KERNNAME" = "y" ]; then
string ' Enter kernelname string to compile in' CONFIG_KERNNAME banana
fi
bool ' Translate compiled-in kerneltype' CONFIG_TR_KERNTYPE
if [ "$CONFIG_TR_KERNTYPE" = "y" ]; then
string ' Enter kerneltype string to compile in' CONFIG_KERNTYPE default
fi
bool ' Translate machine type' CONFIG_TR_MACHINE
bool ' Translate sysname' CONFIG_TR_SYSNAME
fi
tristate 'Minix fs support' CONFIG_MINIX_FS
tristate 'Second extended fs support' CONFIG_EXT2_FS
......
......@@ -136,7 +136,7 @@ static int autofs_root_lookup(struct inode *dir, struct qstr *str, struct inode
return -EACCES;
}
if ( !oz_mode && S_ISDIR(res->i_mode) && res->i_dentry->d_covers == res->i_dentry ) {
if ( !oz_mode && S_ISDIR(res->i_mode) && i_dentry(res)->d_covers == i_dentry(res)) {
/* Not a mount point yet, call 1-800-DAEMON */
DPRINTK(("autofs: waiting on non-mountpoint dir, inode = %lu, pid = %u, pgrp = %u\n", res->i_ino, current->pid, current->pgrp));
iput(res);
......@@ -208,7 +208,7 @@ static int autofs_root_symlink(struct inode *dir, struct dentry *dentry, const c
memcpy(ent->name, dentry->d_name.name,ent->len = dentry->d_name.len);
autofs_hash_insert(dh,ent);
d_instantiate(dentry, iget(dir->i_sb,ent->ino), 0);
d_instantiate(dentry, iget(dir->i_sb,ent->ino));
return 0;
}
......@@ -295,7 +295,7 @@ static int autofs_root_mkdir(struct inode *dir, struct dentry *dentry, int mode)
ent->ino = sbi->next_dir_ino++;
autofs_hash_insert(dh,ent);
dir->i_nlink++;
d_instantiate(dentry, iget(dir->i_sb,ent->ino), D_DIR);
d_instantiate(dentry, iget(dir->i_sb,ent->ino));
return 0;
}
......
......@@ -114,7 +114,7 @@ do_aout_core_dump(long signr, struct pt_regs * regs)
#else
corefile[4] = '\0';
#endif
if (open_namei(corefile,O_CREAT | 2 | O_TRUNC,0600,&inode,NULL)) {
if (open_namei(corefile,O_CREAT | 2 | O_TRUNC,0600,&inode)) {
inode = NULL;
goto end_coredump;
}
......
......@@ -501,8 +501,7 @@ do_load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
if (retval >= 0) {
old_fs = get_fs(); /* This could probably be optimized */
set_fs(get_ds());
retval = open_namei(elf_interpreter, 0, 0,
&interpreter_inode, NULL);
retval = open_namei(elf_interpreter, 0, 0, &interpreter_inode);
set_fs(old_fs);
}
......@@ -1078,7 +1077,7 @@ static int elf_core_dump(long signr, struct pt_regs * regs)
#else
corefile[4] = '\0';
#endif
if (open_namei(corefile,O_CREAT | 2 | O_TRUNC,0600,&inode,NULL)) {
if (open_namei(corefile,O_CREAT | 2 | O_TRUNC,0600,&inode)) {
inode = NULL;
goto end_coredump;
}
......
......@@ -79,7 +79,7 @@ static int do_load_em86(struct linux_binprm *bprm,struct pt_regs *regs)
* Note that we use open_namei() as the name is now in kernel
* space, and we don't need to copy it.
*/
retval = open_namei(interp, 0, 0, &bprm->inode, NULL);
retval = open_namei(interp, 0, 0, &bprm->inode);
if (retval)
return retval;
bprm->dont_iput=0;
......
......@@ -78,7 +78,7 @@ static int do_load_java(struct linux_binprm *bprm,struct pt_regs *regs)
* OK, now restart the process with the interpreter's inode.
*/
bprm->filename = binfmt_java_interpreter;
retval = open_namei(binfmt_java_interpreter, 0, 0, &bprm->inode, NULL);
retval = open_namei(binfmt_java_interpreter, 0, 0, &bprm->inode);
if (retval)
return retval;
bprm->dont_iput=0;
......@@ -121,7 +121,7 @@ static int do_load_applet(struct linux_binprm *bprm,struct pt_regs *regs)
* OK, now restart the process with the interpreter's inode.
*/
bprm->filename = binfmt_java_appletviewer;
retval = open_namei(binfmt_java_appletviewer, 0, 0, &bprm->inode, NULL);
retval = open_namei(binfmt_java_appletviewer, 0, 0, &bprm->inode);
if (retval)
return retval;
bprm->dont_iput=0;
......
......@@ -77,7 +77,7 @@ static int do_load_script(struct linux_binprm *bprm,struct pt_regs *regs)
/*
* OK, now restart the process with the interpreter's inode.
*/
retval = open_namei(interp, 0, 0, &bprm->inode, NULL);
retval = open_namei(interp, 0, 0, &bprm->inode);
if (retval)
return retval;
bprm->dont_iput=0;
......
This diff is collapsed.
......@@ -959,7 +959,7 @@ int quota_on(kdev_t dev, short type, char *path)
return(-EBUSY);
if ((error = getname(path, &tmp)) != 0)
return(error);
error = open_namei(tmp, O_RDWR, 0600, &inode, 0);
error = open_namei(tmp, O_RDWR, 0600, &inode);
putname(tmp);
if (error)
return(error);
......
......@@ -587,7 +587,7 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
bprm->p = copy_strings(1, dynloader, bprm->page, bprm->p, 2);
bprm->argc++;
bprm->loader = bprm->p;
retval = open_namei(dynloader[0], 0, 0, &bprm->inode, NULL);
retval = open_namei(dynloader[0], 0, 0, &bprm->inode);
if (retval)
return retval;
bprm->dont_iput = 0;
......@@ -649,7 +649,7 @@ int do_execve(char * filename, char ** argv, char ** envp, struct pt_regs * regs
bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
for (i=0 ; i<MAX_ARG_PAGES ; i++) /* clear page-table */
bprm.page[i] = 0;
retval = open_namei(filename, 0, 0, &bprm.inode, NULL);
retval = open_namei(filename, 0, 0, &bprm.inode);
if (retval)
return retval;
bprm.filename = filename;
......
......@@ -346,10 +346,10 @@ static int ext2_delete_entry (struct ext2_dir_entry * dir,
/*
* By the time this is called, we already have created
* the directory cache entry for the new file, but it
* is so far marked "D_NEGATIVE".
* is so far negative - it has no inode.
*
* If the create succeeds, remove the D_NEGATIVE flag,
* and fill in the inode information with d_instantiate().
* If the create succeeds, we fill in the inode information
* with d_instantiate().
*/
int ext2_create (struct inode * dir, struct dentry * dentry, int mode)
{
......@@ -382,7 +382,7 @@ int ext2_create (struct inode * dir, struct dentry * dentry, int mode)
wait_on_buffer (bh);
}
brelse (bh);
d_instantiate(dentry, inode, 0);
d_instantiate(dentry, inode);
return 0;
}
......@@ -439,7 +439,7 @@ int ext2_mknod (struct inode * dir, struct dentry *dentry, int mode, int rdev)
wait_on_buffer (bh);
}
brelse(bh);
d_instantiate(dentry, inode, 0);
d_instantiate(dentry, inode);
return 0;
}
......@@ -503,7 +503,7 @@ int ext2_mkdir(struct inode * dir, struct dentry * dentry, int mode)
}
dir->i_nlink++;
mark_inode_dirty(dir);
d_instantiate(dentry, inode, D_DIR);
d_instantiate(dentry, inode);
brelse (bh);
return 0;
}
......@@ -775,7 +775,7 @@ int ext2_symlink (struct inode * dir, struct dentry *dentry, const char * symnam
wait_on_buffer (bh);
}
brelse (bh);
d_instantiate(dentry, inode, 0);
d_instantiate(dentry, inode);
return 0;
}
......@@ -810,7 +810,7 @@ int ext2_link (struct inode * inode, struct inode * dir, struct dentry *dentry)
inode->i_ctime = CURRENT_TIME;
mark_inode_dirty(inode);
atomic_inc(&inode->i_count);
d_instantiate(dentry, inode, 0);
d_instantiate(dentry, inode);
return 0;
}
......
......@@ -110,7 +110,8 @@ static int trunc_direct (struct inode * inode)
return retry;
}
static int trunc_indirect (struct inode * inode, int offset, u32 * p)
static int trunc_indirect (struct inode * inode, int offset, u32 * p,
int in_inode)
{
int i, tmp;
struct buffer_head * bh;
......@@ -124,16 +125,16 @@ static int trunc_indirect (struct inode * inode, int offset, u32 * p)
#define INDIRECT_BLOCK ((int)DIRECT_BLOCK - offset)
int indirect_block = INDIRECT_BLOCK;
tmp = *p;
tmp = in_inode ? *p : le32_to_cpu(*p);
if (!tmp)
return 0;
ind_bh = bread (inode->i_dev, tmp, inode->i_sb->s_blocksize);
if (tmp != *p) {
if (tmp != (in_inode ? *p : le32_to_cpu(*p))) {
brelse (ind_bh);
return 1;
}
if (!ind_bh) {
*p = 0;
*p = in_inode ? 0 : cpu_to_le32(0);
return 0;
}
repeat:
......@@ -184,100 +185,15 @@ static int trunc_indirect (struct inode * inode, int offset, u32 * p)
if (ind_bh->b_count != 1)
retry = 1;
else {
tmp = *p;
*p = 0;
tmp = in_inode ? *p : le32_to_cpu(*p);
*p = in_inode ? 0 : cpu_to_le32(0);
inode->i_blocks -= blocks;
mark_inode_dirty(inode);
ext2_free_blocks (inode, tmp, 1);
bforget(ind_bh);
ind_bh = NULL;
}
if (IS_SYNC(inode) && buffer_dirty(ind_bh)) {
ll_rw_block (WRITE, 1, &ind_bh);
wait_on_buffer (ind_bh);
}
brelse (ind_bh);
return retry;
}
static int trunc_indirect_swab32 (struct inode * inode, int offset, u32 * p)
{
int i, tmp;
struct buffer_head * bh;
struct buffer_head * ind_bh;
u32 * ind;
unsigned long block_to_free = 0;
unsigned long free_count = 0;
int retry = 0;
int addr_per_block = EXT2_ADDR_PER_BLOCK(inode->i_sb);
int blocks = inode->i_sb->s_blocksize / 512;
int indirect_block = INDIRECT_BLOCK;
tmp = le32_to_cpu(*p);
if (!tmp)
return 0;
ind_bh = bread (inode->i_dev, tmp, inode->i_sb->s_blocksize);
if (tmp != le32_to_cpu(*p)) {
brelse (ind_bh);
return 1;
}
if (!ind_bh) {
*p = cpu_to_le32(0);
return 0;
}
repeat:
for (i = indirect_block ; i < addr_per_block ; i++) {
if (i < 0)
i = 0;
if (i < indirect_block)
goto repeat;
ind = i + (u32 *) ind_bh->b_data;
tmp = le32_to_cpu(*ind);
if (!tmp)
continue;
bh = get_hash_table (inode->i_dev, tmp,
inode->i_sb->s_blocksize);
if (i < indirect_block) {
brelse (bh);
goto repeat;
}
if ((bh && bh->b_count != 1) || tmp != le32_to_cpu(*ind)) {
retry = 1;
brelse (bh);
continue;
}
*ind = cpu_to_le32(0);
mark_buffer_dirty(ind_bh, 1);
bforget(bh);
if (free_count == 0) {
block_to_free = tmp;
free_count++;
} else if (free_count > 0 && block_to_free == tmp - free_count)
free_count++;
else {
ext2_free_blocks (inode, block_to_free, free_count);
block_to_free = tmp;
free_count = 1;
}
/* ext2_free_blocks (inode, tmp, 1); */
inode->i_blocks -= blocks;
mark_inode_dirty(inode);
}
if (free_count > 0)
ext2_free_blocks (inode, block_to_free, free_count);
ind = (u32 *) ind_bh->b_data;
for (i = 0; i < addr_per_block; i++)
if (le32_to_cpu(*(ind++)))
break;
if (i >= addr_per_block)
if (ind_bh->b_count != 1)
retry = 1;
else {
tmp = le32_to_cpu(*p);
*p = cpu_to_le32(0);
inode->i_blocks -= blocks;
mark_inode_dirty(inode);
ext2_free_blocks (inode, tmp, 1);
}
if (IS_SYNC(inode) && buffer_dirty(ind_bh)) {
if (IS_SYNC(inode) && ind_bh && buffer_dirty(ind_bh)) {
ll_rw_block (WRITE, 1, &ind_bh);
wait_on_buffer (ind_bh);
}
......@@ -286,7 +202,7 @@ static int trunc_indirect_swab32 (struct inode * inode, int offset, u32 * p)
}
static int trunc_dindirect (struct inode * inode, int offset,
u32 * p)
u32 * p, int in_inode)
{
int i, tmp;
struct buffer_head * dind_bh;
......@@ -297,75 +213,16 @@ static int trunc_dindirect (struct inode * inode, int offset,
#define DINDIRECT_BLOCK (((int)DIRECT_BLOCK - offset) / addr_per_block)
int dindirect_block = DINDIRECT_BLOCK;
tmp = *p;
if (!tmp)
return 0;
dind_bh = bread (inode->i_dev, tmp, inode->i_sb->s_blocksize);
if (tmp != *p) {
brelse (dind_bh);
return 1;
}
if (!dind_bh) {
*p = 0;
return 0;
}
repeat:
for (i = dindirect_block ; i < addr_per_block ; i++) {
if (i < 0)
i = 0;
if (i < dindirect_block)
goto repeat;
dind = i + (u32 *) dind_bh->b_data;
tmp = le32_to_cpu(*dind);
if (!tmp)
continue;
retry |= trunc_indirect_swab32 (inode, offset + (i * addr_per_block),
dind);
mark_buffer_dirty(dind_bh, 1);
}
dind = (u32 *) dind_bh->b_data;
for (i = 0; i < addr_per_block; i++)
if (le32_to_cpu(*(dind++)))
break;
if (i >= addr_per_block)
if (dind_bh->b_count != 1)
retry = 1;
else {
tmp = *p;
*p = 0;
inode->i_blocks -= blocks;
mark_inode_dirty(inode);
ext2_free_blocks (inode, tmp, 1);
}
if (IS_SYNC(inode) && buffer_dirty(dind_bh)) {
ll_rw_block (WRITE, 1, &dind_bh);
wait_on_buffer (dind_bh);
}
brelse (dind_bh);
return retry;
}
static int trunc_dindirect_swab32 (struct inode * inode, int offset,
u32 * p)
{
int i, tmp;
struct buffer_head * dind_bh;
u32 * dind;
int retry = 0;
int addr_per_block = EXT2_ADDR_PER_BLOCK(inode->i_sb);
int blocks = inode->i_sb->s_blocksize / 512;
int dindirect_block = DINDIRECT_BLOCK;
tmp = le32_to_cpu(*p);
tmp = in_inode ? *p : le32_to_cpu(*p);
if (!tmp)
return 0;
dind_bh = bread (inode->i_dev, tmp, inode->i_sb->s_blocksize);
if (tmp != le32_to_cpu(*p)) {
if (tmp != (in_inode ? *p : le32_to_cpu(*p))) {
brelse (dind_bh);
return 1;
}
if (!dind_bh) {
*p = cpu_to_le32(0);
*p = in_inode ? 0 : cpu_to_le32(0);
return 0;
}
repeat:
......@@ -378,8 +235,8 @@ static int trunc_dindirect_swab32 (struct inode * inode, int offset,
tmp = le32_to_cpu(*dind);
if (!tmp)
continue;
retry |= trunc_indirect_swab32 (inode, offset + (i * addr_per_block),
dind);
retry |= trunc_indirect(inode, offset + (i * addr_per_block),
dind, 0);
mark_buffer_dirty(dind_bh, 1);
}
dind = (u32 *) dind_bh->b_data;
......@@ -390,13 +247,15 @@ static int trunc_dindirect_swab32 (struct inode * inode, int offset,
if (dind_bh->b_count != 1)
retry = 1;
else {
tmp = le32_to_cpu(*p);
*p = cpu_to_le32(0);
tmp = in_inode ? *p : le32_to_cpu(*p);
*p = in_inode ? 0 : cpu_to_le32(0);
inode->i_blocks -= blocks;
mark_inode_dirty(inode);
ext2_free_blocks (inode, tmp, 1);
bforget(dind_bh);
dind_bh = 0;
}
if (IS_SYNC(inode) && buffer_dirty(dind_bh)) {
if (IS_SYNC(inode) && dind_bh && buffer_dirty(dind_bh)) {
ll_rw_block (WRITE, 1, &dind_bh);
wait_on_buffer (dind_bh);
}
......@@ -436,9 +295,9 @@ static int trunc_tindirect (struct inode * inode)
if (i < tindirect_block)
goto repeat;
tind = i + (u32 *) tind_bh->b_data;
retry |= trunc_dindirect_swab32(inode, EXT2_NDIR_BLOCKS +
retry |= trunc_dindirect(inode, EXT2_NDIR_BLOCKS +
addr_per_block + (i + 1) * addr_per_block * addr_per_block,
tind);
tind, 0);
mark_buffer_dirty(tind_bh, 1);
}
tind = (u32 *) tind_bh->b_data;
......@@ -454,8 +313,10 @@ static int trunc_tindirect (struct inode * inode)
inode->i_blocks -= blocks;
mark_inode_dirty(inode);
ext2_free_blocks (inode, tmp, 1);
bforget(tind_bh);
tind_bh = 0;
}
if (IS_SYNC(inode) && buffer_dirty(tind_bh)) {
if (IS_SYNC(inode) && tind_bh && buffer_dirty(tind_bh)) {
ll_rw_block (WRITE, 1, &tind_bh);
wait_on_buffer (tind_bh);
}
......@@ -479,10 +340,10 @@ void ext2_truncate (struct inode * inode)
while (1) {
retry = trunc_direct(inode);
retry |= trunc_indirect (inode, EXT2_IND_BLOCK,
(u32 *) &inode->u.ext2_i.i_data[EXT2_IND_BLOCK]);
(u32 *) &inode->u.ext2_i.i_data[EXT2_IND_BLOCK], 1);
retry |= trunc_dindirect (inode, EXT2_IND_BLOCK +
EXT2_ADDR_PER_BLOCK(inode->i_sb),
(u32 *) &inode->u.ext2_i.i_data[EXT2_DIND_BLOCK]);
(u32 *) &inode->u.ext2_i.i_data[EXT2_DIND_BLOCK], 1);
retry |= trunc_tindirect (inode);
if (!retry)
break;
......
......@@ -8,7 +8,6 @@
#include <linux/config.h>
#include <linux/fs.h>
#include <linux/nametrans.h>
#include <linux/minix_fs.h>
#include <linux/ext2_fs.h>
......@@ -45,10 +44,6 @@ __initfunc(static void do_sys_setup(void))
binfmt_setup();
#ifdef CONFIG_TRANS_NAMES
init_nametrans();
#endif
#ifdef CONFIG_EXT2_FS
init_ext2_fs();
#endif
......
......@@ -7,8 +7,6 @@
#include <linux/fs.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/dalloc.h>
#include <linux/list.h>
/*
* New inode.c implementation.
......@@ -105,6 +103,7 @@ static inline void init_once(struct inode * inode)
{
memset(inode, 0, sizeof(*inode));
init_waitqueue(&inode->i_wait);
INIT_LIST_HEAD(&inode->i_dentry);
sema_init(&inode->i_sem, 1);
}
......@@ -301,6 +300,7 @@ void clean_inode(struct inode *inode)
inode->i_sock = 0;
inode->i_op = NULL;
inode->i_nlink = 1;
inode->i_writecount = 0;
memset(&inode->i_dquot, 0, sizeof(inode->i_dquot));
sema_init(&inode->i_sem, 1);
}
......
......@@ -18,7 +18,6 @@
#include <linux/string.h>
#include <linux/stat.h>
#include <linux/locks.h>
#include <linux/dalloc.h>
#include <linux/init.h>
#include <asm/system.h>
......
......@@ -227,7 +227,7 @@ int minix_create(struct inode * dir, struct dentry *dentry, int mode)
de->inode = inode->i_ino;
mark_buffer_dirty(bh, 1);
brelse(bh);
d_instantiate(dentry, inode, 0);
d_instantiate(dentry, inode);
return 0;
}
......@@ -280,7 +280,7 @@ int minix_mknod(struct inode * dir, struct dentry *dentry, int mode, int rdev)
de->inode = inode->i_ino;
mark_buffer_dirty(bh, 1);
brelse(bh);
d_instantiate(dentry, inode, 0);
d_instantiate(dentry, inode);
return 0;
}
......@@ -340,7 +340,7 @@ int minix_mkdir(struct inode * dir, struct dentry *dentry, int mode)
dir->i_nlink++;
dir->i_dirt = 1;
brelse(bh);
d_instantiate(dentry, inode, D_DIR);
d_instantiate(dentry, inode);
return 0;
}
......@@ -563,7 +563,7 @@ int minix_symlink(struct inode * dir, struct dentry *dentry,
de->inode = inode->i_ino;
mark_buffer_dirty(bh, 1);
brelse(bh);
d_instantiate(dentry, inode, 0);
d_instantiate(dentry, inode);
return 0;
}
......@@ -598,7 +598,7 @@ int minix_link(struct inode * inode, struct inode * dir,
inode->i_nlink++;
inode->i_ctime = CURRENT_TIME;
inode->i_dirt = 1;
d_instantiate(dentry, inode, 0);
d_instantiate(dentry, inode);
return 0;
}
......
......@@ -19,10 +19,7 @@
#include <linux/fcntl.h>
#include <linux/stat.h>
#include <linux/mm.h>
#include <linux/dalloc.h>
#include <linux/nametrans.h>
#include <linux/proc_fs.h>
#include <linux/omirr.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
......@@ -236,9 +233,9 @@ void put_write_access(struct inode * inode)
* We get the directory semaphore, and after getting that we also
* make sure that nobody added the entry to the dcache in the meantime..
*/
static struct dentry * real_lookup(struct dentry * dentry, struct qstr * name)
static struct dentry * real_lookup(struct dentry * parent, struct qstr * name)
{
struct inode *dir = dentry->d_inode;
struct inode *dir = parent->d_inode;
struct dentry *result;
struct inode *inode;
int error = -ENOTDIR;
......@@ -252,26 +249,21 @@ static struct dentry * real_lookup(struct dentry * dentry, struct qstr * name)
if (!error || error == -ENOENT) {
struct dentry *new;
int isdir = 0, flags = D_NOCHECKDUP;
if (error) {
flags = D_NEGATIVE;
if (error)
inode = NULL;
} else if (S_ISDIR(inode->i_mode)) {
isdir = 1;
flags = D_DIR|D_NOCHECKDUP;
}
new = d_alloc(dentry, name, isdir);
new = d_alloc(parent, name);
/*
* Ok, now we can't sleep any more. Double-check that
* nobody else added this in the meantime..
*/
result = d_lookup(dentry, name);
result = d_lookup(parent, name);
if (result) {
d_free(new);
} else {
d_add(new, inode, flags);
d_add(new, inode);
result = new;
}
}
......@@ -280,16 +272,39 @@ static struct dentry * real_lookup(struct dentry * dentry, struct qstr * name)
}
/* Internal lookup() using the new generic dcache. */
static inline struct dentry * cached_lookup(struct dentry * dentry, struct qstr * name)
static inline struct dentry * cached_lookup(struct dentry * parent, struct qstr * name)
{
return d_lookup(dentry, name);
struct dentry * dentry = d_lookup(parent, name);
if (dentry) {
/*
* FIXME! We should have something like
dentry = dentry->revalidate(dentry);
* here - we need to ask the low-level filesystem permission
* to use the cached entry (NFS needs to time them out, and
* /proc might go away etc).
*/
/*
* The parent d_count _should_ be at least 2: one for the
* dentry we found, and one for the fact that we are using
* it.
*/
if (parent->d_count <= 1) {
printk("lookup of %s success in %s, but parent count is %d\n",
dentry->d_name, parent->d_name, parent->d_count);
}
}
return dentry;
}
/*
* "." and ".." are special - ".." especially so because it has to be able
* to know about the current root directory and parent relationships
*/
static struct dentry * reserved_lookup(struct dentry * dir, struct qstr * name)
static struct dentry * reserved_lookup(struct dentry * parent, struct qstr * name)
{
struct dentry *result = NULL;
if (name->name[0] == '.') {
......@@ -300,12 +315,12 @@ static struct dentry * reserved_lookup(struct dentry * dir, struct qstr * name)
if (name->name[1] != '.')
break;
if (dir != current->fs->root) {
dir = dir->d_covers->d_parent;
if (parent != current->fs->root) {
parent = parent->d_covers->d_parent;
}
/* fallthrough */
case 1:
result = dget(dir);
result = dget(parent);
break;
}
}
......@@ -425,7 +440,7 @@ struct dentry * lookup_dentry(const char * name, struct dentry * base, int follo
dentry = lookup(base, &this);
if (IS_ERR(dentry))
break;
if (dentry->d_flag & D_NEGATIVE)
if (!dentry->d_inode)
break;
/* Last component? */
......@@ -466,8 +481,8 @@ int __namei(const char *pathname, struct inode **res_inode, int follow_link)
if (!IS_ERR(dentry)) {
error = -ENOENT;
if (dentry) {
if (!(dentry->d_flag & D_NEGATIVE)) {
struct inode *inode = dentry->d_inode;
struct inode *inode = dentry->d_inode;
if (inode) {
atomic_inc(&inode->i_count);
*res_inode = inode;
error = 0;
......@@ -509,20 +524,21 @@ static inline struct inode *lock_parent(struct dentry *dentry)
* which is a lot more logical, and also allows the "no perm" needed
* for symlinks (where the permissions are checked later).
*/
int open_namei(const char * pathname, int flag, int mode,
struct inode ** res_inode, struct dentry * base)
int open_namei(const char * pathname, int flag, int mode, struct inode ** res_inode)
{
int error;
int acc_mode;
struct inode *inode;
struct dentry *dentry;
mode &= S_IALLUGO & ~current->fs->umask;
mode |= S_IFREG;
dentry = lookup_dentry(pathname, base, 1);
dentry = lookup_dentry(pathname, NULL, 1);
if (IS_ERR(dentry))
return PTR_ERR(dentry);
acc_mode = ACC_MODE(flag);
if (flag & O_CREAT) {
struct inode *dir;
......@@ -531,7 +547,7 @@ int open_namei(const char * pathname, int flag, int mode,
* The existence test must be done _after_ getting the directory
* semaphore - the dentry might otherwise change.
*/
if (!(dentry->d_flag & D_NEGATIVE)) {
if (dentry->d_inode) {
error = 0;
if (flag & O_EXCL)
error = -EEXIST;
......@@ -543,6 +559,8 @@ int open_namei(const char * pathname, int flag, int mode,
if (dir->i_sb && dir->i_sb->dq_op)
dir->i_sb->dq_op->initialize(dir, -1);
error = dir->i_op->create(dir, dentry, mode);
/* Don't check for write permission */
acc_mode = 0;
}
up(&dir->i_sem);
iput(dir);
......@@ -551,15 +569,15 @@ int open_namei(const char * pathname, int flag, int mode,
}
error = -ENOENT;
if (dentry->d_flag & D_NEGATIVE)
inode = dentry->d_inode;
if (!inode)
goto exit;
inode = dentry->d_inode;
error = -EISDIR;
if (S_ISDIR(inode->i_mode) && (flag & 2))
if (S_ISDIR(inode->i_mode) && (flag & FMODE_WRITE))
goto exit;
error = permission(inode,ACC_MODE(flag));
error = permission(inode,acc_mode);
if (error)
goto exit;
......@@ -636,7 +654,7 @@ int do_mknod(const char * filename, int mode, dev_t dev)
dir = lock_parent(dentry);
error = -EEXIST;
if (!(dentry->d_flag & D_NEGATIVE))
if (dentry->d_inode)
goto exit_lock;
error = -EROFS;
......@@ -710,7 +728,7 @@ static inline int do_mkdir(const char * pathname, int mode)
dir = lock_parent(dentry);
error = -EEXIST;
if (!(dentry->d_flag & D_NEGATIVE))
if (dentry->d_inode)
goto exit_lock;
error = -EROFS;
......@@ -766,7 +784,7 @@ static inline int do_rmdir(const char * name)
dir = lock_parent(dentry);
error = -ENOENT;
if (dentry->d_flag & D_NEGATIVE)
if (!dentry->d_inode)
goto exit_lock;
error = -EROFS;
......@@ -894,7 +912,7 @@ static inline int do_symlink(const char * oldname, const char * newname)
goto exit;
error = -EEXIST;
if (!(dentry->d_flag & D_NEGATIVE))
if (dentry->d_inode)
goto exit;
dir = lock_parent(dentry);
......@@ -961,18 +979,18 @@ static inline int do_link(const char * oldname, const char * newname)
dir = lock_parent(new_dentry);
error = -ENOENT;
if (old_dentry->d_flag & D_NEGATIVE)
inode = old_dentry->d_inode;
if (!inode)
goto exit_lock;
error = -EEXIST;
if (!(new_dentry->d_flag & D_NEGATIVE))
if (new_dentry->d_inode)
goto exit_lock;
error = -EROFS;
if (IS_RDONLY(dir))
goto exit_lock;
inode = old_dentry->d_inode;
error = -EXDEV;
if (dir->i_dev != inode->i_dev)
goto exit_lock;
......@@ -1067,7 +1085,7 @@ static inline int do_rename(const char * oldname, const char * newname)
double_down(&new_dir->i_sem, &old_dir->i_sem);
error = -ENOENT;
if (old_dentry->d_flag & D_NEGATIVE)
if (!old_dentry->d_inode)
goto exit_lock;
error = permission(old_dir,MAY_WRITE | MAY_EXEC);
......
......@@ -395,7 +395,7 @@ static int nfs_create(struct inode *dir, struct dentry * dentry, int mode)
if (!inode)
return -EACCES;
d_instantiate(dentry, inode, 0);
d_instantiate(dentry, inode);
return 0;
}
......@@ -434,7 +434,7 @@ static int nfs_mknod(struct inode *dir, struct dentry *dentry, int mode, int rde
if (!inode)
return -EACCES;
d_instantiate(dentry, inode, 0);
d_instantiate(dentry, inode);
return 0;
}
......@@ -471,7 +471,7 @@ static int nfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
if (!inode)
return -EACCES;
d_instantiate(dentry, inode, D_DIR);
d_instantiate(dentry, inode);
return 0;
}
......@@ -561,7 +561,7 @@ static int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *sym
if (!inode)
return -EACCES;
d_instantiate(dentry, inode, 0);
d_instantiate(dentry, inode);
return 0;
}
......@@ -588,7 +588,7 @@ static int nfs_link(struct inode *inode, struct inode *dir, struct dentry *dentr
return error;
atomic_inc(&inode->i_count);
d_instantiate(dentry, inode, 0);
d_instantiate(dentry, inode);
return 0;
}
......
......@@ -4,7 +4,6 @@
* Copyright (C) 1991, 1992 Linus Torvalds
*/
#include <linux/config.h>
#include <linux/vfs.h>
#include <linux/types.h>
#include <linux/utime.h>
......@@ -21,7 +20,6 @@
#include <linux/file.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/omirr.h>
#include <asm/uaccess.h>
#include <asm/bitops.h>
......@@ -211,11 +209,6 @@ asmlinkage int sys_utime(char * filename, struct utimbuf * times)
goto iput_and_out;
}
error = notify_change(inode, &newattrs);
#ifdef CONFIG_OMIRR
if(!error)
omirr_printall(inode, " U %ld %ld %ld ", CURRENT_TIME,
newattrs.ia_atime, newattrs.ia_mtime);
#endif
iput_and_out:
iput(inode);
out:
......@@ -257,11 +250,6 @@ asmlinkage int sys_utimes(char * filename, struct timeval * utimes)
goto iput_and_out;
}
error = notify_change(inode, &newattrs);
#ifdef CONFIG_OMIRR
if(!error)
omirr_printall(inode, " U %ld %ld %ld ", CURRENT_TIME,
newattrs.ia_atime, newattrs.ia_mtime);
#endif
iput_and_out:
iput(inode);
out:
......@@ -312,11 +300,11 @@ asmlinkage int sys_chdir(const char * filename)
goto out;
error = -ENOENT;
if (dentry->d_flag & D_NEGATIVE)
inode = dentry->d_inode;
if (!inode)
goto dput_and_out;
error = -ENOTDIR;
inode = dentry->d_inode;
if (!S_ISDIR(inode->i_mode))
goto dput_and_out;
......@@ -340,7 +328,6 @@ asmlinkage int sys_fchdir(unsigned int fd)
{
struct file *file;
struct inode *inode;
struct dentry *dentry, *tmp;
int error;
lock_kernel();
......@@ -361,10 +348,14 @@ asmlinkage int sys_fchdir(unsigned int fd)
if (error)
goto out;
dentry = dget(inode->i_dentry);
tmp = current->fs->pwd;
current->fs->pwd = dentry;
dput(tmp);
{
struct dentry *dentry, *tmp;
dentry = dget(i_dentry(inode));
tmp = current->fs->pwd;
current->fs->pwd = dentry;
dput(tmp);
}
out:
unlock_kernel();
return error;
......@@ -384,11 +375,11 @@ asmlinkage int sys_chroot(const char * filename)
goto out;
error = -ENOENT;
if (dentry->d_flag & D_NEGATIVE)
inode = dentry->d_inode;
if (!inode)
goto dput_and_out;
error = -ENOTDIR;
inode = dentry->d_inode;
if (!S_ISDIR(inode->i_mode))
goto dput_and_out;
......@@ -619,7 +610,7 @@ static int do_open(const char * filename,int flags,int mode, int fd)
flag++;
if (flag & O_TRUNC)
flag |= 2;
error = open_namei(filename,flag,mode,&inode,NULL);
error = open_namei(filename,flag,mode,&inode);
if (error)
goto cleanup_file;
if (f->f_mode & FMODE_WRITE) {
......
......@@ -14,7 +14,6 @@
#include <linux/mm.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/dalloc.h>
static int proc_readlink(struct inode *, char *, int);
static struct dentry * proc_follow_link(struct inode *, struct dentry *);
......@@ -105,7 +104,7 @@ static struct dentry * proc_follow_link(struct inode *inode, struct dentry *base
vma = p->mm->mmap;
while (vma) {
if (vma->vm_flags & VM_EXECUTABLE)
return dget(vma->vm_inode->i_dentry);
return dget(i_dentry(vma->vm_inode));
vma = vma->vm_next;
}
......@@ -123,7 +122,7 @@ static struct dentry * proc_follow_link(struct inode *inode, struct dentry *base
break;
if (!p->files->fd[ino]->f_inode)
break;
result = dget(p->files->fd[ino]->f_inode->i_dentry);
result = dget(i_dentry(p->files->fd[ino]->f_inode));
break;
}
}
......
......@@ -7,7 +7,6 @@
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/dalloc.h>
#include <linux/omirr.h>
#include <asm/uaccess.h>
......
......@@ -33,7 +33,6 @@
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/fd.h>
#include <linux/dalloc.h>
#include <linux/init.h>
#include <asm/system.h>
......@@ -745,7 +744,7 @@ int do_mount(kdev_t dev, const char * dev_name, const char * dir_name, const cha
if (IS_ERR(dir_d))
return error;
if (dir_d->d_flag & D_NEGATIVE) {
if (!dir_d->d_inode) {
dput(dir_d);
return -ENOENT;
}
......
/* $Revision: 1.7 $$Date: 1997/03/26 10:30:00 $
/* $Revision: 2.0 $$Date: 1997/06/30 10:30:00 $
* linux/include/linux/cyclades.h
*
* This file is maintained by Marcio Saito <marcio@cyclades.com> and
......@@ -6,6 +6,14 @@
*
* This file contains the general definitions for the cyclades.c driver
*$Log: cyclades.h,v $
*Revision 2.0 1997/06/30 10:30:00 ivan
*added some new doorbell command constants related to IOCTLW and
*UART error signaling
*
*Revision 1.8 1997/06/03 15:30:00 ivan
*added constant ZFIRM_HLT
*added constant CyPCI_Ze_win ( = 2 * Cy_PCI_Zwin)
*
*Revision 1.7 1997/03/26 10:30:00 daniel
*new entries at the end of cyclades_port struct to reallocate
*variables illegally allocated within card memory.
......@@ -86,6 +94,8 @@ typedef unsigned char ucchar; /* 8 bits, unsigned */
*/
#define DP_WINDOW_SIZE (0x00080000) /* window size 512 Kb */
#define ZE_DP_WINDOW_SIZE (0x00100000) /* window size 1 Mb (Ze and
8Zo V.2 */
#define CTRL_WINDOW_SIZE (0x00000100) /* runtime regs 256 bytes */
/*
......@@ -183,6 +193,7 @@ struct RUNTIME_9060 {
#define ID_ADDRESS 0x00000180L /* signature/pointer address */
#define ZFIRM_ID 0x5557465AL /* ZFIRM/U signature */
#define ZFIRM_HLT 0x59505B5CL /* ZFIRM needs external power supply */
struct FIRM_ID {
uclong signature; /* ZFIRM/U signature */
uclong zfwctrl_addr; /* pointer to ZFW_CTRL structure */
......@@ -238,7 +249,10 @@ struct FIRM_ID {
#define C_IN_RXBRK 0x00001000 /* Break received */
#define C_IN_PR_ERROR 0x00002000 /* parity error */
#define C_IN_FR_ERROR 0x00004000 /* frame error */
#define C_IN_OVR_ERROR 0x00008000 /* overrun error */
#define C_IN_RXOFL 0x00010000 /* RX buffer overflow */
#define C_IN_IOCTLW 0x00020000 /* I/O control w/ wait */
/* flow control */
#define C_FL_OXX 0x00000001 /* output Xon/Xoff flow control */
......@@ -294,6 +308,8 @@ struct FIRM_ID {
#define C_CM_RXBRK 0x84 /* Break received */
#define C_CM_PR_ERROR 0x85 /* Parity error */
#define C_CM_FR_ERROR 0x86 /* Frame error */
#define C_CM_OVR_ERROR 0x87 /* Overrun error */
#define C_CM_RXOFL 0x88 /* RX buffer overflow */
#define C_CM_CMDERROR 0x90 /* command error */
#define C_CM_FATAL 0x91 /* fatal error */
#define C_CM_HW_RESET 0x92 /* reset board */
......@@ -468,9 +484,10 @@ struct cyclades_port {
#define CyMaxChipsPerCard 8
#define CyPCI_Ywin 0x4000
#define CyPCI_Zctl 0x100
#define CyPCI_Zwin 0x80000
#define CyPCI_Ywin 0x4000
#define CyPCI_Zctl 0x100
#define CyPCI_Zwin 0x80000
#define CyPCI_Ze_win (2 * CyPCI_Zwin)
/**** CD1400 registers ****/
......
#ifndef DALLOC_H
#define DALLOC_H
#ifndef __LINUX_DCACHE_H
#define __LINUX_DCACHE_H
/*
* $Id: dalloc.h,v 1.3 1997/06/13 04:39:34 davem Exp $
* linux/include/linux/dcache.h
*
* include/linux/dalloc.h - alloc routines for dcache
* alloc / free space for pathname strings
* Copyright (C) 1997, Thomas Schoebel-Theuer,
* <schoebel@informatik.uni-stuttgart.de>.
* Directory cache data structures
*/
#define D_MAXLEN 1024
/* public flags for d_add() */
#define D_NORMAL 0
#define D_BASKET 1 /* put into basket (deleted/unref'd files) */
#define D_DUPLICATE 2 /* allow duplicate entries */
#define D_NOCHECKDUP 4 /* no not check for duplicates */
#define D_NEGATIVE 8 /* negative entry */
#define D_PRELOADED 16
#define D_DIR 32 /* directory entry - look out for allocation issues */
#define D_HASHED 64
#define D_ZOMBIE 128
#define D_INC_DDIR 512
/* public flags for d_del() */
#define D_REMOVE 0
#define D_NO_CLEAR_INODE 1
#define IS_ROOT(x) ((x) == (x)->d_parent)
/* "quick string" -- I introduced this to shorten the parameter list
* of many routines. Think of it as a (str,stlen,hash) pair.
* Storing the len instead of doing strlen() very often is performance
* critical.
/*
* "quick string" -- eases parameter passing, but more importantly
* saves "metadata" about the string (ie length and the hash).
*/
struct qstr {
const unsigned char * name;
int len, hash;
unsigned int len, hash;
};
/* Name hashing routines. Initial hash value */
......@@ -58,63 +39,44 @@ static inline unsigned long end_name_hash(unsigned long hash)
}
struct dentry {
unsigned int d_flag;
unsigned int d_count;
struct inode * d_inode; /* Where the name belongs to */
int d_count;
unsigned int d_flags;
struct inode * d_inode; /* Where the name belongs to - NULL is negative */
struct dentry * d_parent; /* parent directory */
struct dentry * d_mounts; /* mount information */
struct dentry * d_covers;
struct dentry * d_next; /* hardlink aliasname / empty list */
struct dentry * d_prev; /* hardlink aliasname */
struct dentry * d_hash_next;
struct dentry * d_hash_prev;
struct dentry * d_basket_next;
struct dentry * d_basket_prev;
struct list_head d_list; /* hardlink aliasname / empty list */
struct list_head d_hash;
struct qstr d_name;
};
extern struct dentry * the_root;
/*
* These are the low-level FS interfaces to the dcache..
*/
extern void d_instantiate(struct dentry *, struct inode *, int);
extern void d_instantiate(struct dentry *, struct inode *);
extern void d_delete(struct dentry *);
/* Note that all these routines must be called with vfs_lock() held */
/* get inode, if necessary retrieve it with iget() */
extern blocking struct inode * d_inode(struct dentry ** changing_entry);
extern struct inode * d_inode(struct dentry ** changing_entry);
/* allocate/de-allocate */
extern void d_free(struct dentry *);
extern struct dentry * d_alloc(struct dentry * parent, struct qstr *name, int isdir);
extern struct dentry * d_alloc(struct dentry * parent, const struct qstr *name);
/* only used at mount-time */
extern blocking
struct dentry * d_alloc_root(struct inode * root_inode, struct dentry * old_root);
extern struct dentry * d_alloc_root(struct inode * root_inode, struct dentry * old_root);
/*
* This adds the entry to the hash queues and initializes "d_inode".
* The entry was actually filled in earlier during "d_alloc()"
*/
extern blocking
void d_add(struct dentry * entry, struct inode * inode, int flags);
/* combination of d_alloc() and d_add(), less lookup overhead */
extern blocking
struct dentry * d_entry(struct dentry * parent, struct qstr * name, struct inode * inode);
extern blocking
void d_entry_preliminary(struct dentry * parent, struct qstr * name, unsigned long ino);
/* recursive d_del() all successors */
extern blocking
void d_del(struct dentry * entry, int flags);
extern void d_add(struct dentry * entry, struct inode * inode);
/* used for rename() and baskets */
extern blocking
void d_move(struct dentry * entry, struct dentry * newparent, struct qstr * newname);
extern void d_move(struct dentry * entry, struct dentry * newparent, struct qstr * newname);
/* appendix may either be NULL or be used for transname suffixes */
extern struct dentry * d_lookup(struct dentry * dir, struct qstr * name);
......@@ -122,19 +84,7 @@ extern struct dentry * d_lookup(struct dentry * dir, struct qstr * name);
/* write full pathname into buffer and return length */
extern int d_path(struct dentry * entry, struct dentry * chroot, char * buf);
extern struct dentry * d_basket(struct dentry * dir_entry);
extern int d_isbasket(struct dentry * entry);
/*
* Whee..
*/
static inline void dput(struct dentry *dentry)
{
if (dentry)
dentry->d_count--;
}
/* Allocation counts.. */
static inline struct dentry * dget(struct dentry *dentry)
{
if (dentry)
......@@ -142,4 +92,14 @@ static inline struct dentry * dget(struct dentry *dentry)
return dentry;
}
#endif
extern void dput(struct dentry *);
/*
* This is ugly. The inode:dentry relationship is a 1:n
* relationship, so we have to return one (random) dentry
* from the list. We select the first one..
*/
#define i_dentry(inode) \
list_entry((inode)->i_dentry.next, struct dentry, d_list)
#endif /* __LINUX_DCACHE_H */
......@@ -16,16 +16,12 @@
#include <linux/kdev_t.h>
#include <linux/ioctl.h>
#include <linux/list.h>
#include <linux/dcache.h>
#include <asm/atomic.h>
#include <asm/bitops.h>
/* Prefixes for routines (having no effect), but indicate what
* the routine may do. This can greatly ease reasoning about routines...
*/
#define blocking /*routine may schedule()*/
#include <linux/dalloc.h>
/*
* It's silly to have NR_OPEN bigger than NR_FILE, but I'll fix
......@@ -155,7 +151,7 @@ extern int max_files, nr_files;
extern void buffer_init(void);
extern void inode_init(void);
extern void file_table_init(void);
extern unsigned long name_cache_init(unsigned long start, unsigned long end);
extern void dcache_init(void);
typedef char buffer_block[BLOCK_SIZE];
......@@ -331,7 +327,7 @@ struct inode {
struct page *i_pages;
struct dquot *i_dquot[MAXQUOTAS];
struct dentry *i_dentry;
struct list_head i_dentry;
unsigned int i_state;
......@@ -685,8 +681,7 @@ extern int notify_change(struct inode *, struct iattr *);
extern int permission(struct inode * inode,int mask);
extern int get_write_access(struct inode *inode);
extern void put_write_access(struct inode *inode);
extern int open_namei(const char * pathname, int flag, int mode,
struct inode ** res_inode, struct dentry * base);
extern int open_namei(const char * pathname, int flag, int mode, struct inode ** res_inode);
extern int do_mknod(const char * filename, int mode, dev_t dev);
extern int do_pipe(int *);
......@@ -738,18 +733,18 @@ extern inline void vfs_unlock(void)
extern void _get_inode(struct inode * inode);
extern void iput(struct inode * inode);
extern blocking struct inode * iget(struct super_block * sb, unsigned long nr);
extern blocking void clear_inode(struct inode * inode);
extern blocking struct inode * get_empty_inode(void);
extern struct inode * iget(struct super_block * sb, unsigned long nr);
extern void clear_inode(struct inode * inode);
extern struct inode * get_empty_inode(void);
/* Please prefer to use this function in future, instead of using
* a get_empty_inode()/insert_inode_hash() combination.
* It allows for better checking and less race conditions.
*/
blocking struct inode * get_empty_inode_hashed(dev_t i_dev, unsigned long i_ino);
extern struct inode * get_empty_inode_hashed(dev_t i_dev, unsigned long i_ino);
extern void insert_inode_hash(struct inode *);
extern blocking struct inode * get_pipe_inode(void);
extern struct inode * get_pipe_inode(void);
extern int get_unused_fd(void);
extern void put_unused_fd(int);
extern struct file * get_empty_filp(void);
......
#ifndef NAMETRANS_H
#define NAMETRANS_H
/*
* $Id: nametrans.h,v 1.1 1997/06/04 08:26:57 davem Exp $
*
* include/linux/nametrans.h - context-dependend filename suffixes.
* Copyright (C) 1997, Thomas Schoebel-Theuer,
* <schoebel@informatik.uni-stuttgart.de>.
*/
#include <linux/dalloc.h>
#include <linux/sysctl.h>
#define MAX_DEFAULT_TRANSLEN 128
/* only filenames matching the following length restrictions can be
* translated. I introduced these restrictions because they *greatly*
* simplify buffer management (no need to allocate kernel pages and free them).
* The maximal total length of a context-dependend filename is the
* sum of both constants. */
#define MAX_TRANS_FILELEN 128 /* max len of a name that could be translated */
#define MAX_TRANS_SUFFIX 64 /* max len of a #keyword=value# suffix */
/* max number of translations */
#define MAX_TRANSLATIONS 16
struct translations {
int count;
struct qstr name[MAX_TRANSLATIONS];
struct qstr c_name[MAX_TRANSLATIONS];
};
/* global/default translations */
extern char nametrans_txt[MAX_DEFAULT_TRANSLEN];
/* Any changer of a built-in translation must set this flag */
extern int translations_dirty;
/* called once at boot time */
extern void init_nametrans(void);
/* set global translations */
extern void nametrans_setup(char * line);
/* return reusable global buffer. needed by VFS. */
struct translations * get_translations(char * env);
/* if the _first_ environment variable is "NAMETRANS", return
* a pointer to the list of appendices.
* You can set the first environment variable using
* 'env - NAMETRANS=... "`env`" command ...'
*/
extern char * env_transl(void);
/* if name has the correct suffix "#keyword=correct_context#",
* return position of the suffix, else 0.
*/
extern char* testname(int restricted, char* name);
/* for use in kernel/sysctrl.h */
extern int nametrans_dostring(ctl_table * table, int write, struct file * filp,
void * buffer, size_t * lenp);
extern int nametrans_string(ctl_table * table, int * name, int nlen,
void * oldval, size_t * oldlenp,
void * newval, size_t newlen, void ** context);
#endif
/*
* fs/proc/omirr.c - online mirror support
*
* (C) 1997 Thomas Schoebel-Theuer
*/
#ifndef OMIRR_H
#define OMIRR_H
#include <linux/fs.h>
#include <linux/dalloc.h>
extern int omirr_print(struct dentry * ent1, struct dentry * ent2,
struct qstr * suffix, const char * fmt, ...);
extern int omirr_printall(struct inode * inode, const char * fmt, ...);
#endif
......@@ -57,7 +57,7 @@ extern void kmem_cache_free(kmem_cache_t *, void *);
extern void *kmalloc(size_t, int);
extern void kfree(const void *);
extern void kfree_s(void *, size_t);
extern void kfree_s(const void *, size_t);
extern int kmem_cache_reap(int, int, int);
extern int get_slabinfo(char *);
......
......@@ -32,7 +32,6 @@
#include <linux/slab.h>
#include <linux/major.h>
#include <linux/blk.h>
#include <linux/nametrans.h>
#include <linux/init.h>
#ifdef CONFIG_ROOT_NFS
#include <linux/nfs_fs.h>
......@@ -558,12 +557,6 @@ __initfunc(static int checksetup(char *line))
ide_setup(line);
return 1;
}
#endif
#ifdef CONFIG_TRANS_NAMES
if(!strncmp(line,"nametrans=",10)) {
nametrans_setup(line+10);
return 1;
}
#endif
while (bootsetups[i].str) {
int n = strlen(bootsetups[i].str);
......@@ -886,7 +879,6 @@ __initfunc(asmlinkage void start_kernel(void))
memory_start = kmem_cache_init(memory_start, memory_end);
sti();
calibrate_delay();
memory_start = name_cache_init(memory_start,memory_end);
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start && !initrd_below_start_ok && initrd_start < memory_start) {
printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - "
......@@ -901,6 +893,7 @@ __initfunc(asmlinkage void start_kernel(void))
#endif
uidcache_init();
filescache_init();
dcache_init();
vma_init();
buffer_init();
inode_init();
......
......@@ -21,7 +21,6 @@
#include <linux/fcntl.h>
#include <linux/acct.h>
#include <linux/tty.h>
#include <linux/nametrans.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/notifier.h>
......@@ -431,7 +430,7 @@ asmlinkage int sys_acct(const char *name)
if ((error = getname(name, &tmp)) != 0)
goto out;
error = open_namei(tmp, O_RDWR, 0600, &inode, 0);
error = open_namei(tmp, O_RDWR, 0600, &inode);
putname(tmp);
if (error)
goto out;
......
......@@ -16,7 +16,6 @@
#include <linux/mm.h>
#include <linux/sysctl.h>
#include <linux/swapctl.h>
#include <linux/nametrans.h>
#include <linux/proc_fs.h>
#include <linux/malloc.h>
#include <linux/stat.h>
......@@ -172,10 +171,6 @@ static ctl_table kern_table[] = {
{KERN_JAVA_APPLETVIEWER, "java-appletviewer", binfmt_java_appletviewer,
64, 0644, NULL, &proc_dostring, &sysctl_string },
#endif
#ifdef CONFIG_TRANS_NAMES
{KERN_NAMETRANS, "nametrans", nametrans_txt, MAX_DEFAULT_TRANSLEN,
0644, NULL, &nametrans_dostring, &nametrans_string},
#endif
#ifdef __sparc__
{KERN_SPARC_REBOOT, "reboot-cmd", reboot_command,
256, 0644, NULL, &proc_dostring, &sysctl_string },
......
......@@ -1275,7 +1275,7 @@ kmem_report_alloc_err(const char *str, kmem_cache_t * cachep)
}
static void
kmem_report_free_err(const char *str, void *objp, kmem_cache_t * cachep)
kmem_report_free_err(const char *str, const void *objp, kmem_cache_t * cachep)
{
if (cachep)
SLAB_STATS_INC_ERR(cachep);
......@@ -1456,7 +1456,7 @@ __kmem_cache_alloc(kmem_cache_t *cachep, int flags)
* it should be in this state _before_ it is released.
*/
static inline void
__kmem_cache_free(kmem_cache_t *cachep, void *objp)
__kmem_cache_free(kmem_cache_t *cachep, const void *objp)
{
kmem_slab_t *slabp;
kmem_bufctl_t *bufp;
......@@ -1653,7 +1653,7 @@ kfree(const void *objp)
}
void
kfree_s(void *objp, size_t size)
kfree_s(const void *objp, size_t size)
{
struct page *page;
int nr;
......
......@@ -67,7 +67,6 @@
#include <linux/socket.h>
#include <linux/fcntl.h>
#include <linux/file.h>
#include <linux/dalloc.h>
#include <linux/net.h>
#include <linux/interrupt.h>
#include <linux/netdevice.h>
......
......@@ -459,7 +459,7 @@ static unix_socket *unix_find_other(struct sockaddr_un *sunname, int len,
{
old_fs=get_fs();
set_fs(get_ds());
err = open_namei(sunname->sun_path, 2, S_IFSOCK, &inode, NULL);
err = open_namei(sunname->sun_path, 2, S_IFSOCK, &inode);
set_fs(old_fs);
if(err<0)
{
......@@ -550,7 +550,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
err=do_mknod(sunaddr->sun_path, S_IFSOCK|S_IRWXUGO, 0);
if (!err)
err=open_namei(sunaddr->sun_path, 2, S_IFSOCK, &inode, NULL);
err=open_namei(sunaddr->sun_path, 2, S_IFSOCK, &inode);
set_fs(old_fs);
......
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