summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/blkdev.h13
-rw-r--r--include/linux/blkpg.h1
-rw-r--r--include/linux/cdrom.h1
-rw-r--r--include/linux/dcache.h3
-rw-r--r--include/linux/dcookies.h69
-rw-r--r--include/linux/device.h3
-rw-r--r--include/linux/fs.h2
-rw-r--r--include/linux/genhd.h21
-rw-r--r--include/linux/mtd/concat.h23
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_core.h2
-rw-r--r--include/linux/nfs.h2
-rw-r--r--include/linux/nfs3.h5
-rw-r--r--include/linux/nfs4_mount.h70
-rw-r--r--include/linux/nfs_fs.h49
-rw-r--r--include/linux/nfs_fs_sb.h10
-rw-r--r--include/linux/nfs_mount.h8
-rw-r--r--include/linux/nfs_xdr.h262
-rw-r--r--include/linux/oprofile.h98
-rw-r--r--include/linux/profile.h67
-rw-r--r--include/linux/rcupdate.h134
-rw-r--r--include/linux/sched.h4
-rw-r--r--include/linux/vcache.h2
22 files changed, 820 insertions, 29 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 4929d743683d..ccb56d58de6a 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -34,6 +34,7 @@ struct request {
int rq_status; /* should split this into a few status bits */
kdev_t rq_dev;
+ struct gendisk *rq_disk;
int errors;
sector_t sector;
unsigned long nr_sectors;
@@ -60,6 +61,12 @@ struct request {
int tag;
void *special;
char *buffer;
+
+ /* For packet commands */
+ unsigned int data_len;
+ void *data, *sense;
+
+ unsigned int timeout;
struct completion *waiting;
struct bio *bio, *biotail;
request_queue_t *q;
@@ -85,6 +92,8 @@ enum rq_flag_bits {
__REQ_BLOCK_PC, /* queued down pc from block layer */
__REQ_SENSE, /* sense retrival */
+ __REQ_FAILED, /* set if the request failed */
+ __REQ_QUIET, /* don't worry about errors */
__REQ_SPECIAL, /* driver suplied command */
__REQ_DRIVE_CMD,
__REQ_DRIVE_TASK,
@@ -103,6 +112,8 @@ enum rq_flag_bits {
#define REQ_PC (1 << __REQ_PC)
#define REQ_BLOCK_PC (1 << __REQ_BLOCK_PC)
#define REQ_SENSE (1 << __REQ_SENSE)
+#define REQ_FAILED (1 << __REQ_FAILED)
+#define REQ_QUIET (1 << __REQ_QUIET)
#define REQ_SPECIAL (1 << __REQ_SPECIAL)
#define REQ_DRIVE_CMD (1 << __REQ_DRIVE_CMD)
#define REQ_DRIVE_TASK (1 << __REQ_DRIVE_TASK)
@@ -301,7 +312,7 @@ extern int blk_remove_plug(request_queue_t *);
extern void blk_recount_segments(request_queue_t *, struct bio *);
extern inline int blk_phys_contig_segment(request_queue_t *q, struct bio *, struct bio *);
extern inline int blk_hw_contig_segment(request_queue_t *q, struct bio *, struct bio *);
-extern int block_ioctl(struct block_device *, unsigned int, unsigned long);
+extern int scsi_cmd_ioctl(struct block_device *, unsigned int, unsigned long);
extern void blk_start_queue(request_queue_t *q);
extern void blk_stop_queue(request_queue_t *q);
extern void __blk_stop_queue(request_queue_t *q);
diff --git a/include/linux/blkpg.h b/include/linux/blkpg.h
index 3cfedb07f803..571618972e30 100644
--- a/include/linux/blkpg.h
+++ b/include/linux/blkpg.h
@@ -57,7 +57,6 @@ struct blkpg_partition {
#ifdef __KERNEL__
extern char * partition_name(dev_t dev);
-extern int blk_ioctl(struct block_device *bdev, unsigned int cmd, unsigned long arg);
#endif /* __KERNEL__ */
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h
index b287b7a24b11..4387203c95b7 100644
--- a/include/linux/cdrom.h
+++ b/include/linux/cdrom.h
@@ -730,7 +730,6 @@ struct cdrom_device_info {
struct cdrom_device_ops *ops; /* link to device_ops */
struct cdrom_device_info *next; /* next device_info for this major */
void *handle; /* driver-dependent data */
- struct device cdrom_driverfs_dev; /* driverfs implementation */
/* specifications */
kdev_t dev; /* device number */
int mask; /* mask of capability: disables them */
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 71708edafce9..76a5085043e1 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -66,6 +66,8 @@ static __inline__ unsigned int full_name_hash(const unsigned char * name, unsign
#define DNAME_INLINE_LEN 16
+struct dcookie_struct;
+
struct dentry {
atomic_t d_count;
unsigned int d_flags;
@@ -84,6 +86,7 @@ struct dentry {
unsigned long d_vfs_flags;
void * d_fsdata; /* fs-specific data */
unsigned char d_iname[DNAME_INLINE_LEN]; /* small names */
+ struct dcookie_struct * d_cookie; /* cookie, if any */
};
struct dentry_operations {
diff --git a/include/linux/dcookies.h b/include/linux/dcookies.h
new file mode 100644
index 000000000000..7c4d3319e7d0
--- /dev/null
+++ b/include/linux/dcookies.h
@@ -0,0 +1,69 @@
+/*
+ * dcookies.h
+ *
+ * Persistent cookie-path mappings
+ *
+ * Copyright 2002 John Levon <levon@movementarian.org>
+ */
+
+#ifndef DCOOKIES_H
+#define DCOOKIES_H
+
+#include <linux/config.h>
+
+#ifdef CONFIG_PROFILING
+
+#include <linux/types.h>
+
+struct dcookie_user;
+
+/**
+ * dcookie_register - register a user of dcookies
+ *
+ * Register as a dcookie user. Returns %NULL on failure.
+ */
+struct dcookie_user * dcookie_register(void);
+
+/**
+ * dcookie_unregister - unregister a user of dcookies
+ *
+ * Unregister as a dcookie user. This may invalidate
+ * any dcookie values returned from get_dcookie().
+ */
+void dcookie_unregister(struct dcookie_user * user);
+
+/**
+ * get_dcookie - acquire a dcookie
+ *
+ * Convert the given dentry/vfsmount pair into
+ * a cookie value.
+ *
+ * Returns -EINVAL if no living task has registered as a
+ * dcookie user.
+ *
+ * Returns 0 on success, with *cookie filled in
+ */
+int get_dcookie(struct dentry * dentry, struct vfsmount * vfsmnt,
+ u32 * cookie);
+
+#else
+
+struct dcookie_user * dcookie_register(void)
+{
+ return 0;
+}
+
+void dcookie_unregister(struct dcookie_user * user)
+{
+ return;
+}
+
+static inline int get_dcookie(struct dentry * dentry,
+ struct vfsmount * vfsmnt, u32 * cookie)
+{
+ return -ENOSYS;
+}
+
+#endif /* CONFIG_PROFILING */
+
+#endif /* DCOOKIES_H */
diff --git a/include/linux/device.h b/include/linux/device.h
index 3290c5c40276..80a63939f924 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -329,6 +329,9 @@ dev_set_drvdata (struct device *dev, void *data)
*/
extern int device_register(struct device * dev);
extern void device_unregister(struct device * dev);
+extern void device_initialize(struct device * dev);
+extern int device_add(struct device * dev);
+extern void device_del(struct device * dev);
/* driverfs interface for exporting device attributes */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 93148f1659b0..bca164f4265a 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -359,6 +359,7 @@ struct block_device {
sector_t bd_offset;
unsigned bd_part_count;
int bd_invalidated;
+ struct gendisk * bd_disk;
};
struct inode {
@@ -1087,6 +1088,7 @@ extern struct file_operations def_blk_fops;
extern struct address_space_operations def_blk_aops;
extern struct file_operations def_fifo_fops;
extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
+extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long);
extern int blkdev_get(struct block_device *, mode_t, unsigned, int);
extern int blkdev_put(struct block_device *, int);
extern int bd_claim(struct block_device *, void *);
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 62781b452fe9..9de2f51ae935 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -62,17 +62,19 @@ struct hd_struct {
sector_t start_sect;
sector_t nr_sects;
devfs_handle_t de; /* primary (master) devfs entry */
- struct device hd_driverfs_dev; /* support driverfs hiearchy */
+ struct device *hd_driverfs_dev; /* support driverfs hiearchy */
};
#define GENHD_FL_REMOVABLE 1
#define GENHD_FL_DRIVERFS 2
#define GENHD_FL_DEVFS 4
#define GENHD_FL_CD 8
+#define GENHD_FL_UP 16
struct gendisk {
int major; /* major number of driver */
int first_minor;
+ int minors;
int minor_shift; /* number of times minor is shifted to
get real minor */
char disk_name[16]; /* name of major driver */
@@ -88,6 +90,10 @@ struct gendisk {
devfs_handle_t disk_de; /* piled higher and deeper */
struct device *driverfs_dev;
struct device disk_dev;
+
+ unsigned sync_io; /* RAID */
+ unsigned reads, writes;
+ unsigned rio, wio;
};
/* drivers/block/genhd.c */
@@ -260,21 +266,16 @@ struct unixware_disklabel {
char *disk_name (struct gendisk *hd, int part, char *buf);
extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev);
-extern void update_partition(struct gendisk *disk, int part);
+extern void add_partition(struct gendisk *, int, sector_t, sector_t);
+extern void delete_partition(struct gendisk *, int);
-extern struct gendisk *alloc_disk(void);
+extern struct gendisk *alloc_disk(int minors);
+extern struct gendisk *get_disk(struct gendisk *disk);
extern void put_disk(struct gendisk *disk);
/* will go away */
extern void blk_set_probe(int major, struct gendisk *(p)(int));
-static inline unsigned int disk_index (kdev_t dev)
-{
- int part;
- struct gendisk *g = get_gendisk(kdev_t_to_nr(dev), &part);
- return g ? (minor(dev) >> g->minor_shift) : 0;
-}
-
#endif
#endif
diff --git a/include/linux/mtd/concat.h b/include/linux/mtd/concat.h
new file mode 100644
index 000000000000..ed8dc6755219
--- /dev/null
+++ b/include/linux/mtd/concat.h
@@ -0,0 +1,23 @@
+/*
+ * MTD device concatenation layer definitions
+ *
+ * (C) 2002 Robert Kaiser <rkaiser@sysgo.de>
+ *
+ * This code is GPL
+ *
+ * $Id: concat.h,v 1.1 2002/03/08 16:34:36 rkaiser Exp $
+ */
+
+#ifndef MTD_CONCAT_H
+#define MTD_CONCAT_H
+
+
+struct mtd_info *mtd_concat_create(
+ struct mtd_info *subdev[], /* subdevices to concatenate */
+ int num_devs, /* number of subdevices */
+ char *name); /* name for the new device */
+
+void mtd_concat_destroy(struct mtd_info *mtd);
+
+#endif
+
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_core.h b/include/linux/netfilter_ipv4/ip_conntrack_core.h
index 7d8b393f3c44..c46f0e86fe60 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_core.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_core.h
@@ -17,7 +17,7 @@ extern void ip_conntrack_cleanup(void);
struct ip_conntrack_protocol;
extern struct ip_conntrack_protocol *ip_ct_find_proto(u_int8_t protocol);
/* Like above, but you already have conntrack read lock. */
-extern struct ip_conntrack_protocol *__find_proto(u_int8_t protocol);
+extern struct ip_conntrack_protocol *__ip_ct_find_proto(u_int8_t protocol);
extern struct list_head protocol_list;
/* Returns conntrack if it dealt with ICMP, and filled in skb->nfct */
diff --git a/include/linux/nfs.h b/include/linux/nfs.h
index 181e8decebfc..d99650a19b55 100644
--- a/include/linux/nfs.h
+++ b/include/linux/nfs.h
@@ -120,7 +120,7 @@ enum nfs_ftype {
/*
* This is the kernel NFS client file handle representation
*/
-#define NFS_MAXFHSIZE 64
+#define NFS_MAXFHSIZE 128
struct nfs_fh {
unsigned short size;
unsigned char data[NFS_MAXFHSIZE];
diff --git a/include/linux/nfs3.h b/include/linux/nfs3.h
index 359c73e00841..7f11fa589207 100644
--- a/include/linux/nfs3.h
+++ b/include/linux/nfs3.h
@@ -59,6 +59,11 @@ enum nfs3_ftype {
NF3BAD = 8
};
+struct nfs3_fh {
+ unsigned short size;
+ unsigned char data[NFS3_FHSIZE];
+};
+
#define NFS3_VERSION 3
#define NFS3PROC_NULL 0
#define NFS3PROC_GETATTR 1
diff --git a/include/linux/nfs4_mount.h b/include/linux/nfs4_mount.h
new file mode 100644
index 000000000000..9a782c2bbdd3
--- /dev/null
+++ b/include/linux/nfs4_mount.h
@@ -0,0 +1,70 @@
+#ifndef _LINUX_NFS4_MOUNT_H
+#define _LINUX_NFS4_MOUNT_H
+
+/*
+ * linux/include/linux/nfs4_mount.h
+ *
+ * Copyright (C) 2002 Trond Myklebust
+ *
+ * structure passed from user-space to kernel-space during an nfsv4 mount
+ */
+
+/*
+ * WARNING! Do not delete or change the order of these fields. If
+ * a new field is required then add it to the end. The version field
+ * tracks which fields are present. This will ensure some measure of
+ * mount-to-kernel version compatibility. Some of these aren't used yet
+ * but here they are anyway.
+ */
+#define NFS4_MOUNT_VERSION 1
+
+struct nfs_string {
+ unsigned int len;
+ const char* data;
+};
+
+struct nfs4_mount_data {
+ int version; /* 1 */
+ int flags; /* 1 */
+ int rsize; /* 1 */
+ int wsize; /* 1 */
+ int timeo; /* 1 */
+ int retrans; /* 1 */
+ int acregmin; /* 1 */
+ int acregmax; /* 1 */
+ int acdirmin; /* 1 */
+ int acdirmax; /* 1 */
+
+ /* see the definition of 'struct clientaddr4' in RFC3010 */
+ struct nfs_string client_addr; /* 1 */
+
+ /* Mount path */
+ struct nfs_string mnt_path; /* 1 */
+
+ /* Server details */
+ struct nfs_string hostname; /* 1 */
+ /* Server IP address */
+ unsigned int host_addrlen; /* 1 */
+ struct sockaddr* host_addr; /* 1 */
+
+ /* Transport protocol to use */
+ int proto; /* 1 */
+
+ /* Pseudo-flavours to use for authentication. See RFC2623 */
+ int auth_flavourlen; /* 1 */
+ int *auth_flavours; /* 1 */
+};
+
+/* bits in the flags field */
+/* Note: the fields that correspond to existing NFSv2/v3 mount options
+ * should mirror the values from include/linux/nfs_mount.h
+ */
+
+#define NFS4_MOUNT_SOFT 0x0001 /* 1 */
+#define NFS4_MOUNT_INTR 0x0002 /* 1 */
+#define NFS4_MOUNT_NOCTO 0x0010 /* 1 */
+#define NFS4_MOUNT_NOAC 0x0020 /* 1 */
+#define NFS4_MOUNT_STRICTLOCK 0x1000 /* 1 */
+#define NFS4_MOUNT_FLAGMASK 0xFFFF
+
+#endif
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 4c35f7cbb97c..3a23ac81e80f 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -472,6 +472,55 @@ extern void * nfs_root_data(void);
#define NFS_JUKEBOX_RETRY_TIME (5 * HZ)
+#ifdef CONFIG_NFS_V4
+struct nfs4_client {
+ atomic_t cl_count; /* refcount */
+ u64 cl_clientid; /* constant */
+ nfs4_verifier cl_confirm;
+
+ /*
+ * Starts a list of lockowners, linked through lo_list.
+ */
+ struct list_head cl_lockowners; /* protected by state_spinlock */
+};
+
+/* nfs4proc.c */
+extern int nfs4_proc_renew(struct nfs_server *server);
+
+/* nfs4renewd.c */
+extern int nfs4_init_renewd(struct nfs_server *server);
+#endif /* CONFIG_NFS_V4 */
+
+#ifdef CONFIG_NFS_V4
+
+extern struct nfs4_client *nfs4_get_client(void);
+extern void nfs4_put_client(struct nfs4_client *clp);
+
+struct nfs4_mount_data;
+static inline int
+create_nfsv4_state(struct nfs_server *server, struct nfs4_mount_data *data)
+{
+ server->nfs4_state = NULL;
+ return 0;
+}
+
+static inline void
+destroy_nfsv4_state(struct nfs_server *server)
+{
+ if (server->mnt_path) {
+ kfree(server->mnt_path);
+ server->mnt_path = NULL;
+ }
+ if (server->nfs4_state) {
+ nfs4_put_client(server->nfs4_state);
+ server->nfs4_state = NULL;
+ }
+}
+#else
+#define create_nfsv4_state(server, data) 0
+#define destroy_nfsv4_state(server) do { } while (0)
+#endif
+
#endif /* __KERNEL__ */
/*
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 080c98fed1dd..d171608d7105 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -30,6 +30,16 @@ struct nfs_server {
lru_busy;
struct nfs_fh fh;
struct sockaddr_in addr;
+#if CONFIG_NFS_V4
+ /* Our own IP address, as a null-terminated string.
+ * This is used to generate the clientid, and the callback address.
+ */
+ char ip_addr[16];
+ char * mnt_path;
+ struct nfs4_client * nfs4_state; /* all NFSv4 state starts here */
+ unsigned long lease_time; /* in jiffies */
+ unsigned long last_renewal; /* in jiffies */
+#endif
};
/* Server capabilities */
diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h
index 2b552936eeca..223ed3462064 100644
--- a/include/linux/nfs_mount.h
+++ b/include/linux/nfs_mount.h
@@ -10,6 +10,8 @@
*/
#include <linux/in.h>
#include <linux/nfs.h>
+#include <linux/nfs2.h>
+#include <linux/nfs3.h>
/*
* WARNING! Do not delete or change the order of these fields. If
@@ -37,7 +39,7 @@ struct nfs_mount_data {
char hostname[256]; /* 1 */
int namlen; /* 2 */
unsigned int bsize; /* 3 */
- struct nfs_fh root; /* 4 */
+ struct nfs3_fh root; /* 4 */
};
/* bits in the flags field */
@@ -53,6 +55,10 @@ struct nfs_mount_data {
#define NFS_MOUNT_KERBEROS 0x0100 /* 3 */
#define NFS_MOUNT_NONLM 0x0200 /* 3 */
#define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */
+#if 0
+#define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */
+#define NFS_MOUNT_SECFLAVOUR 0x2000 /* reserved */
+#endif
#define NFS_MOUNT_FLAGMASK 0xFFFF
#endif
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index b71b1b217c70..4bb5125056e7 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -50,6 +50,7 @@ struct nfs_fattr {
* Info on the file system
*/
struct nfs_fsinfo {
+ struct nfs_fattr *fattr; /* Post-op attributes */
__u32 rtmax; /* max. read transfer size */
__u32 rtpref; /* pref. read transfer size */
__u32 rtmult; /* reads should be multiple of this */
@@ -58,16 +59,31 @@ struct nfs_fsinfo {
__u32 wtmult; /* writes should be multiple of this */
__u32 dtpref; /* pref. readdir transfer size */
__u64 maxfilesize;
- __u64 bsize; /* block size */
+ __u32 lease_time; /* in seconds */
+};
+
+struct nfs_fsstat {
+ struct nfs_fattr *fattr; /* Post-op attributes */
__u64 tbytes; /* total size in bytes */
__u64 fbytes; /* # of free bytes */
__u64 abytes; /* # of bytes available to user */
__u64 tfiles; /* # of files */
__u64 ffiles; /* # of free files */
__u64 afiles; /* # of files available to user */
- __u32 linkmax;/* max # of hard links */
- __u32 namelen;/* max name length */
- __u32 lease_time; /* in seconds */
+};
+
+struct nfs2_fsstat {
+ __u32 tsize; /* Server transfer size */
+ __u32 bsize; /* Filesystem block size */
+ __u32 blocks; /* No. of "bsize" blocks on filesystem */
+ __u32 bfree; /* No. of free "bsize" blocks */
+ __u32 bavail; /* No. of available "bsize" blocks */
+};
+
+struct nfs_pathconf {
+ struct nfs_fattr *fattr; /* Post-op attributes */
+ __u32 max_link; /* max # of hard links */
+ __u32 max_namelen; /* max name length */
};
/*
@@ -309,6 +325,219 @@ struct nfs3_readdirres {
int plus;
};
+#ifdef CONFIG_NFS_V4
+
+typedef u64 clientid4;
+
+struct nfs4_change_info {
+ u32 atomic;
+ u64 before;
+ u64 after;
+};
+
+struct nfs4_access {
+ u32 ac_req_access; /* request */
+ u32 * ac_resp_supported; /* response */
+ u32 * ac_resp_access; /* response */
+};
+
+struct nfs4_close {
+ char * cl_stateid; /* request */
+ u32 cl_seqid; /* request */
+};
+
+struct nfs4_commit {
+ u64 co_start; /* request */
+ u32 co_len; /* request */
+ struct nfs_writeverf * co_verifier; /* response */
+};
+
+struct nfs4_create {
+ u32 cr_ftype; /* request */
+ union { /* request */
+ struct {
+ u32 textlen;
+ const char * text;
+ } symlink; /* NF4LNK */
+ struct {
+ u32 specdata1;
+ u32 specdata2;
+ } device; /* NF4BLK, NF4CHR */
+ } u;
+ u32 cr_namelen; /* request */
+ const char * cr_name; /* request */
+ struct iattr * cr_attrs; /* request */
+ struct nfs4_change_info * cr_cinfo; /* response */
+};
+#define cr_textlen u.symlink.textlen
+#define cr_text u.symlink.text
+#define cr_specdata1 u.device.specdata1
+#define cr_specdata2 u.device.specdata2
+
+struct nfs4_getattr {
+ u32 * gt_bmval; /* request */
+ struct nfs_fattr * gt_attrs; /* response */
+ struct nfs_fsstat * gt_fsstat; /* response */
+ struct nfs_fsinfo * gt_fsinfo; /* response */
+ struct nfs_pathconf * gt_pathconf; /* response */
+ u32 * gt_bmres; /* response */
+};
+
+struct nfs4_getfh {
+ struct nfs_fh * gf_fhandle; /* response */
+};
+
+struct nfs4_link {
+ u32 ln_namelen; /* request */
+ const char * ln_name; /* request */
+ struct nfs4_change_info * ln_cinfo; /* response */
+};
+
+struct nfs4_lookup {
+ struct qstr * lo_name; /* request */
+};
+
+struct nfs4_open {
+ u32 op_share_access; /* request */
+ u32 op_opentype; /* request */
+ u32 op_createmode; /* request */
+ union { /* request */
+ struct iattr * attrs; /* UNCHECKED, GUARDED */
+ nfs4_verifier verifier; /* EXCLUSIVE */
+ } u;
+ struct qstr * op_name; /* request */
+ char * op_stateid; /* response */
+ struct nfs4_change_info * op_cinfo; /* response */
+ u32 * op_rflags; /* response */
+};
+#define op_attrs u.attrs
+#define op_verifier u.verifier
+
+struct nfs4_open_confirm {
+ char * oc_stateid; /* request */
+};
+
+struct nfs4_putfh {
+ struct nfs_fh * pf_fhandle; /* request */
+};
+
+struct nfs4_read {
+ u64 rd_offset; /* request */
+ u32 rd_length; /* request */
+ u32 *rd_eof; /* response */
+ u32 *rd_bytes_read; /* response */
+ struct page ** rd_pages; /* zero-copy data */
+ unsigned int rd_pgbase; /* zero-copy data */
+};
+
+struct nfs4_readdir {
+ u64 rd_cookie; /* request */
+ nfs4_verifier rd_req_verifier; /* request */
+ u32 rd_count; /* request */
+ u32 rd_bmval[2]; /* request */
+ nfs4_verifier rd_resp_verifier; /* response */
+ struct page ** rd_pages; /* zero-copy data */
+ unsigned int rd_pgbase; /* zero-copy data */
+};
+
+struct nfs4_readlink {
+ u32 rl_count; /* zero-copy data */
+ struct page ** rl_pages; /* zero-copy data */
+};
+
+struct nfs4_remove {
+ u32 rm_namelen; /* request */
+ const char * rm_name; /* request */
+ struct nfs4_change_info * rm_cinfo; /* response */
+};
+
+struct nfs4_rename {
+ u32 rn_oldnamelen; /* request */
+ const char * rn_oldname; /* request */
+ u32 rn_newnamelen; /* request */
+ const char * rn_newname; /* request */
+ struct nfs4_change_info * rn_src_cinfo; /* response */
+ struct nfs4_change_info * rn_dst_cinfo; /* response */
+};
+
+struct nfs4_setattr {
+ char * st_stateid; /* request */
+ struct iattr * st_iap; /* request */
+};
+
+struct nfs4_setclientid {
+ nfs4_verifier sc_verifier; /* request */
+ char * sc_name; /* request */
+ u32 sc_prog; /* request */
+ char sc_netid[4]; /* request */
+ char sc_uaddr[24]; /* request */
+ u32 sc_cb_ident; /* request */
+};
+
+struct nfs4_write {
+ u64 wr_offset; /* request */
+ u32 wr_stable_how; /* request */
+ u32 wr_len; /* request */
+ u32 * wr_bytes_written; /* response */
+ struct nfs_writeverf * wr_verf; /* response */
+ struct page ** wr_pages; /* zero-copy data */
+ unsigned int wr_pgbase; /* zero-copy data */
+};
+
+struct nfs4_op {
+ u32 opnum;
+ u32 nfserr;
+ union {
+ struct nfs4_access access;
+ struct nfs4_close close;
+ struct nfs4_commit commit;
+ struct nfs4_create create;
+ struct nfs4_getattr getattr;
+ struct nfs4_getfh getfh;
+ struct nfs4_link link;
+ struct nfs4_lookup lookup;
+ struct nfs4_open open;
+ struct nfs4_open_confirm open_confirm;
+ struct nfs4_putfh putfh;
+ struct nfs4_read read;
+ struct nfs4_readdir readdir;
+ struct nfs4_readlink readlink;
+ struct nfs4_remove remove;
+ struct nfs4_rename rename;
+ struct nfs4_setattr setattr;
+ struct nfs4_setclientid setclientid;
+ struct nfs4_write write;
+ } u;
+};
+
+struct nfs4_compound {
+ unsigned int flags; /* defined below */
+ struct nfs_server * server;
+
+ /* RENEW information */
+ int renew_index;
+ unsigned long timestamp;
+
+ /* scratch variables for XDR encode/decode */
+ int nops;
+ u32 * p;
+ u32 * end;
+
+ /* the individual COMPOUND operations */
+ struct nfs4_op *ops;
+
+ /* request */
+ int req_nops;
+ u32 taglen;
+ char * tag;
+
+ /* response */
+ int resp_nops;
+ int toplevel_status;
+};
+
+#endif /* CONFIG_NFS_V4 */
+
struct nfs_read_data {
struct rpc_task task;
struct inode *inode;
@@ -322,7 +551,12 @@ struct nfs_read_data {
struct nfs_readres res;
} v3; /* also v2 */
#ifdef CONFIG_NFS_V4
- /* NFSv4 data will come here... */
+ struct {
+ struct nfs4_compound compound;
+ struct nfs4_op ops[3];
+ u32 res_count;
+ u32 res_eof;
+ } v4;
#endif
} u;
};
@@ -337,11 +571,17 @@ struct nfs_write_data {
struct page *pagevec[NFS_WRITE_MAXIOV];
union {
struct {
- struct nfs_writeargs args;
- struct nfs_writeres res;
+ struct nfs_writeargs args; /* argument struct */
+ struct nfs_writeres res; /* result struct */
} v3;
#ifdef CONFIG_NFS_V4
- /* NFSv4 data to come here... */
+ struct {
+ struct nfs4_compound compound;
+ struct nfs4_op ops[3];
+ u32 arg_count;
+ u32 arg_stable;
+ u32 res_count;
+ } v4;
#endif
} u;
};
@@ -391,7 +631,11 @@ struct nfs_rpc_ops {
int (*mknod) (struct inode *, struct qstr *, struct iattr *,
dev_t, struct nfs_fh *, struct nfs_fattr *);
int (*statfs) (struct nfs_server *, struct nfs_fh *,
+ struct nfs_fsstat *);
+ int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
struct nfs_fsinfo *);
+ int (*pathconf) (struct nfs_server *, struct nfs_fh *,
+ struct nfs_pathconf *);
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);
@@ -410,8 +654,10 @@ struct nfs_rpc_ops {
*/
extern struct nfs_rpc_ops nfs_v2_clientops;
extern struct nfs_rpc_ops nfs_v3_clientops;
+extern struct nfs_rpc_ops nfs_v4_clientops;
extern struct rpc_version nfs_version2;
extern struct rpc_version nfs_version3;
+extern struct rpc_version nfs_version4;
extern struct rpc_program nfs_program;
extern struct rpc_stat nfs_rpcstat;
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
new file mode 100644
index 000000000000..982b64e0518a
--- /dev/null
+++ b/include/linux/oprofile.h
@@ -0,0 +1,98 @@
+/**
+ * @file oprofile.h
+ *
+ * API for machine-specific interrupts to interface
+ * to oprofile.
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon <levon@movementarian.org>
+ */
+
+#ifndef OPROFILE_H
+#define OPROFILE_H
+
+#include <linux/types.h>
+#include <linux/spinlock.h>
+#include <asm/atomic.h>
+
+struct super_block;
+struct dentry;
+struct file_operations;
+
+enum oprofile_cpu {
+ OPROFILE_CPU_PPRO,
+ OPROFILE_CPU_PII,
+ OPROFILE_CPU_PIII,
+ OPROFILE_CPU_ATHLON,
+ OPROFILE_CPU_TIMER
+};
+
+/* Operations structure to be filled in */
+struct oprofile_operations {
+ /* create any necessary configuration files in the oprofile fs.
+ * Optional. */
+ int (*create_files)(struct super_block * sb, struct dentry * root);
+ /* Do any necessary interrupt setup. Optional. */
+ int (*setup)(void);
+ /* Do any necessary interrupt shutdown. Optional. */
+ void (*shutdown)(void);
+ /* Start delivering interrupts. */
+ int (*start)(void);
+ /* Stop delivering interrupts. */
+ void (*stop)(void);
+};
+
+/**
+ * One-time initialisation. *ops must be set to a filled-in
+ * operations structure. oprofile_cpu_type must be set.
+ * Return 0 on success.
+ */
+int oprofile_arch_init(struct oprofile_operations ** ops, enum oprofile_cpu * cpu);
+
+/**
+ * Add a sample. This may be called from any context. Pass
+ * smp_processor_id() as cpu.
+ */
+extern void FASTCALL(oprofile_add_sample(unsigned long eip, unsigned long event, int cpu));
+
+/**
+ * Create a file of the given name as a child of the given root, with
+ * the specified file operations.
+ */
+int oprofilefs_create_file(struct super_block * sb, struct dentry * root,
+ char const * name, struct file_operations * fops);
+
+/** Create a file for read/write access to an unsigned long. */
+int oprofilefs_create_ulong(struct super_block * sb, struct dentry * root,
+ char const * name, ulong * val);
+
+/** Create a file for read-only access to an unsigned long. */
+int oprofilefs_create_ro_ulong(struct super_block * sb, struct dentry * root,
+ char const * name, ulong * val);
+
+/** Create a file for read-only access to an atomic_t. */
+int oprofilefs_create_ro_atomic(struct super_block * sb, struct dentry * root,
+ char const * name, atomic_t * val);
+
+/** create a directory */
+struct dentry * oprofilefs_mkdir(struct super_block * sb, struct dentry * root,
+ char const * name);
+
+/**
+ * Convert an unsigned long value into ASCII and copy it to the user buffer @buf,
+ * updating *offset appropriately. Returns bytes written or -EFAULT.
+ */
+ssize_t oprofilefs_ulong_to_user(unsigned long * val, char * buf, size_t count, loff_t * offset);
+
+/**
+ * Read an ASCII string for a number from a userspace buffer and fill *val on success.
+ * Returns 0 on success, < 0 on error.
+ */
+int oprofilefs_ulong_from_user(unsigned long * val, char const * buf, size_t count);
+
+/** lock for read/write safety */
+extern spinlock_t oprofilefs_lock;
+
+#endif /* OPROFILE_H */
diff --git a/include/linux/profile.h b/include/linux/profile.h
new file mode 100644
index 000000000000..11fbe9cec572
--- /dev/null
+++ b/include/linux/profile.h
@@ -0,0 +1,67 @@
+#ifndef _LINUX_PROFILE_H
+#define _LINUX_PROFILE_H
+
+#ifdef __KERNEL__
+
+#include <linux/kernel.h>
+#include <linux/config.h>
+#include <linux/init.h>
+#include <asm/errno.h>
+
+/* parse command line */
+int __init profile_setup(char * str);
+
+/* init basic kernel profiler */
+void __init profile_init(void);
+
+extern unsigned int * prof_buffer;
+extern unsigned long prof_len;
+extern unsigned long prof_shift;
+
+
+enum profile_type {
+ EXIT_TASK,
+ EXIT_MMAP,
+ EXEC_UNMAP
+};
+
+#ifdef CONFIG_PROFILING
+
+struct notifier_block;
+struct task_struct;
+struct mm_struct;
+
+/* task is in do_exit() */
+void profile_exit_task(struct task_struct * task);
+
+/* change of vma mappings */
+void profile_exec_unmap(struct mm_struct * mm);
+
+/* exit of all vmas for a task */
+void profile_exit_mmap(struct mm_struct * mm);
+
+int profile_event_register(enum profile_type, struct notifier_block * n);
+
+int profile_event_unregister(enum profile_type, struct notifier_block * n);
+
+#else
+
+static inline int profile_event_register(enum profile_type t, struct notifier_block * n)
+{
+ return -ENOSYS;
+}
+
+static inline int profile_event_unregister(enum profile_type t, struct notifier_block * n)
+{
+ return -ENOSYS;
+}
+
+#define profile_exit_task(a) do { } while (0)
+#define profile_exec_unmap(a) do { } while (0)
+#define profile_exit_mmap(a) do { } while (0)
+
+#endif /* CONFIG_PROFILING */
+
+#endif /* __KERNEL__ */
+
+#endif /* _LINUX_PROFILE_H */
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
new file mode 100644
index 000000000000..a5ffb7bb5743
--- /dev/null
+++ b/include/linux/rcupdate.h
@@ -0,0 +1,134 @@
+/*
+ * Read-Copy Update mechanism for mutual exclusion
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Copyright (c) IBM Corporation, 2001
+ *
+ * Author: Dipankar Sarma <dipankar@in.ibm.com>
+ *
+ * Based on the original work by Paul McKenney <paul.mckenney@us.ibm.com>
+ * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen.
+ * Papers:
+ * http://www.rdrop.com/users/paulmck/paper/rclockpdcsproof.pdf
+ * http://lse.sourceforge.net/locking/rclock_OLS.2001.05.01c.sc.pdf (OLS2001)
+ *
+ * For detailed explanation of Read-Copy Update mechanism see -
+ * http://lse.sourceforge.net/locking/rcupdate.html
+ *
+ */
+
+#ifndef __LINUX_RCUPDATE_H
+#define __LINUX_RCUPDATE_H
+
+#ifdef __KERNEL__
+
+#include <linux/cache.h>
+#include <linux/list.h>
+#include <linux/spinlock.h>
+#include <linux/threads.h>
+
+/**
+ * struct rcu_head - callback structure for use with RCU
+ * @list: list_head to queue the update requests
+ * @func: actual update function to call after the grace period.
+ * @arg: argument to be passed to the actual update function.
+ */
+struct rcu_head {
+ struct list_head list;
+ void (*func)(void *obj);
+ void *arg;
+};
+
+#define RCU_HEAD_INIT(head) \
+ { list: LIST_HEAD_INIT(head.list), func: NULL, arg: NULL }
+#define RCU_HEAD(head) struct rcu_head head = RCU_HEAD_INIT(head)
+#define INIT_RCU_HEAD(ptr) do { \
+ INIT_LIST_HEAD(&(ptr)->list); (ptr)->func = NULL; (ptr)->arg = NULL; \
+} while (0)
+
+
+
+/* Control variables for rcupdate callback mechanism. */
+struct rcu_ctrlblk {
+ spinlock_t mutex; /* Guard this struct */
+ long curbatch; /* Current batch number. */
+ long maxbatch; /* Max requested batch number. */
+ unsigned long rcu_cpu_mask; /* CPUs that need to switch in order */
+ /* for current batch to proceed. */
+};
+
+/* Is batch a before batch b ? */
+static inline int rcu_batch_before(long a, long b)
+{
+ return (a - b) < 0;
+}
+
+/* Is batch a after batch b ? */
+static inline int rcu_batch_after(long a, long b)
+{
+ return (a - b) > 0;
+}
+
+/*
+ * Per-CPU data for Read-Copy UPdate.
+ * nxtlist - new callbacks are added here
+ * curlist - current batch for which quiescent cycle started if any
+ */
+struct rcu_data {
+ long qsctr; /* User-mode/idle loop etc. */
+ long last_qsctr; /* value of qsctr at beginning */
+ /* of rcu grace period */
+ long batch; /* Batch # for current RCU batch */
+ struct list_head nxtlist;
+ struct list_head curlist;
+} ____cacheline_aligned_in_smp;
+
+extern struct rcu_data rcu_data[NR_CPUS];
+extern struct rcu_ctrlblk rcu_ctrlblk;
+
+#define RCU_qsctr(cpu) (rcu_data[(cpu)].qsctr)
+#define RCU_last_qsctr(cpu) (rcu_data[(cpu)].last_qsctr)
+#define RCU_batch(cpu) (rcu_data[(cpu)].batch)
+#define RCU_nxtlist(cpu) (rcu_data[(cpu)].nxtlist)
+#define RCU_curlist(cpu) (rcu_data[(cpu)].curlist)
+
+#define RCU_QSCTR_INVALID 0
+
+static inline int rcu_pending(int cpu)
+{
+ if ((!list_empty(&RCU_curlist(cpu)) &&
+ rcu_batch_before(RCU_batch(cpu), rcu_ctrlblk.curbatch)) ||
+ (list_empty(&RCU_curlist(cpu)) &&
+ !list_empty(&RCU_nxtlist(cpu))) ||
+ test_bit(cpu, &rcu_ctrlblk.rcu_cpu_mask))
+ return 1;
+ else
+ return 0;
+}
+
+#define rcu_read_lock() preempt_disable()
+#define rcu_read_unlock() preempt_enable()
+
+extern void rcu_init(void);
+extern void rcu_check_callbacks(int cpu, int user);
+
+/* Exported interfaces */
+extern void FASTCALL(call_rcu(struct rcu_head *head,
+ void (*func)(void *arg), void *arg));
+extern void synchronize_kernel(void);
+
+#endif /* __KERNEL__ */
+#endif /* __LINUX_RCUPDATE_H */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 89c4ead4cf4b..764a3ebf3c24 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -492,10 +492,6 @@ extern unsigned long itimer_ticks;
extern unsigned long itimer_next;
extern void do_timer(struct pt_regs *);
-extern unsigned int * prof_buffer;
-extern unsigned long prof_len;
-extern unsigned long prof_shift;
-
extern void FASTCALL(__wake_up(wait_queue_head_t *q, unsigned int mode, int nr));
extern void FASTCALL(__wake_up_locked(wait_queue_head_t *q, unsigned int mode));
extern void FASTCALL(__wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr));
diff --git a/include/linux/vcache.h b/include/linux/vcache.h
index d5756643332c..5708fe6a908a 100644
--- a/include/linux/vcache.h
+++ b/include/linux/vcache.h
@@ -18,7 +18,7 @@ extern void __attach_vcache(vcache_t *vcache,
struct mm_struct *mm,
void (*callback)(struct vcache_s *data, struct page *new_page));
-extern void detach_vcache(vcache_t *vcache);
+extern void __detach_vcache(vcache_t *vcache);
extern void invalidate_vcache(unsigned long address, struct mm_struct *mm,
struct page *new_page);