Commit 5665c2a2 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://linux-bt.bkbits.net/bt-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 067239c0 b8041f7b
......@@ -6,6 +6,7 @@
#include <linux/spinlock.h>
#include <linux/module.h>
#include <linux/device.h>
#include <asm/mpspec.h>
#include <asm/timer.h>
#include <asm/io.h>
......
......@@ -544,9 +544,9 @@ static struct pci_device_id aec62xx_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "AEC62xx IDE",
id_table: aec62xx_pci_tbl,
probe: aec62xx_init_one,
.name = "AEC62xx IDE",
.id_table = aec62xx_pci_tbl,
.probe = aec62xx_init_one,
};
static int aec62xx_ide_init(void)
......
......@@ -869,9 +869,9 @@ static struct pci_device_id alim15x3_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "ALI15x3 IDE",
id_table: alim15x3_pci_tbl,
probe: alim15x3_init_one,
.name = "ALI15x3 IDE",
.id_table = alim15x3_pci_tbl,
.probe = alim15x3_init_one,
};
static int ali15x3_ide_init(void)
......
......@@ -414,9 +414,9 @@ static struct pci_device_id amd74xx_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "AMD IDE",
id_table: amd74xx_pci_tbl,
probe: amd74xx_init_one,
.name = "AMD IDE",
.id_table = amd74xx_pci_tbl,
.probe = amd74xx_init_one,
};
static int amd74xx_ide_init(void)
......
......@@ -784,9 +784,9 @@ static struct pci_device_id cmd64x_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "CMD64x IDE",
id_table: cmd64x_pci_tbl,
probe: cmd64x_init_one,
.name = "CMD64x IDE",
.id_table = cmd64x_pci_tbl,
.probe = cmd64x_init_one,
};
static int cmd64x_ide_init(void)
......
......@@ -437,9 +437,9 @@ static struct pci_device_id cs5530_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "CS5530 IDE",
id_table: cs5530_pci_tbl,
probe: cs5530_init_one,
.name = "CS5530 IDE",
.id_table = cs5530_pci_tbl,
.probe = cs5530_init_one,
};
static int cs5530_ide_init(void)
......
......@@ -448,9 +448,9 @@ static struct pci_device_id cy82c693_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "Cypress IDE",
id_table: cy82c693_pci_tbl,
probe: cy82c693_init_one,
.name = "Cypress IDE",
.id_table = cy82c693_pci_tbl,
.probe = cy82c693_init_one,
};
static int cy82c693_ide_init(void)
......
......@@ -123,9 +123,9 @@ static struct pci_device_id generic_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "PCI IDE",
id_table: generic_pci_tbl,
probe: generic_init_one,
.name = "PCI IDE",
.id_table = generic_pci_tbl,
.probe = generic_init_one,
};
static int generic_ide_init(void)
......
......@@ -344,9 +344,9 @@ static struct pci_device_id hpt34x_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "HPT34x IDE",
id_table: hpt34x_pci_tbl,
probe: hpt34x_init_one,
.name = "HPT34x IDE",
.id_table = hpt34x_pci_tbl,
.probe = hpt34x_init_one,
};
static int hpt34x_ide_init(void)
......
......@@ -1199,9 +1199,9 @@ static struct pci_device_id hpt366_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "HPT366 IDE",
id_table: hpt366_pci_tbl,
probe: hpt366_init_one,
.name = "HPT366 IDE",
.id_table = hpt366_pci_tbl,
.probe = hpt366_init_one,
};
static int hpt366_ide_init(void)
......
......@@ -315,9 +315,9 @@ static struct pci_device_id it8172_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "IT8172IDE",
id_table: it8172_pci_tbl,
probe: it8172_init_one,
.name = "IT8172IDE",
.id_table = it8172_pci_tbl,
.probe = it8172_init_one,
};
static int it8172_ide_init(void)
......
......@@ -246,9 +246,9 @@ static struct pci_device_id ns87415_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "NS87415IDE",
id_table: ns87415_pci_tbl,
probe: ns87415_init_one,
.name = "NS87415IDE",
.id_table = ns87415_pci_tbl,
.probe = ns87415_init_one,
};
static int ns87415_ide_init(void)
......
......@@ -353,9 +353,9 @@ static struct pci_device_id nforce_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "nForce IDE",
id_table: nforce_pci_tbl,
probe: nforce_init_one,
.name = "nForce IDE",
.id_table = nforce_pci_tbl,
.probe = nforce_init_one,
};
static int nforce_ide_init(void)
......
......@@ -381,9 +381,9 @@ static struct pci_device_id opti621_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "Opti621 IDE",
id_table: opti621_pci_tbl,
probe: opti621_init_one,
.name = "Opti621 IDE",
.id_table = opti621_pci_tbl,
.probe = opti621_init_one,
};
static int opti621_ide_init(void)
......
......@@ -679,9 +679,9 @@ static struct pci_device_id pdc202new_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "Promise IDE",
id_table: pdc202new_pci_tbl,
probe: pdc202new_init_one,
.name = "Promise IDE",
.id_table = pdc202new_pci_tbl,
.probe = pdc202new_init_one,
};
static int pdc202new_ide_init(void)
......
......@@ -956,9 +956,9 @@ static struct pci_device_id pdc202xx_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "Promise Old IDE",
id_table: pdc202xx_pci_tbl,
probe: pdc202xx_init_one,
.name = "Promise Old IDE",
.id_table = pdc202xx_pci_tbl,
.probe = pdc202xx_init_one,
};
static int pdc202xx_ide_init(void)
......
......@@ -143,9 +143,9 @@ static struct pci_device_id pdcadma_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "PDCADMA-IDE",
id_table: pdcadma_pci_tbl,
probe: pdcadma_init_one,
.name = "PDCADMA-IDE",
.id_table = pdcadma_pci_tbl,
.probe = pdcadma_init_one,
};
static int pdcadma_ide_init(void)
......
......@@ -705,9 +705,9 @@ static struct pci_device_id piix_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "PIIX IDE",
id_table: piix_pci_tbl,
probe: piix_init_one,
.name = "PIIX IDE",
.id_table = piix_pci_tbl,
.probe = piix_init_one,
};
static int piix_ide_init(void)
......
......@@ -73,9 +73,9 @@ static struct pci_device_id rz1000_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "RZ1000 IDE",
id_table: rz1000_pci_tbl,
probe: rz1000_init_one,
.name = "RZ1000 IDE",
.id_table = rz1000_pci_tbl,
.probe = rz1000_init_one,
};
static int rz1000_ide_init(void)
......
......@@ -797,9 +797,9 @@ static struct pci_device_id svwks_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "Serverworks IDE",
id_table: svwks_pci_tbl,
probe: svwks_init_one,
.name = "Serverworks IDE",
.id_table = svwks_pci_tbl,
.probe = svwks_init_one,
#if 0 /* FIXME: implement */
suspend: ,
resume: ,
......
......@@ -855,9 +855,9 @@ static struct pci_device_id siimage_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "SiI IDE",
id_table: siimage_pci_tbl,
probe: siimage_init_one,
.name = "SiI IDE",
.id_table = siimage_pci_tbl,
.probe = siimage_init_one,
};
static int siimage_ide_init(void)
......
......@@ -1040,9 +1040,9 @@ static struct pci_device_id sis5513_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "SIS IDE",
id_table: sis5513_pci_tbl,
probe: sis5513_init_one,
.name = "SIS IDE",
.id_table = sis5513_pci_tbl,
.probe = sis5513_init_one,
};
static int sis5513_ide_init(void)
......
......@@ -298,9 +298,9 @@ static struct pci_device_id sl82c105_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "W82C105 IDE",
id_table: sl82c105_pci_tbl,
probe: sl82c105_init_one,
.name = "W82C105 IDE",
.id_table = sl82c105_pci_tbl,
.probe = sl82c105_init_one,
};
static int sl82c105_ide_init(void)
......
......@@ -382,9 +382,9 @@ static struct pci_device_id slc90e66_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "SLC90e66 IDE",
id_table: slc90e66_pci_tbl,
probe: slc90e66_init_one,
.name = "SLC90e66 IDE",
.id_table = slc90e66_pci_tbl,
.probe = slc90e66_init_one,
};
static int slc90e66_ide_init(void)
......
......@@ -413,9 +413,9 @@ static struct pci_device_id trm290_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "TRM290 IDE",
id_table: trm290_pci_tbl,
probe: trm290_init_one,
.name = "TRM290 IDE",
.id_table = trm290_pci_tbl,
.probe = trm290_init_one,
};
static int trm290_ide_init(void)
......
......@@ -652,9 +652,9 @@ static struct pci_device_id via_pci_tbl[] __devinitdata = {
};
static struct pci_driver driver = {
name: "VIA IDE",
id_table: via_pci_tbl,
probe: via_init_one,
.name = "VIA IDE",
.id_table = via_pci_tbl,
.probe = via_init_one,
};
static int via_ide_init(void)
......
......@@ -33,7 +33,6 @@
#include <linux/serial_reg.h>
#include <linux/serial.h>
#include <linux/serialP.h>
#include <linux/serial.h>
#include <linux/delay.h>
#include <asm/io.h>
......@@ -1636,7 +1635,7 @@ static void serial8250_config_port(struct uart_port *port, int flags)
if (up->port.type != PORT_RSA && res_rsa)
release_resource(res_rsa);
if (up->port.type == PORT_UNKNOWN)
if (up->port.type == PORT_UNKNOWN && res_std)
release_resource(res_std);
}
......
......@@ -22,10 +22,7 @@
#include <linux/slab.h>
#include <linux/serial.h>
/* 2.4.6 compatibility cruft - to be removed with the old serial.c code */
#define pci_board __pci_board
#include <linux/serialP.h>
#undef pci_board
#include <asm/bitops.h>
#include <asm/byteorder.h>
......@@ -771,6 +768,7 @@ static void __devexit pci_remove_one(struct pci_dev *dev)
for (i = 0; i < priv->nr; i++)
unregister_serial(priv->line[i]);
if (priv->board->init_fn)
priv->board->init_fn(dev, priv->board, 0);
pci_disable_device(dev);
......
......@@ -1604,8 +1604,6 @@ static int uart_open(struct tty_struct *tty, struct file *filp)
return retval;
}
#ifdef CONFIG_PROC_FS
static const char *uart_type(struct uart_port *port)
{
const char *str = NULL;
......@@ -1619,6 +1617,8 @@ static const char *uart_type(struct uart_port *port)
return str;
}
#ifdef CONFIG_PROC_FS
static int uart_line_info(char *buf, struct uart_driver *drv, int i)
{
struct uart_state *state = drv->state + i;
......
......@@ -130,17 +130,17 @@ static void destroy_inodecache(void)
}
static struct super_operations affs_sops = {
alloc_inode: affs_alloc_inode,
destroy_inode: affs_destroy_inode,
read_inode: affs_read_inode,
write_inode: affs_write_inode,
put_inode: affs_put_inode,
delete_inode: affs_delete_inode,
clear_inode: affs_clear_inode,
put_super: affs_put_super,
write_super: affs_write_super,
statfs: affs_statfs,
remount_fs: affs_remount,
.alloc_inode = affs_alloc_inode,
.destroy_inode = affs_destroy_inode,
.read_inode = affs_read_inode,
.write_inode = affs_write_inode,
.put_inode = affs_put_inode,
.delete_inode = affs_delete_inode,
.clear_inode = affs_clear_inode,
.put_super = affs_put_super,
.write_super = affs_write_super,
.statfs = affs_statfs,
.remount_fs = affs_remount,
};
static int
......@@ -550,11 +550,11 @@ static struct super_block *affs_get_sb(struct file_system_type *fs_type,
}
static struct file_system_type affs_fs_type = {
owner: THIS_MODULE,
name: "affs",
get_sb: affs_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
.owner = THIS_MODULE,
.name = "affs",
.get_sb = affs_get_sb,
.kill_sb = kill_block_super,
.fs_flags = FS_REQUIRES_DEV,
};
static int __init init_affs_fs(void)
......
......@@ -26,9 +26,9 @@ inline int coda_isnullfid(ViceFid *fid)
}
static struct inode_operations coda_symlink_inode_operations = {
readlink: page_readlink,
follow_link: page_follow_link,
setattr: coda_setattr,
.readlink = page_readlink,
.follow_link = page_follow_link,
.setattr = coda_setattr,
};
/* cnode.c */
......
......@@ -353,13 +353,13 @@ static int coda_psdev_release(struct inode * inode, struct file * file)
static struct file_operations coda_psdev_fops = {
owner: THIS_MODULE,
read: coda_psdev_read,
write: coda_psdev_write,
poll: coda_psdev_poll,
ioctl: coda_psdev_ioctl,
open: coda_psdev_open,
release: coda_psdev_release,
.owner = THIS_MODULE,
.read = coda_psdev_read,
.write = coda_psdev_write,
.poll = coda_psdev_poll,
.ioctl = coda_psdev_ioctl,
.open = coda_psdev_open,
.release = coda_psdev_release,
};
static devfs_handle_t devfs_handle;
......
......@@ -1615,9 +1615,9 @@ jffs_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
static struct address_space_operations jffs_address_operations = {
readpage: jffs_readpage,
prepare_write: jffs_prepare_write,
commit_write: jffs_commit_write,
.readpage = jffs_readpage,
.prepare_write = jffs_prepare_write,
.commit_write = jffs_commit_write,
};
static int jffs_fsync(struct file *f, struct dentry *d, int datasync)
......@@ -1634,41 +1634,41 @@ extern loff_t generic_file_llseek(struct file *, loff_t, int) __attribute__((wea
static struct file_operations jffs_file_operations =
{
open: generic_file_open,
llseek: generic_file_llseek,
read: generic_file_read,
write: generic_file_write,
ioctl: jffs_ioctl,
mmap: generic_file_mmap,
fsync: jffs_fsync,
sendfile: generic_file_sendfile,
.open = generic_file_open,
.llseek = generic_file_llseek,
.read = generic_file_read,
.write = generic_file_write,
.ioctl = jffs_ioctl,
.mmap = generic_file_mmap,
.fsync = jffs_fsync,
.sendfile = generic_file_sendfile,
};
static struct inode_operations jffs_file_inode_operations =
{
lookup: jffs_lookup, /* lookup */
setattr: jffs_setattr,
.lookup = jffs_lookup, /* lookup */
.setattr = jffs_setattr,
};
static struct file_operations jffs_dir_operations =
{
readdir: jffs_readdir,
.readdir = jffs_readdir,
};
static struct inode_operations jffs_dir_inode_operations =
{
create: jffs_create,
lookup: jffs_lookup,
unlink: jffs_unlink,
symlink: jffs_symlink,
mkdir: jffs_mkdir,
rmdir: jffs_rmdir,
mknod: jffs_mknod,
rename: jffs_rename,
setattr: jffs_setattr,
.create = jffs_create,
.lookup = jffs_lookup,
.unlink = jffs_unlink,
.symlink = jffs_symlink,
.mkdir = jffs_mkdir,
.rmdir = jffs_rmdir,
.mknod = jffs_mknod,
.rename = jffs_rename,
.setattr = jffs_setattr,
};
......@@ -1768,11 +1768,11 @@ jffs_write_super(struct super_block *sb)
static struct super_operations jffs_ops =
{
read_inode: jffs_read_inode,
delete_inode: jffs_delete_inode,
put_super: jffs_put_super,
write_super: jffs_write_super,
statfs: jffs_statfs,
.read_inode = jffs_read_inode,
.delete_inode = jffs_delete_inode,
.put_super = jffs_put_super,
.write_super = jffs_write_super,
.statfs = jffs_statfs,
};
static struct super_block *jffs_get_sb(struct file_system_type *fs_type,
......@@ -1782,11 +1782,11 @@ static struct super_block *jffs_get_sb(struct file_system_type *fs_type,
}
static struct file_system_type jffs_fs_type = {
owner: THIS_MODULE,
name: "jffs",
get_sb: jffs_get_sb,
kill_sb: kill_block_super,
fs_flags: FS_REQUIRES_DEV,
.owner = THIS_MODULE,
.name = "jffs",
.get_sb = jffs_get_sb,
.kill_sb = kill_block_super,
.fs_flags = FS_REQUIRES_DEV,
};
static int __init
......
......@@ -130,7 +130,6 @@ int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page *page)
return 0;
error:
SetPageError(page);
kunmap(page);
unlock_page(page);
invalidate_inode_pages(inode->i_mapping);
desc->error = error;
......
......@@ -54,6 +54,17 @@ nfs3_rpc_call_wrapper(struct rpc_clnt *clnt, u32 proc, void *argp, void *resp, i
#define rpc_call_sync(clnt, msg, flags) \
nfs3_rpc_wrapper(clnt, msg, flags)
static int
nfs3_async_handle_jukebox(struct rpc_task *task)
{
if (task->tk_status != -EJUKEBOX)
return 0;
task->tk_status = 0;
rpc_restart_call(task);
rpc_delay(task, NFS_JUKEBOX_RETRY_TIME);
return 1;
}
/*
* Bare-bones access to getattr: this is for nfs_read_super.
*/
......@@ -392,16 +403,20 @@ nfs3_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr
return 0;
}
static void
nfs3_proc_unlink_done(struct dentry *dir, struct rpc_message *msg)
static int
nfs3_proc_unlink_done(struct dentry *dir, struct rpc_task *task)
{
struct rpc_message *msg = &task->tk_msg;
struct nfs_fattr *dir_attr;
if (nfs3_async_handle_jukebox(task))
return 1;
if (msg->rpc_argp) {
dir_attr = (struct nfs_fattr*)msg->rpc_resp;
nfs_refresh_inode(dir->d_inode, dir_attr);
kfree(msg->rpc_argp);
}
return 0;
}
static int
......@@ -652,7 +667,7 @@ nfs3_read_done(struct rpc_task *task)
{
struct nfs_read_data *data = (struct nfs_read_data *) task->tk_calldata;
if (nfs_async_handle_jukebox(task))
if (nfs3_async_handle_jukebox(task))
return;
nfs_readpage_result(task, data->u.v3.res.count, data->u.v3.res.eof);
}
......@@ -692,6 +707,101 @@ nfs3_proc_read_setup(struct nfs_read_data *data, unsigned int count)
rpc_call_setup(&data->task, &msg, 0);
}
static void
nfs3_write_done(struct rpc_task *task)
{
struct nfs_write_data *data = (struct nfs_write_data *) task->tk_calldata;
if (nfs3_async_handle_jukebox(task))
return;
nfs_writeback_done(task, data->u.v3.args.stable,
data->u.v3.args.count, data->u.v3.res.count);
}
static void
nfs3_proc_write_setup(struct nfs_write_data *data, unsigned int count, int how)
{
struct rpc_task *task = &data->task;
struct inode *inode = data->inode;
struct nfs_page *req;
int stable;
int flags;
struct rpc_message msg;
if (how & FLUSH_STABLE) {
if (!NFS_I(inode)->ncommit)
stable = NFS_FILE_SYNC;
else
stable = NFS_DATA_SYNC;
} else
stable = NFS_UNSTABLE;
req = nfs_list_entry(data->pages.next);
data->u.v3.args.fh = NFS_FH(inode);
data->u.v3.args.offset = req_offset(req) + req->wb_offset;
data->u.v3.args.pgbase = req->wb_offset;
data->u.v3.args.count = count;
data->u.v3.args.stable = stable;
data->u.v3.args.pages = data->pagevec;
data->u.v3.res.fattr = &data->fattr;
data->u.v3.res.count = count;
data->u.v3.res.verf = &data->verf;
/* Set the initial flags for the task. */
flags = (how & FLUSH_SYNC) ? 0 : RPC_TASK_ASYNC;
/* Finalize the task. */
rpc_init_task(task, NFS_CLIENT(inode), nfs3_write_done, flags);
task->tk_calldata = data;
/* Release requests */
task->tk_release = nfs_writedata_release;
msg.rpc_proc = NFS3PROC_WRITE;
msg.rpc_argp = &data->u.v3.args;
msg.rpc_resp = &data->u.v3.res;
msg.rpc_cred = data->cred;
rpc_call_setup(&data->task, &msg, 0);
}
static void
nfs3_commit_done(struct rpc_task *task)
{
if (nfs3_async_handle_jukebox(task))
return;
nfs_commit_done(task);
}
static void
nfs3_proc_commit_setup(struct nfs_write_data *data, u64 start, u32 len, int how)
{
struct rpc_task *task = &data->task;
struct inode *inode = data->inode;
int flags;
struct rpc_message msg;
data->u.v3.args.fh = NFS_FH(data->inode);
data->u.v3.args.offset = start;
data->u.v3.args.count = len;
data->u.v3.res.count = len;
data->u.v3.res.fattr = &data->fattr;
data->u.v3.res.verf = &data->verf;
/* Set the initial flags for the task. */
flags = (how & FLUSH_SYNC) ? 0 : RPC_TASK_ASYNC;
/* Finalize the task. */
rpc_init_task(task, NFS_CLIENT(inode), nfs3_commit_done, flags);
task->tk_calldata = data;
/* Release requests */
task->tk_release = nfs_writedata_release;
msg.rpc_proc = NFS3PROC_COMMIT;
msg.rpc_argp = &data->u.v3.args;
msg.rpc_resp = &data->u.v3.res;
msg.rpc_cred = data->cred;
rpc_call_setup(&data->task, &msg, 0);
}
struct nfs_rpc_ops nfs_v3_clientops = {
.version = 3, /* protocol version */
.getroot = nfs3_proc_get_root,
......@@ -716,4 +826,6 @@ struct nfs_rpc_ops nfs_v3_clientops = {
.statfs = nfs3_proc_statfs,
.decode_dirent = nfs3_decode_dirent,
.read_setup = nfs3_proc_read_setup,
.write_setup = nfs3_proc_write_setup,
.commit_setup = nfs3_proc_commit_setup,
};
......@@ -312,13 +312,16 @@ nfs_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr *
return 0;
}
static void
nfs_proc_unlink_done(struct dentry *dir, struct rpc_message *msg)
static int
nfs_proc_unlink_done(struct dentry *dir, struct rpc_task *task)
{
struct rpc_message *msg = &task->tk_msg;
if (msg->rpc_argp) {
NFS_CACHEINV(dir->d_inode);
kfree(msg->rpc_argp);
}
return 0;
}
static int
......@@ -512,6 +515,58 @@ nfs_proc_read_setup(struct nfs_read_data *data, unsigned int count)
rpc_call_setup(&data->task, &msg, 0);
}
static void
nfs_write_done(struct rpc_task *task)
{
struct nfs_write_data *data = (struct nfs_write_data *) task->tk_calldata;
nfs_writeback_done(task, data->u.v3.args.stable,
data->u.v3.args.count, data->u.v3.res.count);
}
static void
nfs_proc_write_setup(struct nfs_write_data *data, unsigned int count, int how)
{
struct rpc_task *task = &data->task;
struct inode *inode = data->inode;
struct nfs_page *req;
int flags;
struct rpc_message msg;
/* Note: NFSv2 ignores @stable and always uses NFS_FILE_SYNC */
req = nfs_list_entry(data->pages.next);
data->u.v3.args.fh = NFS_FH(inode);
data->u.v3.args.offset = req_offset(req) + req->wb_offset;
data->u.v3.args.pgbase = req->wb_offset;
data->u.v3.args.count = count;
data->u.v3.args.stable = NFS_FILE_SYNC;
data->u.v3.args.pages = data->pagevec;
data->u.v3.res.fattr = &data->fattr;
data->u.v3.res.count = count;
data->u.v3.res.verf = &data->verf;
/* Set the initial flags for the task. */
flags = (how & FLUSH_SYNC) ? 0 : RPC_TASK_ASYNC;
/* Finalize the task. */
rpc_init_task(task, NFS_CLIENT(inode), nfs_write_done, flags);
task->tk_calldata = data;
/* Release requests */
task->tk_release = nfs_writedata_release;
msg.rpc_proc = NFSPROC_WRITE;
msg.rpc_argp = &data->u.v3.args;
msg.rpc_resp = &data->u.v3.res;
msg.rpc_cred = data->cred;
rpc_call_setup(&data->task, &msg, 0);
}
static void
nfs_proc_commit_setup(struct nfs_write_data *data, u64 start, u32 len, int how)
{
BUG();
}
struct nfs_rpc_ops nfs_v2_clientops = {
.version = 2, /* protocol version */
.getroot = nfs_proc_get_root,
......@@ -537,4 +592,6 @@ struct nfs_rpc_ops nfs_v2_clientops = {
.statfs = nfs_proc_statfs,
.decode_dirent = nfs_decode_dirent,
.read_setup = nfs_proc_read_setup,
.write_setup = nfs_proc_write_setup,
.commit_setup = nfs_proc_commit_setup,
};
......@@ -123,13 +123,12 @@ nfs_async_unlink_done(struct rpc_task *task)
struct dentry *dir = data->dir;
struct inode *dir_i;
if (nfs_async_handle_jukebox(task))
return;
if (!dir)
return;
dir_i = dir->d_inode;
nfs_zap_caches(dir_i);
NFS_PROTO(dir_i)->unlink_done(dir, &task->tk_msg);
if (NFS_PROTO(dir_i)->unlink_done(dir, task))
return;
put_rpccred(data->cred);
data->cred = NULL;
dput(dir);
......
......@@ -63,23 +63,6 @@
#define NFSDBG_FACILITY NFSDBG_PAGECACHE
/*
* Local structures
*
* This is the struct where the WRITE/COMMIT arguments go.
*/
struct nfs_write_data {
struct rpc_task task;
struct inode *inode;
struct rpc_cred *cred;
struct nfs_writeargs args; /* argument struct */
struct nfs_writeres res; /* result struct */
struct nfs_fattr fattr;
struct nfs_writeverf verf;
struct list_head pages; /* Coalesced requests we wish to flush */
struct page *pagevec[NFS_WRITE_MAXIOV];
};
/*
* Local function declarations
*/
......@@ -87,15 +70,6 @@ static struct nfs_page * nfs_update_request(struct file*, struct inode *,
struct page *,
unsigned int, unsigned int);
static void nfs_strategy(struct inode *inode);
static void nfs_writeback_done(struct rpc_task *);
#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
static void nfs_commit_done(struct rpc_task *);
#endif
/* Hack for future NFS swap support */
#ifndef IS_SWAPFILE
# define IS_SWAPFILE(inode) (0)
#endif
static kmem_cache_t *nfs_wdata_cachep;
......@@ -106,7 +80,6 @@ static __inline__ struct nfs_write_data *nfs_writedata_alloc(void)
if (p) {
memset(p, 0, sizeof(*p));
INIT_LIST_HEAD(&p->pages);
p->args.pages = p->pagevec;
}
return p;
}
......@@ -116,7 +89,7 @@ static __inline__ void nfs_writedata_free(struct nfs_write_data *p)
kmem_cache_free(nfs_wdata_cachep, p);
}
static void nfs_writedata_release(struct rpc_task *task)
void nfs_writedata_release(struct rpc_task *task)
{
struct nfs_write_data *wdata = (struct nfs_write_data *)task->tk_calldata;
nfs_writedata_free(wdata);
......@@ -860,8 +833,10 @@ nfs_updatepage(struct file *file, struct page *page, unsigned int offset, unsign
* Set up the argument/result storage required for the RPC call.
*/
static void
nfs_write_rpcsetup(struct list_head *head, struct nfs_write_data *data)
nfs_write_rpcsetup(struct list_head *head, struct nfs_write_data *data, int how)
{
struct rpc_task *task = &data->task;
struct inode *inode;
struct nfs_page *req;
struct page **pages;
unsigned int count;
......@@ -869,27 +844,28 @@ nfs_write_rpcsetup(struct list_head *head, struct nfs_write_data *data)
/* Set up the RPC argument and reply structs
* NB: take care not to mess about with data->commit et al. */
pages = data->args.pages;
pages = data->pagevec;
count = 0;
while (!list_empty(head)) {
struct nfs_page *req = nfs_list_entry(head->next);
req = nfs_list_entry(head->next);
nfs_list_remove_request(req);
nfs_list_add_request(req, &data->pages);
*pages++ = req->wb_page;
count += req->wb_bytes;
}
req = nfs_list_entry(data->pages.next);
data->inode = req->wb_inode;
data->inode = inode = req->wb_inode;
data->cred = req->wb_cred;
data->args.fh = NFS_FH(req->wb_inode);
data->args.offset = req_offset(req) + req->wb_offset;
data->args.pgbase = req->wb_offset;
data->args.count = count;
data->res.fattr = &data->fattr;
data->res.count = count;
data->res.verf = &data->verf;
}
NFS_PROTO(inode)->write_setup(data, count, how);
dprintk("NFS: %4d initiated write call (req %s/%Ld, %u bytes @ offset %Lu)\n",
task->tk_pid,
inode->i_sb->s_id,
(long long)NFS_FILEID(inode),
count,
(unsigned long long)req_offset(req) + req->wb_offset);
}
/*
* Create an RPC task for the given write request and kick it.
......@@ -902,64 +878,20 @@ nfs_write_rpcsetup(struct list_head *head, struct nfs_write_data *data)
static int
nfs_flush_one(struct list_head *head, struct inode *inode, int how)
{
struct nfs_inode *nfsi = NFS_I(inode);
struct rpc_clnt *clnt = NFS_CLIENT(inode);
struct nfs_write_data *data;
struct rpc_task *task;
struct rpc_message msg;
int flags,
nfsvers = NFS_PROTO(inode)->version,
async = !(how & FLUSH_SYNC),
stable = (how & FLUSH_STABLE);
sigset_t oldset;
data = nfs_writedata_alloc();
if (!data)
goto out_bad;
task = &data->task;
/* Set the initial flags for the task. */
flags = (async) ? RPC_TASK_ASYNC : 0;
/* Set up the argument struct */
nfs_write_rpcsetup(head, data);
if (nfsvers < 3)
data->args.stable = NFS_FILE_SYNC;
else if (stable) {
if (!nfsi->ncommit)
data->args.stable = NFS_FILE_SYNC;
else
data->args.stable = NFS_DATA_SYNC;
} else
data->args.stable = NFS_UNSTABLE;
/* Finalize the task. */
rpc_init_task(task, clnt, nfs_writeback_done, flags);
task->tk_calldata = data;
/* Release requests */
task->tk_release = nfs_writedata_release;
#ifdef CONFIG_NFS_V3
msg.rpc_proc = (nfsvers == 3) ? NFS3PROC_WRITE : NFSPROC_WRITE;
#else
msg.rpc_proc = NFSPROC_WRITE;
#endif
msg.rpc_argp = &data->args;
msg.rpc_resp = &data->res;
msg.rpc_cred = data->cred;
dprintk("NFS: %4d initiated write call (req %s/%Ld, %u bytes @ offset %Lu)\n",
task->tk_pid,
inode->i_sb->s_id,
(long long)NFS_FILEID(inode),
(unsigned int)data->args.count,
(unsigned long long)data->args.offset);
nfs_write_rpcsetup(head, data, how);
rpc_clnt_sigmask(clnt, &oldset);
rpc_call_setup(task, &msg, 0);
lock_kernel();
rpc_execute(task);
rpc_execute(&data->task);
unlock_kernel();
rpc_clnt_sigunmask(clnt, &oldset);
return 0;
......@@ -1004,12 +936,11 @@ nfs_flush_list(struct list_head *head, int wpages, int how)
/*
* This function is called when the WRITE call is complete.
*/
static void
nfs_writeback_done(struct rpc_task *task)
void
nfs_writeback_done(struct rpc_task *task, int stable,
unsigned int arg_count, unsigned int res_count)
{
struct nfs_write_data *data = (struct nfs_write_data *) task->tk_calldata;
struct nfs_writeargs *argp = &data->args;
struct nfs_writeres *resp = &data->res;
struct inode *inode = data->inode;
struct nfs_page *req;
struct page *page;
......@@ -1017,11 +948,8 @@ nfs_writeback_done(struct rpc_task *task)
dprintk("NFS: %4d nfs_writeback_done (status %d)\n",
task->tk_pid, task->tk_status);
if (nfs_async_handle_jukebox(task))
return;
/* We can't handle that yet but we check for it nevertheless */
if (resp->count < argp->count && task->tk_status >= 0) {
if (res_count < arg_count && task->tk_status >= 0) {
static unsigned long complain;
if (time_before(complain, jiffies)) {
printk(KERN_WARNING
......@@ -1033,7 +961,7 @@ nfs_writeback_done(struct rpc_task *task)
task->tk_status = -EIO;
}
#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
if (resp->verf->committed < argp->stable && task->tk_status >= 0) {
if (data->verf.committed < stable && task->tk_status >= 0) {
/* We tried a write call, but the server did not
* commit data to stable storage even though we
* requested it.
......@@ -1045,10 +973,10 @@ nfs_writeback_done(struct rpc_task *task)
static unsigned long complain;
if (time_before(complain, jiffies)) {
dprintk("NFS: faulty NFSv3 server %s:"
dprintk("NFS: faulty NFS server %s:"
" (committed = %d) != (stable = %d)\n",
NFS_SERVER(inode)->hostname,
resp->verf->committed, argp->stable);
data->verf.committed, stable);
complain = jiffies + 300 * HZ;
}
}
......@@ -1060,7 +988,7 @@ nfs_writeback_done(struct rpc_task *task)
* writebacks since the page->count is kept > 1 for as long
* as the page has a write request pending.
*/
nfs_write_attributes(inode, resp->fattr);
nfs_write_attributes(inode, &data->fattr);
while (!list_empty(&data->pages)) {
req = nfs_list_entry(data->pages.next);
nfs_list_remove_request(req);
......@@ -1083,12 +1011,12 @@ nfs_writeback_done(struct rpc_task *task)
}
#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
if (argp->stable != NFS_UNSTABLE || resp->verf->committed == NFS_FILE_SYNC) {
if (stable != NFS_UNSTABLE || data->verf.committed == NFS_FILE_SYNC) {
nfs_inode_remove_request(req);
dprintk(" OK\n");
goto next;
}
memcpy(&req->wb_verf, resp->verf, sizeof(req->wb_verf));
memcpy(&req->wb_verf, &data->verf, sizeof(req->wb_verf));
req->wb_timeout = jiffies + NFS_COMMIT_DELAY;
nfs_mark_request_commit(req);
dprintk(" marked for commit\n");
......@@ -1106,8 +1034,9 @@ nfs_writeback_done(struct rpc_task *task)
* Set up the argument/result storage required for the RPC call.
*/
static void
nfs_commit_rpcsetup(struct list_head *head, struct nfs_write_data *data)
nfs_commit_rpcsetup(struct list_head *head, struct nfs_write_data *data, int how)
{
struct rpc_task *task = &data->task;
struct nfs_page *first, *last;
struct inode *inode;
loff_t start, end, len;
......@@ -1133,11 +1062,10 @@ nfs_commit_rpcsetup(struct list_head *head, struct nfs_write_data *data)
data->inode = inode;
data->cred = first->wb_cred;
data->args.fh = NFS_FH(inode);
data->args.offset = start;
data->res.count = data->args.count = (u32)len;
data->res.fattr = &data->fattr;
data->res.verf = &data->verf;
NFS_PROTO(inode)->commit_setup(data, start, len, how);
dprintk("NFS: %4d initiated commit call\n", task->tk_pid);
}
/*
......@@ -1146,43 +1074,23 @@ nfs_commit_rpcsetup(struct list_head *head, struct nfs_write_data *data)
int
nfs_commit_list(struct list_head *head, int how)
{
struct rpc_message msg;
struct rpc_clnt *clnt;
struct nfs_write_data *data;
struct rpc_task *task;
struct nfs_page *req;
int flags,
async = !(how & FLUSH_SYNC);
sigset_t oldset;
data = nfs_writedata_alloc();
if (!data)
goto out_bad;
task = &data->task;
flags = (async) ? RPC_TASK_ASYNC : 0;
/* Set up the argument struct */
nfs_commit_rpcsetup(head, data);
req = nfs_list_entry(data->pages.next);
clnt = NFS_CLIENT(req->wb_inode);
nfs_commit_rpcsetup(head, data, how);
clnt = NFS_CLIENT(data->inode);
rpc_init_task(task, clnt, nfs_commit_done, flags);
task->tk_calldata = data;
/* Release requests */
task->tk_release = nfs_writedata_release;
msg.rpc_proc = NFS3PROC_COMMIT;
msg.rpc_argp = &data->args;
msg.rpc_resp = &data->res;
msg.rpc_cred = data->cred;
dprintk("NFS: %4d initiated commit call\n", task->tk_pid);
rpc_clnt_sigmask(clnt, &oldset);
rpc_call_setup(task, &msg, 0);
lock_kernel();
rpc_execute(task);
rpc_execute(&data->task);
unlock_kernel();
rpc_clnt_sigunmask(clnt, &oldset);
return 0;
......@@ -1199,21 +1107,17 @@ nfs_commit_list(struct list_head *head, int how)
/*
* COMMIT call returned
*/
static void
void
nfs_commit_done(struct rpc_task *task)
{
struct nfs_write_data *data = (struct nfs_write_data *)task->tk_calldata;
struct nfs_writeres *resp = &data->res;
struct nfs_page *req;
struct inode *inode = data->inode;
dprintk("NFS: %4d nfs_commit_done (status %d)\n",
task->tk_pid, task->tk_status);
if (nfs_async_handle_jukebox(task))
return;
nfs_write_attributes(inode, resp->fattr);
nfs_write_attributes(inode, &data->fattr);
while (!list_empty(&data->pages)) {
req = nfs_list_entry(data->pages.next);
nfs_list_remove_request(req);
......
......@@ -323,6 +323,14 @@ extern void nfs_complete_unlink(struct dentry *);
extern int nfs_writepage(struct page *);
extern int nfs_flush_incompatible(struct file *file, struct page *page);
extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int);
extern void nfs_writeback_done(struct rpc_task *task, int stable,
unsigned int arg_count, unsigned int res_count);
extern void nfs_writedata_release(struct rpc_task *task);
#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
extern void nfs_commit_done(struct rpc_task *);
#endif
/*
* Try to write back everything synchronously (but check the
* return value!)
......@@ -462,28 +470,7 @@ extern void * nfs_root_data(void);
__retval; \
})
#ifdef CONFIG_NFS_V3
#define NFS_JUKEBOX_RETRY_TIME (5 * HZ)
static inline int
nfs_async_handle_jukebox(struct rpc_task *task)
{
if (task->tk_status != -EJUKEBOX)
return 0;
task->tk_status = 0;
rpc_restart_call(task);
rpc_delay(task, NFS_JUKEBOX_RETRY_TIME);
return 1;
}
#else
static inline int
nfs_async_handle_jukebox(struct rpc_task *task)
{
return 0;
}
#endif /* CONFIG_NFS_V3 */
#endif /* __KERNEL__ */
......
......@@ -67,6 +67,7 @@ struct nfs_fsinfo {
__u64 afiles; /* # of files available to user */
__u32 linkmax;/* max # of hard links */
__u32 namelen;/* max name length */
__u32 lease_time; /* in seconds */
};
/*
......@@ -326,6 +327,25 @@ struct nfs_read_data {
} u;
};
struct nfs_write_data {
struct rpc_task task;
struct inode *inode;
struct rpc_cred *cred;
struct nfs_fattr fattr;
struct nfs_writeverf verf;
struct list_head pages; /* Coalesced requests we wish to flush */
struct page *pagevec[NFS_WRITE_MAXIOV];
union {
struct {
struct nfs_writeargs args;
struct nfs_writeres res;
} v3;
#ifdef CONFIG_NFS_V4
/* NFSv4 data to come here... */
#endif
} u;
};
/*
* RPC procedure vector for NFSv2/NFSv3 demuxing
*/
......@@ -356,7 +376,7 @@ struct nfs_rpc_ops {
int (*remove) (struct inode *, struct qstr *);
int (*unlink_setup) (struct rpc_message *,
struct dentry *, struct qstr *);
void (*unlink_done) (struct dentry *, struct rpc_message *);
int (*unlink_done) (struct dentry *, struct rpc_task *);
int (*rename) (struct inode *, struct qstr *,
struct inode *, struct qstr *);
int (*link) (struct inode *, struct inode *, struct qstr *);
......@@ -374,6 +394,8 @@ struct nfs_rpc_ops {
struct nfs_fsinfo *);
u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus);
void (*read_setup) (struct nfs_read_data *, unsigned int count);
void (*write_setup) (struct nfs_write_data *, unsigned int count, int how);
void (*commit_setup) (struct nfs_write_data *, u64 start, u32 len, int how);
};
/*
......
......@@ -131,6 +131,9 @@ struct rs_multiport_struct {
* Digital did something really horribly wrong with the OUT1 and OUT2
* lines on at least some ALPHA's. The failure mode is that if either
* is cleared, the machine locks up with endless interrupts.
*
* This is still used by arch/mips/au1000/common/serial.c for some weird
* reason (mips != alpha!)
*/
#define ALPHA_KLUDGE_MCR (UART_MCR_OUT2 | UART_MCR_OUT1)
#else
......@@ -138,29 +141,8 @@ struct rs_multiport_struct {
#endif
/*
* Structures and definitions for PCI support
* Definitions for PCI support.
*/
struct pci_dev;
struct pci_board {
int flags;
int num_ports;
int base_baud;
int uart_offset;
int reg_shift;
int (*init_fn)(struct pci_dev *dev, struct pci_board *board,
int enable);
int first_uart_offset;
};
struct pci_board_inst {
struct pci_board board;
struct pci_dev *dev;
};
#ifndef PCI_ANY_ID
#define PCI_ANY_ID (~0)
#endif
#define SPCI_FL_BASE_MASK 0x0007
#define SPCI_FL_BASE0 0x0000
#define SPCI_FL_BASE1 0x0001
......
......@@ -1446,6 +1446,8 @@ xprt_bind_socket(struct rpc_xprt *xprt, struct socket *sock)
sk->no_check = UDP_CSUM_NORCV;
xprt_set_connected(xprt);
} else {
struct tcp_opt *tp = tcp_sk(sk);
tp->nonagle = 1; /* disable Nagle's algorithm */
sk->data_ready = tcp_data_ready;
sk->state_change = tcp_state_change;
xprt_clear_connected(xprt);
......
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