summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorDavid S. Miller <davem@nuts.ninka.net>2002-12-20 02:09:54 -0800
committerDavid S. Miller <davem@nuts.ninka.net>2002-12-20 02:09:54 -0800
commit3c537481aa9a7d60f6a4af0f8fc4833cdab22e10 (patch)
treea17f44aa550256982dd87d30dc4492c9c6f0c382 /include/linux
parentcbbe8b8e249d470ff0baa2c0ad7fb1481ec54007 (diff)
parent8c977c50297268655ee41a5f8a7e5eee5851af25 (diff)
Merge nuts.ninka.net:/home/davem/src/BK/sparcwork-2.5
into nuts.ninka.net:/home/davem/src/BK/sparc-2.5
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/agp_backend.h1
-rw-r--r--include/linux/binfmts.h2
-rw-r--r--include/linux/buffer_head.h2
-rw-r--r--include/linux/compat.h16
-rw-r--r--include/linux/cpufreq.h20
-rw-r--r--include/linux/device-mapper.h9
-rw-r--r--include/linux/dm-ioctl.h6
-rw-r--r--include/linux/fs.h13
-rw-r--r--include/linux/hugetlb.h2
-rw-r--r--include/linux/init.h20
-rw-r--r--include/linux/intermezzo_fs.h931
-rw-r--r--include/linux/intermezzo_journal.h26
-rw-r--r--include/linux/intermezzo_kml.h261
-rw-r--r--include/linux/intermezzo_psdev.h57
-rw-r--r--include/linux/intermezzo_upcall.h146
-rw-r--r--include/linux/kernel.h11
-rw-r--r--include/linux/mm.h3
-rw-r--r--include/linux/module.h45
-rw-r--r--include/linux/moduleparam.h127
-rw-r--r--include/linux/nfs4.h10
-rw-r--r--include/linux/nfs_fs.h2
-rw-r--r--include/linux/nfs_xdr.h1
-rw-r--r--include/linux/oprofile.h2
-rw-r--r--include/linux/page-flags.h47
-rw-r--r--include/linux/pci_ids.h3
-rw-r--r--include/linux/reiserfs_fs.h3
-rw-r--r--include/linux/sched.h5
-rw-r--r--include/linux/sem.h2
-rw-r--r--include/linux/sonypi.h6
-rw-r--r--include/linux/sunrpc/xdr.h4
-rw-r--r--include/linux/swap.h3
-rw-r--r--include/linux/sysctl.h1
-rw-r--r--include/linux/usb.h3
-rw-r--r--include/linux/writeback.h26
34 files changed, 304 insertions, 1512 deletions
diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h
index fe59e8cf0378..e6fa886e8d82 100644
--- a/include/linux/agp_backend.h
+++ b/include/linux/agp_backend.h
@@ -51,6 +51,7 @@ enum chipset_type {
INTEL_I850,
INTEL_I860,
INTEL_460GX,
+ INTEL_I7505,
VIA_GENERIC,
VIA_VP3,
VIA_MVP3,
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index dfea0f47ed3e..ae1b454395b5 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -57,7 +57,7 @@ extern int setup_arg_pages(struct linux_binprm * bprm);
extern int copy_strings(int argc,char ** argv,struct linux_binprm *bprm);
extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm);
extern void compute_creds(struct linux_binprm *binprm);
-extern int do_coredump(long signr, struct pt_regs * regs);
+extern int do_coredump(long signr, int exit_code, struct pt_regs * regs);
extern void set_binfmt(struct linux_binfmt *new);
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 4e7a9bbf99dd..e9d6251fa168 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -178,7 +178,7 @@ extern int buffer_heads_over_limit;
*/
int try_to_release_page(struct page * page, int gfp_mask);
int block_invalidatepage(struct page *page, unsigned long offset);
-int block_write_full_page(struct page*, get_block_t*);
+int block_write_full_page(struct page *page, get_block_t *get_block, struct writeback_control *wbc);
int block_read_full_page(struct page*, get_block_t*);
int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*);
int cont_prepare_write(struct page*, unsigned, unsigned, get_block_t*,
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 5aa29316f9d8..62daefb17672 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -1,15 +1,18 @@
#ifndef _LINUX_COMPAT_H
#define _LINUX_COMPAT_H
/*
- * These are the type definitions for the arhitecure sepcific
- * compatibility layer.
+ * These are the type definitions for the architecture specific
+ * syscall compatibility layer.
*/
#include <linux/config.h>
#ifdef CONFIG_COMPAT
+#include <linux/stat.h>
#include <asm/compat.h>
+#define compat_jiffies_to_clock_t(x) ((x) / (HZ / COMPAT_USER_HZ))
+
struct compat_utimbuf {
compat_time_t actime;
compat_time_t modtime;
@@ -20,5 +23,14 @@ struct compat_itimerval {
struct compat_timeval it_value;
};
+struct compat_tms {
+ compat_clock_t tms_utime;
+ compat_clock_t tms_stime;
+ compat_clock_t tms_cutime;
+ compat_clock_t tms_cstime;
+};
+
+extern int cp_compat_stat(struct kstat *, struct compat_stat *);
+
#endif /* CONFIG_COMPAT */
#endif /* _LINUX_COMPAT_H */
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index a8f8d2a31936..e93501c7a0b8 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -37,15 +37,26 @@ int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list);
#define CPUFREQ_POLICY_POWERSAVE (1)
#define CPUFREQ_POLICY_PERFORMANCE (2)
-/* values here are CPU kHz so that hardware which doesn't run with some
- * frequencies can complain without having to guess what per cent / per
- * mille means. */
+/* Frequency values here are CPU kHz so that hardware which doesn't run
+ * with some frequencies can complain without having to guess what per
+ * cent / per mille means.
+ * Maximum transition latency is in nanoseconds - if it's unknown,
+ * CPUFREQ_ETERNAL shall be used.
+ */
+
+#define CPUFREQ_ETERNAL (-1)
+struct cpufreq_cpuinfo {
+ unsigned int max_freq;
+ unsigned int min_freq;
+ unsigned int transition_latency;
+};
+
struct cpufreq_policy {
unsigned int cpu; /* cpu nr or CPUFREQ_ALL_CPUS */
unsigned int min; /* in kHz */
unsigned int max; /* in kHz */
unsigned int policy; /* see above */
- unsigned int max_cpu_freq; /* for information */
+ struct cpufreq_cpuinfo cpuinfo; /* see above */
};
#define CPUFREQ_ADJUST (0)
@@ -116,7 +127,6 @@ struct cpufreq_driver {
#endif
/* 2.4. compatible API */
#ifdef CONFIG_CPU_FREQ_24_API
- unsigned int cpu_min_freq[NR_CPUS];
unsigned int cpu_cur_freq[NR_CPUS];
#endif
};
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index bf9b15f5f70b..7dc8a14b8396 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -7,13 +7,6 @@
#ifndef _LINUX_DEVICE_MAPPER_H
#define _LINUX_DEVICE_MAPPER_H
-#define DM_DIR "mapper" /* Slashes not supported */
-#define DM_MAX_TYPE_NAME 16
-#define DM_NAME_LEN 128
-#define DM_UUID_LEN 129
-
-#ifdef __KERNEL__
-
struct dm_target;
struct dm_table;
struct dm_dev;
@@ -101,6 +94,4 @@ struct dm_target {
int dm_register_target(struct target_type *t);
int dm_unregister_target(struct target_type *t);
-#endif /* __KERNEL__ */
-
#endif /* _LINUX_DEVICE_MAPPER_H */
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h
index c5ae8cd3921c..72edd5e19e62 100644
--- a/include/linux/dm-ioctl.h
+++ b/include/linux/dm-ioctl.h
@@ -7,9 +7,13 @@
#ifndef _LINUX_DM_IOCTL_H
#define _LINUX_DM_IOCTL_H
-#include <linux/device-mapper.h>
#include <linux/types.h>
+#define DM_DIR "mapper" /* Slashes not supported */
+#define DM_MAX_TYPE_NAME 16
+#define DM_NAME_LEN 128
+#define DM_UUID_LEN 129
+
/*
* Implements a traditional ioctl interface to the device mapper.
*/
diff --git a/include/linux/fs.h b/include/linux/fs.h
index f39d21e5bcd9..500cb3ac421e 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -278,7 +278,7 @@ struct address_space;
struct writeback_control;
struct address_space_operations {
- int (*writepage)(struct page *);
+ int (*writepage)(struct page *page, struct writeback_control *wbc);
int (*readpage)(struct file *, struct page *);
int (*sync_page)(struct page *);
@@ -631,6 +631,7 @@ struct super_block {
struct semaphore s_lock;
int s_count;
int s_syncing;
+ int s_need_sync_fs;
atomic_t s_active;
void *s_security;
@@ -810,6 +811,7 @@ struct super_operations {
void (*delete_inode) (struct inode *);
void (*put_super) (struct super_block *);
void (*write_super) (struct super_block *);
+ int (*sync_fs)(struct super_block *sb, int wait);
void (*write_super_lockfs) (struct super_block *);
void (*unlockfs) (struct super_block *);
int (*statfs) (struct super_block *, struct statfs *);
@@ -1096,15 +1098,20 @@ extern int bd_claim(struct block_device *, void *);
extern void bd_release(struct block_device *);
extern void blk_run_queues(void);
-/* fs/devices.c */
+/* fs/char_dev.c */
extern int register_chrdev(unsigned int, const char *, struct file_operations *);
extern int unregister_chrdev(unsigned int, const char *);
extern int chrdev_open(struct inode *, struct file *);
+
+/* fs/block_dev.c */
extern const char *__bdevname(dev_t);
extern inline const char *bdevname(struct block_device *bdev)
{
return __bdevname(bdev->bd_dev);
}
+extern struct block_device *open_bdev_excl(const char *, int, int, void *);
+extern void close_bdev_excl(struct block_device *, int);
+
extern const char * cdevname(kdev_t);
extern const char * kdevname(kdev_t);
extern void init_special_inode(struct inode *, umode_t, dev_t);
@@ -1143,6 +1150,7 @@ extern void write_inode_now(struct inode *, int);
extern int filemap_fdatawrite(struct address_space *);
extern int filemap_fdatawait(struct address_space *);
extern void sync_supers(void);
+extern void sync_filesystems(int wait);
extern sector_t bmap(struct inode *, sector_t);
extern int setattr_mask(unsigned int);
extern int notify_change(struct dentry *, struct iattr *);
@@ -1225,6 +1233,7 @@ extern int sb_set_blocksize(struct super_block *, int);
extern int sb_min_blocksize(struct super_block *, int);
extern int generic_file_mmap(struct file *, struct vm_area_struct *);
+extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *);
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 76d1e1e1fb6b..3bf94e2205bd 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -20,6 +20,7 @@ int hugetlb_prefault(struct address_space *, struct vm_area_struct *);
void huge_page_release(struct page *);
void hugetlb_release_key(struct hugetlb_key *);
int hugetlb_report_meminfo(char *);
+int is_hugepage_mem_enough(size_t);
extern int htlbpage_max;
@@ -35,6 +36,7 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
#define zap_hugepage_range(vma, start, len) BUG()
#define unmap_hugepage_range(vma, start, end) BUG()
#define huge_page_release(page) BUG()
+#define is_hugepage_mem_enough(size) 0
#define hugetlb_report_meminfo(buf) 0
#endif /* !CONFIG_HUGETLB_PAGE */
diff --git a/include/linux/init.h b/include/linux/init.h
index 26a518d9cfc1..46b1ef190c52 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -91,19 +91,15 @@ typedef void (*exitcall_t)(void);
#define __exitcall(fn) \
static exitcall_t __exitcall_##fn __exit_call = fn
-/*
- * Used for kernel command line parameter setup
- */
-struct kernel_param {
+struct obs_kernel_param {
const char *str;
int (*setup_func)(char *);
};
-extern struct kernel_param __setup_start, __setup_end;
-
+/* OBSOLETE: see moduleparam.h for the right way. */
#define __setup(str, fn) \
static char __setup_str_##fn[] __initdata = str; \
- static struct kernel_param __setup_##fn \
+ static struct obs_kernel_param __setup_##fn \
__attribute__((unused,__section__ (".init.setup"))) \
= { __setup_str_##fn, fn }
@@ -166,6 +162,16 @@ extern struct kernel_param __setup_start, __setup_end;
/* Data marked not to be saved by software_suspend() */
#define __nosavedata __attribute__ ((__section__ (".data.nosave")))
+/* This means "can be init if no module support, otherwise module load
+ may call it." */
+#ifdef CONFIG_MODULES
+#define __init_or_module
+#define __initdata_or_module
+#else
+#define __init_or_module __init
+#define __initdata_or_module __initdata
+#endif /*CONFIG_MODULES*/
+
#ifdef CONFIG_HOTPLUG
#define __devinit
#define __devinitdata
diff --git a/include/linux/intermezzo_fs.h b/include/linux/intermezzo_fs.h
deleted file mode 100644
index e1aec0b6bccf..000000000000
--- a/include/linux/intermezzo_fs.h
+++ /dev/null
@@ -1,931 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
- * Copyright (C) 2001, 2002 Cluster File Systems, Inc.
- * Copyright (C) 2001 Tacitus Systems, Inc.
- * Copyright (C) 2000 Stelias Computing, Inc.
- * Copyright (C) 2000 Red Hat, Inc.
- * Copyright (C) 2000 TurboLinux, Inc.
- * Copyright (C) 2000 Los Alamos National Laboratory.
- *
- * This file is part of InterMezzo, http://www.inter-mezzo.org.
- *
- * InterMezzo is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * InterMezzo 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 InterMezzo; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __INTERMEZZO_FS_H_
-#define __INTERMEZZO_FS_H_ 1
-
-#include <linux/intermezzo_lib.h>
-#include <linux/intermezzo_idl.h>
-
-
-#ifdef __KERNEL__
-typedef __u8 uuid_t[16];
-#else
-# include <uuid/uuid.h>
-#endif
-
-struct lento_vfs_context {
- __u64 kml_offset;
- __u64 updated_time;
- __u64 remote_ino;
- __u64 remote_generation;
- __u32 slot_offset;
- __u32 recno;
- __u32 flags;
- uuid_t uuid;
- struct presto_version remote_version;
-};
-
-static inline int izo_ioctl_is_invalid(struct izo_ioctl_data *data);
-
-#ifdef __KERNEL__
-# include <linux/smp.h>
-# include <linux/fsfilter.h>
-# include <linux/mount.h>
-# include <linux/slab.h>
-# include <linux/vmalloc.h>
-# include <linux/smp_lock.h>
-
-/* fixups for fs.h */
-# ifndef fs_down
-# define fs_down(sem) down(sem)
-# endif
-
-# ifndef fs_up
-# define fs_up(sem) up(sem)
-# endif
-
-# define KML_IDLE 0
-# define KML_DECODE 1
-# define KML_OPTIMIZE 2
-# define KML_REINT 3
-
-# define KML_OPEN_REINT 0x0100
-# define KML_REINT_BEGIN 0x0200
-# define KML_BACKFETCH 0x0400
-# define KML_REINT_END 0x0800
-# define KML_CLOSE_REINT 0x1000
-# define KML_REINT_MAXBUF (64 * 1024)
-
-# define CACHE_CLIENT_RO 0x4
-# define CACHE_LENTO_RO 0x8
-
-/* global variables */
-extern int presto_debug;
-extern int presto_print_entry;
-extern long presto_kmemory;
-extern long presto_vmemory;
-
-# define PRESTO_DEBUG
-# ifdef PRESTO_DEBUG
-/* debugging masks */
-# define D_SUPER 1
-# define D_INODE 2
-# define D_FILE 4
-# define D_CACHE 8 /* cache debugging */
-# define D_MALLOC 16 /* print malloc, de-alloc information */
-# define D_JOURNAL 32
-# define D_UPCALL 64 /* up and downcall debugging */
-# define D_PSDEV 128
-# define D_PIOCTL 256
-# define D_SPECIAL 512
-# define D_TIMING 1024
-# define D_DOWNCALL 2048
-# define D_KML 4096
-# define D_FSDATA 8192
-
-# define CDEBUG(mask, format, a...) \
- do { \
- if (presto_debug & mask) { \
- printk("(%s:%s,l. %d %d): " format, __FILE__, \
- __FUNCTION__, __LINE__, current->pid \
- , ## a); \
- } \
- } while (0)
-
-#define CERROR(format, a...) \
-do { \
- printk("(%s:%s,l. %d %d): " format, __FILE__, __FUNCTION__, \
- __LINE__, current->pid , ## a); \
-} while (0)
-
-# define ENTRY \
- if (presto_print_entry) \
- printk("Process %d entered %s\n", current->pid, __FUNCTION__)
-
-# define EXIT \
- if (presto_print_entry) \
- printk("Process %d leaving %s at %d\n", current->pid, \
- __FUNCTION__, __LINE__)
-
-# define presto_kmem_inc(ptr, size) presto_kmemory += (size)
-# define presto_kmem_dec(ptr, size) presto_kmemory -= (size)
-# define presto_vmem_inc(ptr, size) presto_vmemory += (size)
-# define presto_vmem_dec(ptr, size) presto_vmemory -= (size)
-# else /* !PRESTO_DEBUG */
-# define CDEBUG(mask, format, a...) do {} while (0)
-# define ENTRY do {} while (0)
-# define EXIT do {} while (0)
-# define presto_kmem_inc(ptr, size) do {} while (0)
-# define presto_kmem_dec(ptr, size) do {} while (0)
-# define presto_vmem_inc(ptr, size) do {} while (0)
-# define presto_vmem_dec(ptr, size) do {} while (0)
-# endif /* PRESTO_DEBUG */
-
-
-struct run_ctxt {
- struct vfsmount *pwdmnt;
- struct dentry *pwd;
- struct vfsmount *rootmnt;
- struct dentry *root;
- uid_t fsuid;
- gid_t fsgid;
- mm_segment_t fs;
- int ngroups;
- gid_t groups[NGROUPS];
-
-};
-
-static inline void push_ctxt(struct run_ctxt *save, struct run_ctxt *new)
-{
- int i;
- save->fs = get_fs();
- save->pwd = dget(current->fs->pwd);
- save->pwdmnt = mntget(current->fs->pwdmnt);
- save->fsgid = current->fsgid;
- save->fsuid = current->fsuid;
- save->root = current->fs->root;
- save->rootmnt = current->fs->rootmnt;
- save->ngroups = current->ngroups;
- for (i = 0; i< current->ngroups; i++)
- save->groups[i] = current->groups[i];
-
- set_fs(new->fs);
- lock_kernel();
- set_fs_pwd(current->fs, new->pwdmnt, new->pwd);
- if (new->root)
- set_fs_root(current->fs, new->rootmnt, new->root);
- unlock_kernel();
- current->fsuid = new->fsuid;
- current->fsgid = new->fsgid;
- if (new->ngroups > 0) {
- current->ngroups = new->ngroups;
- for (i = 0; i< new->ngroups; i++)
- current->groups[i] = new->groups[i];
- }
-
-}
-
-static inline void pop_ctxt(struct run_ctxt *saved)
-{
- int i;
-
- set_fs(saved->fs);
- lock_kernel();
- set_fs_pwd(current->fs, saved->pwdmnt, saved->pwd);
- if (saved->root)
- set_fs_root(current->fs, saved->rootmnt, saved->root);
- unlock_kernel();
- current->fsuid = saved->fsuid;
- current->fsgid = saved->fsgid;
- current->ngroups = saved->ngroups;
- for (i = 0; i< saved->ngroups; i++)
- current->groups[i] = saved->groups[i];
-
- mntput(saved->pwdmnt);
- dput(saved->pwd);
-}
-
-static inline struct presto_dentry_data *presto_d2d(struct dentry *dentry)
-{
- return (struct presto_dentry_data *)(dentry->d_fsdata);
-}
-
-struct presto_cache {
- spinlock_t cache_lock;
- loff_t cache_reserved;
- struct vfsmount *cache_vfsmount;
- struct super_block *cache_sb;
- struct dentry *cache_root;
- struct list_head cache_chain; /* for the dev/cache hash */
-
- int cache_flags;
-
- char *cache_type; /* filesystem type of cache */
- struct filter_fs *cache_filter;
-
- struct upc_channel *cache_psdev; /* points to channel used */
- struct list_head cache_channel_list;
- struct list_head cache_fset_list; /* filesets mounted in cache */
-};
-
-struct presto_log_fd {
- rwlock_t fd_lock;
- loff_t fd_offset; /* offset where next record should go */
- struct file *fd_file;
- int fd_truncating;
- unsigned int fd_recno; /* last recno written */
- struct list_head fd_reservations;
-};
-
-/* file sets */
-# define CHUNK_BITS 16
-
-struct presto_file_set {
- struct list_head fset_list;
- struct presto_log_fd fset_kml;
- struct presto_log_fd fset_lml;
- struct presto_log_fd fset_rcvd;
- struct list_head *fset_clients; /* cache of clients */
- struct dentry *fset_dentry;
- struct vfsmount *fset_mnt;
- struct presto_cache *fset_cache;
-
- unsigned int fset_lento_recno; /* last recno mentioned to lento */
- loff_t fset_lento_off; /* last offset mentioned to lento */
- loff_t fset_kml_logical_off; /* logical offset of kml file byte 0 */
- char * fset_name;
-
- int fset_flags;
- int fset_chunkbits;
- char *fset_reint_buf; /* temporary buffer holds kml during reint */
-
- spinlock_t fset_permit_lock;
- int fset_permit_count;
- int fset_permit_upcall_count;
- /* This queue is used both for processes waiting for the kernel to give
- * up the permit as well as processes waiting for the kernel to be given
- * the permit, depending on the state of FSET_HASPERMIT. */
- wait_queue_head_t fset_permit_queue;
-
- loff_t fset_file_maxio; /* writing more than this causes a close */
- unsigned long int kml_truncate_size;
-};
-
-/* This is the default number of bytes written before a close is recorded*/
-#define FSET_DEFAULT_MAX_FILEIO (1024<<10)
-
-struct dentry *presto_tmpfs_ilookup(struct inode *dir, struct dentry *dentry,
- ino_t ino, unsigned int generation);
-struct dentry *presto_iget_ilookup(struct inode *dir, struct dentry *dentry,
- ino_t ino, unsigned int generation);
-struct dentry *presto_add_ilookup_dentry(struct dentry *parent,
- struct dentry *real);
-
-struct journal_ops {
- int (*tr_all_data)(struct inode *);
- loff_t (*tr_avail)(struct presto_cache *fset, struct super_block *);
- void *(*tr_start)(struct presto_file_set *, struct inode *, int op);
- void (*tr_commit)(struct presto_file_set *, void *handle);
- void (*tr_journal_data)(struct inode *);
- struct dentry *(*tr_ilookup)(struct inode *dir, struct dentry *dentry, ino_t ino, unsigned int generation);
- struct dentry *(*tr_add_ilookup)(struct dentry *parent, struct dentry *real);
-};
-
-extern struct journal_ops presto_ext2_journal_ops;
-extern struct journal_ops presto_ext3_journal_ops;
-extern struct journal_ops presto_tmpfs_journal_ops;
-extern struct journal_ops presto_xfs_journal_ops;
-extern struct journal_ops presto_reiserfs_journal_ops;
-extern struct journal_ops presto_obdfs_journal_ops;
-
-# define LENTO_FL_KML 0x0001
-# define LENTO_FL_EXPECT 0x0002
-# define LENTO_FL_VFSCHECK 0x0004
-# define LENTO_FL_JUSTLOG 0x0008
-# define LENTO_FL_WRITE_KML 0x0010
-# define LENTO_FL_CANCEL_LML 0x0020
-# define LENTO_FL_WRITE_EXPECT 0x0040
-# define LENTO_FL_IGNORE_TIME 0x0080
-# define LENTO_FL_TOUCH_PARENT 0x0100
-# define LENTO_FL_TOUCH_NEWOBJ 0x0200
-# define LENTO_FL_SET_DDFILEID 0x0400
-
-struct presto_cache *presto_get_cache(struct inode *inode);
-int presto_sprint_mounts(char *buf, int buflen, int minor);
-struct presto_file_set *presto_fset(struct dentry *de);
-int presto_journal(struct dentry *dentry, char *buf, size_t size);
-int presto_fwrite(struct file *file, const char *str, int len, loff_t *off);
-int presto_ispresto(struct inode *);
-
-/* super.c */
-extern struct file_system_type presto_fs_type;
-extern int init_intermezzo_fs(void);
-
-/* fileset.c */
-extern int izo_prepare_fileset(struct dentry *root, char *fsetname);
-char * izo_make_path(struct presto_file_set *fset, char *name);
-struct file *izo_fset_open(struct presto_file_set *fset, char *name, int flags, int mode);
-
-/* psdev.c */
-int izo_psdev_get_free_channel(void);
-int presto_psdev_init(void);
-int izo_psdev_setpid(int minor);
-extern void presto_psdev_cleanup(void);
-inline int presto_lento_up(int minor);
-int izo_psdev_setchannel(struct file *file, int fd);
-
-/* inode.c */
-extern struct super_operations presto_super_ops;
-void presto_set_ops(struct inode *inode, struct filter_fs *filter);
-
-/* dcache.c */
-void presto_frob_dop(struct dentry *de);
-char *presto_path(struct dentry *dentry, struct dentry *root,
- char *buffer, int buflen);
-inline struct presto_dentry_data *izo_alloc_ddata(void);
-int presto_set_dd(struct dentry *);
-int presto_init_ddata_cache(void);
-void presto_cleanup_ddata_cache(void);
-extern struct dentry_operations presto_dentry_ops;
-
-/* dir.c */
-extern struct inode_operations presto_dir_iops;
-extern struct inode_operations presto_file_iops;
-extern struct inode_operations presto_sym_iops;
-extern struct file_operations presto_dir_fops;
-extern struct file_operations presto_file_fops;
-extern struct file_operations presto_sym_fops;
-int presto_setattr(struct dentry *de, struct iattr *iattr);
-int presto_settime(struct presto_file_set *fset, struct dentry *newobj,
- struct dentry *parent, struct dentry *target,
- struct lento_vfs_context *ctx, int valid);
-int presto_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long arg);
-
-extern int presto_ilookup_uid;
-# define PRESTO_ILOOKUP_MAGIC "...ino:"
-# define PRESTO_ILOOKUP_SEP ':'
-int izo_dentry_is_ilookup(struct dentry *, ino_t *id, unsigned int *generation);
-struct dentry *presto_lookup(struct inode * dir, struct dentry *dentry);
-
-struct presto_dentry_data {
- int dd_count; /* how mnay dentries are using this dentry */
- struct presto_file_set *dd_fset;
- struct dentry *dd_inodentry;
- loff_t dd_kml_offset;
- int dd_flags;
- __u64 remote_ino;
- __u64 remote_generation;
-};
-
-struct presto_file_data {
- int fd_do_lml;
- loff_t fd_lml_offset;
- size_t fd_bytes_written;
- /* authorization related data of file at open time */
- uid_t fd_uid;
- gid_t fd_gid;
- mode_t fd_mode;
- /* identification data of calling process */
- uid_t fd_fsuid;
- gid_t fd_fsgid;
- int fd_ngroups;
- gid_t fd_groups[NGROUPS_MAX];
- /* information how to complete the close operation */
- struct lento_vfs_context fd_info;
- struct presto_version fd_version;
-};
-
-/* presto.c and Lento::Downcall */
-
-int presto_walk(const char *name, struct nameidata *nd);
-int izo_clear_fsetroot(struct dentry *dentry);
-int izo_clear_all_fsetroots(struct presto_cache *cache);
-int presto_get_kmlsize(char *path, __u64 *size);
-int presto_get_lastrecno(char *path, off_t *size);
-int presto_set_fsetroot(struct dentry *dentry, char *fsetname,
- unsigned int flags);
-int presto_set_fsetroot_from_ioc(struct dentry *dentry, char *fsetname,
- unsigned int flags);
-inline int presto_is_read_only(struct presto_file_set *);
-int presto_truncate_lml(struct presto_file_set *fset);
-int lento_write_lml(char *path,
- __u64 remote_ino,
- __u32 remote_generation,
- __u32 remote_version,
- struct presto_version *remote_file_version);
-int lento_complete_closes(char *path);
-inline int presto_f2m(struct presto_file_set *fset);
-int presto_prep(struct dentry *, struct presto_cache **,
- struct presto_file_set **);
-/* cache.c */
-extern struct presto_cache *presto_cache_init(void);
-extern inline void presto_cache_add(struct presto_cache *cache);
-extern inline void presto_cache_init_hash(void);
-
-struct presto_cache *presto_cache_find(struct super_block *sb);
-
-#define PRESTO_REQLOW (3 * 4096)
-#define PRESTO_REQHIGH (6 * 4096)
-void presto_release_space(struct presto_cache *cache, loff_t req);
-int presto_reserve_space(struct presto_cache *cache, loff_t req);
-
-#define PRESTO_DATA 0x00000002 /* cached data is valid */
-#define PRESTO_ATTR 0x00000004 /* attributes cached */
-#define PRESTO_DONT_JOURNAL 0x00000008 /* things like .intermezzo/ */
-
-struct presto_file_set *presto_path2fileset(const char *name);
-int izo_revoke_permit(struct dentry *, uuid_t uuid);
-int presto_chk(struct dentry *dentry, int flag);
-void presto_set(struct dentry *dentry, int flag);
-int presto_get_permit(struct inode *inode);
-int presto_put_permit(struct inode *inode);
-int presto_set_max_kml_size(const char *path, unsigned long max_size);
-int izo_mark_dentry(struct dentry *dentry, int and, int or, int *res);
-int izo_mark_cache(struct dentry *dentry, int and_bits, int or_bits, int *);
-int izo_mark_fset(struct dentry *dentry, int and_bits, int or_bits, int *);
-void presto_getversion(struct presto_version *pv, struct inode *inode);
-int presto_i2m(struct inode *inode);
-int presto_c2m(struct presto_cache *cache);
-
-
-/* file.c */
-int izo_purge_file(struct presto_file_set *fset, char *file);
-int presto_adjust_lml(struct file *file, struct lento_vfs_context *info);
-
-/* journal.c */
-struct rec_info {
- loff_t offset;
- int size;
- int recno;
- int is_kml;
-};
-
-void presto_trans_commit(struct presto_file_set *fset, void *handle);
-void *presto_trans_start(struct presto_file_set *fset, struct inode *inode,
- int op);
-int presto_fread(struct file *file, char *str, int len, loff_t *off);
-int presto_clear_lml_close(struct presto_file_set *fset,
- loff_t lml_offset);
-int presto_complete_lml(struct presto_file_set *fset);
-int presto_read_kml_logical_offset(struct rec_info *recinfo,
- struct presto_file_set *fset);
-int presto_write_kml_logical_offset(struct presto_file_set *fset);
-struct file *presto_copy_kml_tail(struct presto_file_set *fset,
- unsigned long int start);
-int presto_finish_kml_truncate(struct presto_file_set *fset,
- unsigned long int offset);
-int izo_lookup_file(struct presto_file_set *fset, char *path,
- struct nameidata *nd);
-int izo_do_truncate(struct presto_file_set *fset, struct dentry *dentry,
- loff_t length, loff_t size_check);
-int izo_log_close(struct presto_log_fd *logfd);
-struct file *izo_log_open(struct presto_file_set *fset, char *name, int flags);
-int izo_init_kml_file(struct presto_file_set *, struct presto_log_fd *);
-int izo_init_lml_file(struct presto_file_set *, struct presto_log_fd *);
-int izo_init_last_rcvd_file(struct presto_file_set *, struct presto_log_fd *);
-
-/* vfs.c */
-
-/* Extra data needed in the KML for rollback operations; this structure is
- * passed around during the KML-writing process. */
-struct izo_rollback_data {
- __u32 rb_mode;
- __u32 rb_rdev;
- __u64 rb_uid;
- __u64 rb_gid;
-};
-
-int presto_write_last_rcvd(struct rec_info *recinfo,
- struct presto_file_set *fset,
- struct lento_vfs_context *info);
-void izo_get_rollback_data(struct inode *inode, struct izo_rollback_data *rb);
-int presto_do_close(struct presto_file_set *fset, struct file *file);
-int presto_do_setattr(struct presto_file_set *fset, struct dentry *dentry,
- struct iattr *iattr, struct lento_vfs_context *info);
-int presto_do_create(struct presto_file_set *fset, struct dentry *dir,
- struct dentry *dentry, int mode,
- struct lento_vfs_context *info);
-int presto_do_link(struct presto_file_set *fset, struct dentry *dir,
- struct dentry *old_dentry, struct dentry *new_dentry,
- struct lento_vfs_context *info);
-int presto_do_unlink(struct presto_file_set *fset, struct dentry *dir,
- struct dentry *dentry, struct lento_vfs_context *info);
-int presto_do_symlink(struct presto_file_set *fset, struct dentry *dir,
- struct dentry *dentry, const char *name,
- struct lento_vfs_context *info);
-int presto_do_mkdir(struct presto_file_set *fset, struct dentry *dir,
- struct dentry *dentry, int mode,
- struct lento_vfs_context *info);
-int presto_do_rmdir(struct presto_file_set *fset, struct dentry *dir,
- struct dentry *dentry, struct lento_vfs_context *info);
-int presto_do_mknod(struct presto_file_set *fset, struct dentry *dir,
- struct dentry *dentry, int mode, dev_t dev,
- struct lento_vfs_context *info);
-int do_rename(struct presto_file_set *fset, struct dentry *old_dir,
- struct dentry *old_dentry, struct dentry *new_dir,
- struct dentry *new_dentry, struct lento_vfs_context *info);
-int presto_do_statfs (struct presto_file_set *fset,
- struct statfs * buf);
-
-int lento_setattr(const char *name, struct iattr *iattr,
- struct lento_vfs_context *info);
-int lento_create(const char *name, int mode, struct lento_vfs_context *info);
-int lento_link(const char *oldname, const char *newname,
- struct lento_vfs_context *info);
-int lento_unlink(const char *name, struct lento_vfs_context *info);
-int lento_symlink(const char *oldname,const char *newname,
- struct lento_vfs_context *info);
-int lento_mkdir(const char *name, int mode, struct lento_vfs_context *info);
-int lento_rmdir(const char *name, struct lento_vfs_context *info);
-int lento_mknod(const char *name, int mode, dev_t dev,
- struct lento_vfs_context *info);
-int lento_rename(const char *oldname, const char *newname,
- struct lento_vfs_context *info);
-int lento_iopen(const char *name, ino_t ino, unsigned int generation,int flags);
-
-/* journal.c */
-
-#define JOURNAL_PAGE_SZ PAGE_SIZE
-
-__inline__ int presto_no_journal(struct presto_file_set *fset);
-int journal_fetch(int minor);
-int presto_log(struct presto_file_set *fset, struct rec_info *rec,
- const char *buf, size_t size,
- const char *string1, int len1,
- const char *string2, int len2,
- const char *string3, int len3);
-int presto_get_fileid(int minor, struct presto_file_set *fset,
- struct dentry *dentry);
-int presto_journal_setattr(struct rec_info *rec, struct presto_file_set *fset,
- struct dentry *dentry, struct presto_version *old_ver,
- struct izo_rollback_data *, struct iattr *iattr);
-int presto_journal_create(struct rec_info *rec, struct presto_file_set *fset,
- struct dentry *dentry,
- struct presto_version *tgt_dir_ver,
- struct presto_version *new_file_ver, int mode);
-int presto_journal_link(struct rec_info *rec, struct presto_file_set *fset,
- struct dentry *src, struct dentry *tgt,
- struct presto_version *tgt_dir_ver,
- struct presto_version *new_link_ver);
-int presto_journal_unlink(struct rec_info *rec, struct presto_file_set *fset,
- struct dentry *dir,
- struct presto_version *tgt_dir_ver,
- struct presto_version *old_file_ver,
- struct izo_rollback_data *, struct dentry *dentry,
- char *old_target, int old_targetlen);
-int presto_journal_symlink(struct rec_info *rec, struct presto_file_set *fset,
- struct dentry *dentry, const char *target,
- struct presto_version *tgt_dir_ver,
- struct presto_version *new_link_ver);
-int presto_journal_mkdir(struct rec_info *rec, struct presto_file_set *fset,
- struct dentry *dentry,
- struct presto_version *tgt_dir_ver,
- struct presto_version *new_dir_ver, int mode);
-int presto_journal_rmdir(struct rec_info *rec, struct presto_file_set *fset,
- struct dentry *dentry,
- struct presto_version *tgt_dir_ver,
- struct presto_version *old_dir_ver,
- struct izo_rollback_data *, int len, const char *name);
-int presto_journal_mknod(struct rec_info *rec, struct presto_file_set *fset,
- struct dentry *dentry,
- struct presto_version *tgt_dir_ver,
- struct presto_version *new_node_ver, int mode,
- int dmajor, int dminor);
-int presto_journal_rename(struct rec_info *rec, struct presto_file_set *fset,
- struct dentry *src, struct dentry *tgt,
- struct presto_version *src_dir_ver,
- struct presto_version *tgt_dir_ver);
-int presto_journal_open(struct rec_info *, struct presto_file_set *,
- struct dentry *, struct presto_version *old_ver);
-int presto_journal_close(struct rec_info *rec, struct presto_file_set *,
- struct file *, struct dentry *,
- struct presto_version *old_file_ver,
- struct presto_version *new_file_ver);
-int presto_write_lml_close(struct rec_info *rec,
- struct presto_file_set *fset,
- struct file *file,
- __u64 remote_ino,
- __u64 remote_generation,
- struct presto_version *remote_version,
- struct presto_version *new_file_ver);
-void presto_log_op(void *data, int len);
-loff_t presto_kml_offset(struct presto_file_set *fset);
-
-/* upcall.c */
-#define SYNCHRONOUS 0
-#define ASYNCHRONOUS 1
-/* asynchronous calls */
-int izo_upc_kml(int minor, __u64 offset, __u32 first_recno, __u64 length,
- __u32 last_recno, char *fsetname);
-int izo_upc_kml_truncate(int minor, __u64 length, __u32 last_recno,
- char *fsetname);
-int izo_upc_go_fetch_kml(int minor, char *fsetname, uuid_t uuid, __u64 kmlsize);
-int izo_upc_backfetch(int minor, char *path, char *fileset,
- struct lento_vfs_context *);
-
-/* synchronous calls */
-int izo_upc_get_fileid(int minor, __u32 reclen, char *rec,
- __u32 pathlen, char *path, char *fsetname);
-int izo_upc_permit(int minor, struct dentry *, __u32 pathlen, char *path,
- char *fset);
-int izo_upc_open(int minor, __u32 pathlen, char *path, char *fsetname,
- struct lento_vfs_context *info);
-int izo_upc_connect(int minor, __u64 ip_address, __u64 port, __u8 uuid[16],
- int client_flag);
-int izo_upc_revoke_permit(int minor, char *fsetname, uuid_t uuid);
-int izo_upc_set_kmlsize(int minor, char *fsetname, uuid_t uuid, __u64 kmlsize);
-int izo_upc_client_make_branch(int minor, char *fsetname);
-int izo_upc_server_make_branch(int minor, char *fsetname);
-int izo_upc_branch_undo(int minor, char *fsetname, char *branchname);
-int izo_upc_branch_redo(int minor, char *fsetname, char *branchname);
-int izo_upc_repstatus(int minor, char * fsetname, struct izo_rcvd_rec *lr_server);
-
-/* general mechanism */
-int izo_upc_upcall(int minor, int *size, struct izo_upcall_hdr *, int async);
-
-/* replicator.c */
-int izo_repstatus(struct presto_file_set *fset, __u64 client_kmlsize,
- struct izo_rcvd_rec *lr_client, struct izo_rcvd_rec *lr_server);
-int izo_rep_cache_init(struct presto_file_set *);
-loff_t izo_rcvd_get(struct izo_rcvd_rec *, struct presto_file_set *, char *uuid);
-loff_t izo_rcvd_write(struct presto_file_set *, struct izo_rcvd_rec *);
-loff_t izo_rcvd_upd_remote(struct presto_file_set *fset, char * uuid, __u64 remote_recno,
- __u64 remote_offset);
-
-/* sysctl.c */
-int init_intermezzo_sysctl(void);
-void cleanup_intermezzo_sysctl(void);
-
-/* ext_attr.c */
-/* We will be more tolerant than the default ea patch with attr name sizes and
- * the size of value. If these come via VFS from the default ea patches, the
- * corresponding character strings will be truncated anyway. During journalling- * we journal length for both name and value. See journal_set_ext_attr.
- */
-#define PRESTO_EXT_ATTR_NAME_MAX 128
-#define PRESTO_EXT_ATTR_VALUE_MAX 8192
-
-#define PRESTO_ALLOC(ptr, size) \
-do { \
- long s = (size); \
- (ptr) = kmalloc(s, GFP_KERNEL); \
- if ((ptr) == NULL) \
- CERROR("IZO: out of memory at %s:%d (trying to " \
- "allocate %ld)\n", __FILE__, __LINE__, s); \
- else { \
- presto_kmem_inc((ptr), s); \
- memset((ptr), 0, s); \
- } \
- CDEBUG(D_MALLOC, "kmalloced: %ld at %p (tot %ld).\n", \
- s, (ptr), presto_kmemory); \
-} while (0)
-
-#define PRESTO_FREE(ptr, size) \
-do { \
- long s = (size); \
- if ((ptr) == NULL) { \
- CERROR("IZO: free NULL pointer (%ld bytes) at " \
- "%s:%d\n", s, __FILE__, __LINE__); \
- break; \
- } \
- kfree(ptr); \
- CDEBUG(D_MALLOC, "kfreed: %ld at %p (tot %ld).\n", \
- s, (ptr), presto_kmemory); \
- presto_kmem_dec((ptr), s); \
-} while (0)
-
-static inline int dentry_name_cmp(struct dentry *dentry, char *name)
-{
- return (strlen(name) == dentry->d_name.len &&
- memcmp(name, dentry->d_name.name, dentry->d_name.len) == 0);
-}
-
-static inline char *strdup(char *str)
-{
- char *tmp;
- tmp = kmalloc(strlen(str) + 1, GFP_KERNEL);
- if (tmp)
- memcpy(tmp, str, strlen(str) + 1);
-
- return tmp;
-}
-
-/* buffer MUST be at least the size of izo_ioctl_hdr */
-static inline int izo_ioctl_getdata(char *buf, char *end, void *arg)
-{
- struct izo_ioctl_hdr *hdr;
- struct izo_ioctl_data *data;
- int err;
- ENTRY;
-
- hdr = (struct izo_ioctl_hdr *)buf;
- data = (struct izo_ioctl_data *)buf;
-
- err = copy_from_user(buf, (void *)arg, sizeof(*hdr));
- if ( err ) {
- EXIT;
- return err;
- }
-
- if (hdr->ioc_version != IZO_IOCTL_VERSION) {
- CERROR("IZO: version mismatch kernel vs application\n");
- return -EINVAL;
- }
-
- if (hdr->ioc_len + buf >= end) {
- CERROR("IZO: user buffer exceeds kernel buffer\n");
- return -EINVAL;
- }
-
- if (hdr->ioc_len < sizeof(struct izo_ioctl_data)) {
- CERROR("IZO: user buffer too small for ioctl\n");
- return -EINVAL;
- }
-
- err = copy_from_user(buf, (void *)arg, hdr->ioc_len);
- if ( err ) {
- EXIT;
- return err;
- }
-
- if (izo_ioctl_is_invalid(data)) {
- CERROR("IZO: ioctl not correctly formatted\n");
- return -EINVAL;
- }
-
- if (data->ioc_inllen1) {
- data->ioc_inlbuf1 = &data->ioc_bulk[0];
- }
-
- if (data->ioc_inllen2) {
- data->ioc_inlbuf2 = &data->ioc_bulk[0] +
- size_round(data->ioc_inllen1);
- }
-
- EXIT;
- return 0;
-}
-
-# define MYPATHLEN(buffer, path) ((buffer) + PAGE_SIZE - (path))
-
-# define free kfree
-# define malloc(a) kmalloc(a, GFP_KERNEL)
-# define printf printk
-int kml_reint_rec(struct file *dir, struct izo_ioctl_data *data);
-int izo_get_fileid(struct file *dir, struct izo_ioctl_data *data);
-int izo_set_fileid(struct file *dir, struct izo_ioctl_data *data);
-
-#else /* __KERNEL__ */
-# include <stdlib.h>
-# include <stdio.h>
-# include <sys/types.h>
-# include <sys/ioctl.h>
-# include <string.h>
-
-# define printk printf
-# ifndef CERROR
-# define CERROR printf
-# endif
-# define kmalloc(a,b) malloc(a)
-
-void init_fsreintdata (void);
-int kml_fsreint(struct kml_rec *rec, char *basedir);
-int kml_iocreint(__u32 size, char *ptr, __u32 offset, int dird,
- uuid_t uuid, __u32 generate_kml);
-
-static inline int izo_ioctl_packlen(struct izo_ioctl_data *data);
-
-static inline void izo_ioctl_init(struct izo_ioctl_data *data)
-{
- memset(data, 0, sizeof(*data));
- data->ioc_len = sizeof(*data);
- data->ioc_version = IZO_IOCTL_VERSION;
-}
-
-static inline int
-izo_ioctl_pack(struct izo_ioctl_data *data, char **pbuf, int max)
-{
- char *ptr;
- struct izo_ioctl_data *overlay;
- data->ioc_len = izo_ioctl_packlen(data);
- data->ioc_version = IZO_IOCTL_VERSION;
-
- if (*pbuf && izo_ioctl_packlen(data) > max)
- return 1;
- if (*pbuf == NULL)
- *pbuf = malloc(data->ioc_len);
- if (*pbuf == NULL)
- return 1;
- overlay = (struct izo_ioctl_data *)*pbuf;
- memcpy(*pbuf, data, sizeof(*data));
-
- ptr = overlay->ioc_bulk;
- if (data->ioc_inlbuf1)
- LOGL(data->ioc_inlbuf1, data->ioc_inllen1, ptr);
- if (data->ioc_inlbuf2)
- LOGL(data->ioc_inlbuf2, data->ioc_inllen2, ptr);
- if (izo_ioctl_is_invalid(overlay))
- return 1;
-
- return 0;
-}
-
-#endif /* __KERNEL__*/
-
-#define IZO_ERROR_NAME 1
-#define IZO_ERROR_UPDATE 2
-#define IZO_ERROR_DELETE 3
-#define IZO_ERROR_RENAME 4
-
-static inline char *izo_error(int err)
-{
-#ifndef __KERNEL__
- if (err <= 0)
- return strerror(-err);
-#endif
- switch (err) {
- case IZO_ERROR_NAME:
- return "InterMezzo name/name conflict";
- case IZO_ERROR_UPDATE:
- return "InterMezzo update/update conflict";
- case IZO_ERROR_DELETE:
- return "InterMezzo update/delete conflict";
- case IZO_ERROR_RENAME:
- return "InterMezzo rename/rename conflict";
- }
- return "Unknown InterMezzo error";
-}
-
-static inline int izo_ioctl_packlen(struct izo_ioctl_data *data)
-{
- int len = sizeof(struct izo_ioctl_data);
- len += size_round(data->ioc_inllen1);
- len += size_round(data->ioc_inllen2);
- return len;
-}
-
-static inline int izo_ioctl_is_invalid(struct izo_ioctl_data *data)
-{
- if (data->ioc_len > (1<<30)) {
- CERROR("IZO ioctl: ioc_len larger than 1<<30\n");
- return 1;
- }
- if (data->ioc_inllen1 > (1<<30)) {
- CERROR("IZO ioctl: ioc_inllen1 larger than 1<<30\n");
- return 1;
- }
- if (data->ioc_inllen2 > (1<<30)) {
- CERROR("IZO ioctl: ioc_inllen2 larger than 1<<30\n");
- return 1;
- }
- if (data->ioc_inlbuf1 && !data->ioc_inllen1) {
- CERROR("IZO ioctl: inlbuf1 pointer but 0 length\n");
- return 1;
- }
- if (data->ioc_inlbuf2 && !data->ioc_inllen2) {
- CERROR("IZO ioctl: inlbuf2 pointer but 0 length\n");
- return 1;
- }
- if (data->ioc_pbuf1 && !data->ioc_plen1) {
- CERROR("IZO ioctl: pbuf1 pointer but 0 length\n");
- return 1;
- }
- if (data->ioc_pbuf2 && !data->ioc_plen2) {
- CERROR("IZO ioctl: pbuf2 pointer but 0 length\n");
- return 1;
- }
- if (izo_ioctl_packlen(data) != data->ioc_len ) {
- CERROR("IZO ioctl: packlen exceeds ioc_len\n");
- return 1;
- }
- if (data->ioc_inllen1 &&
- data->ioc_bulk[data->ioc_inllen1 - 1] != '\0') {
- CERROR("IZO ioctl: inlbuf1 not 0 terminated\n");
- return 1;
- }
- if (data->ioc_inllen2 &&
- data->ioc_bulk[size_round(data->ioc_inllen1) + data->ioc_inllen2
- - 1] != '\0') {
- CERROR("IZO ioctl: inlbuf2 not 0 terminated\n");
- return 1;
- }
- return 0;
-}
-
-/* kml_unpack.c */
-char *kml_print_rec(struct kml_rec *rec, int brief);
-int kml_unpack(struct kml_rec *rec, char **buf, char *end);
-
-/* fs 2.5 compat */
-
-/* is_read_only() is replaced by bdev_read_only which takes struct
- block_device *. Since this is only needed for debugging, it can be
- safely ignored now.
-*/
-#define is_read_only(dev) 0
-
-#endif
diff --git a/include/linux/intermezzo_journal.h b/include/linux/intermezzo_journal.h
deleted file mode 100644
index 75ec0977e33d..000000000000
--- a/include/linux/intermezzo_journal.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef __PRESTO_JOURNAL_H
-#define __PRESTO_JOURNAL_H
-
-
-#include <linux/version.h>
-
-struct journal_prefix {
- int len;
- u32 version;
- int pid;
- int uid;
- int fsuid;
- int fsgid;
- int opcode;
- u32 ngroups;
- u32 groups[0];
-};
-
-struct journal_suffix {
- unsigned long prevrec; /* offset of previous record for dentry */
- int recno;
- int time;
- int len;
-};
-
-#endif
diff --git a/include/linux/intermezzo_kml.h b/include/linux/intermezzo_kml.h
deleted file mode 100644
index da11b5dcabdc..000000000000
--- a/include/linux/intermezzo_kml.h
+++ /dev/null
@@ -1,261 +0,0 @@
-#ifndef __INTERMEZZO_KML_H
-#define __INTERMEZZO_KML_H
-
-#include <linux/version.h>
-#include <linux/intermezzo_psdev.h>
-#include <linux/fs.h>
-#include <linux/intermezzo_journal.h>
-
-#define PRESTO_KML_MAJOR_VERSION 0x00010000
-#define PRESTO_KML_MINOR_VERSION 0x00002001
-#define PRESTO_OP_NOOP 0
-#define PRESTO_OP_CREATE 1
-#define PRESTO_OP_MKDIR 2
-#define PRESTO_OP_UNLINK 3
-#define PRESTO_OP_RMDIR 4
-#define PRESTO_OP_CLOSE 5
-#define PRESTO_OP_SYMLINK 6
-#define PRESTO_OP_RENAME 7
-#define PRESTO_OP_SETATTR 8
-#define PRESTO_OP_LINK 9
-#define PRESTO_OP_OPEN 10
-#define PRESTO_OP_MKNOD 11
-#define PRESTO_OP_WRITE 12
-#define PRESTO_OP_RELEASE 13
-#define PRESTO_OP_TRUNC 14
-#define PRESTO_OP_SETEXTATTR 15
-#define PRESTO_OP_DELEXTATTR 16
-
-#define PRESTO_LML_DONE 1 /* flag to get first write to do LML */
-#define KML_KOP_MARK 0xffff
-
-struct presto_lml_data {
- loff_t rec_offset;
-};
-
-struct big_journal_prefix {
- u32 len;
- u32 version;
- u32 pid;
- u32 uid;
- u32 fsuid;
- u32 fsgid;
- u32 opcode;
- u32 ngroups;
- u32 groups[NGROUPS_MAX];
-};
-
-enum kml_opcode {
- KML_CREATE = 1,
- KML_MKDIR,
- KML_UNLINK,
- KML_RMDIR,
- KML_CLOSE,
- KML_SYMLINK,
- KML_RENAME,
- KML_SETATTR,
- KML_LINK,
- KML_OPEN,
- KML_MKNOD,
- KML_ENDMARK = 0xff
-};
-
-struct kml_create {
- char *path;
- struct presto_version new_objectv,
- old_parentv,
- new_parentv;
- int mode;
- int uid;
- int gid;
-};
-
-struct kml_open {
-};
-
-struct kml_mkdir {
- char *path;
- struct presto_version new_objectv,
- old_parentv,
- new_parentv;
- int mode;
- int uid;
- int gid;
-};
-
-struct kml_unlink {
- char *path,
- *name;
- struct presto_version old_tgtv,
- old_parentv,
- new_parentv;
-};
-
-struct kml_rmdir {
- char *path,
- *name;
- struct presto_version old_tgtv,
- old_parentv,
- new_parentv;
-};
-
-struct kml_close {
- int open_mode,
- open_uid,
- open_gid;
- char *path;
- struct presto_version new_objectv;
- __u64 ino;
- int generation;
-};
-
-struct kml_symlink {
- char *sourcepath,
- *targetpath;
- struct presto_version new_objectv,
- old_parentv,
- new_parentv;
- int uid;
- int gid;
-};
-
-struct kml_rename {
- char *sourcepath,
- *targetpath;
- struct presto_version old_objectv,
- new_objectv,
- old_tgtv,
- new_tgtv;
-};
-
-struct kml_setattr {
- char *path;
- struct presto_version old_objectv;
- struct iattr iattr;
-};
-
-struct kml_link {
- char *sourcepath,
- *targetpath;
- struct presto_version new_objectv,
- old_parentv,
- new_parentv;
-};
-
-struct kml_mknod {
- char *path;
- struct presto_version new_objectv,
- old_parentv,
- new_parentv;
- int mode;
- int uid;
- int gid;
- int major;
- int minor;
-};
-
-/* kml record items for optimizing */
-struct kml_kop_node
-{
- u32 kml_recno;
- u32 kml_flag;
- u32 kml_op;
- nlink_t i_nlink;
- u32 i_ino;
-};
-
-struct kml_kop_lnode
-{
- struct list_head chains;
- struct kml_kop_node node;
-};
-
-struct kml_endmark {
- u32 total;
- struct kml_kop_node *kop;
-};
-
-/* kml_flag */
-#define KML_REC_DELETE 1
-#define KML_REC_EXIST 0
-
-struct kml_optimize {
- struct list_head kml_chains;
- u32 kml_flag;
- u32 kml_op;
- nlink_t i_nlink;
- u32 i_ino;
-};
-
-struct kml_rec {
- /* attribute of this record */
- int rec_size;
- int rec_kml_offset;
-
- struct big_journal_prefix rec_head;
- union {
- struct kml_create create;
- struct kml_open open;
- struct kml_mkdir mkdir;
- struct kml_unlink unlink;
- struct kml_rmdir rmdir;
- struct kml_close close;
- struct kml_symlink symlink;
- struct kml_rename rename;
- struct kml_setattr setattr;
- struct kml_mknod mknod;
- struct kml_link link;
- struct kml_endmark endmark;
- } rec_kml;
- struct journal_suffix rec_tail;
-
- /* for kml optimize only */
- struct kml_optimize kml_optimize;
-};
-
-/* kml record items for optimizing */
-extern void kml_kop_init (struct presto_file_set *fset);
-extern void kml_kop_addrec (struct presto_file_set *fset,
- struct inode *ino, u32 op, u32 flag);
-extern int kml_kop_flush (struct presto_file_set *fset);
-
-/* defined in kml_setup.c */
-extern int kml_init (struct presto_file_set *fset);
-extern int kml_cleanup (struct presto_file_set *fset);
-
-/* defined in kml.c */
-extern int begin_kml_reint (struct file *file, unsigned long arg);
-extern int do_kml_reint (struct file *file, unsigned long arg);
-extern int end_kml_reint (struct file *file, unsigned long arg);
-
-/* kml_utils.c */
-extern char *dlogit (void *tbuf, const void *sbuf, int size);
-extern char * bdup_printf (char *format, ...);
-
-/* defined in kml_decode.c */
-/* printop */
-#define PRINT_KML_PREFIX 0x1
-#define PRINT_KML_SUFFIX 0x2
-#define PRINT_KML_REC 0x4
-#define PRINT_KML_OPTIMIZE 0x8
-#define PRINT_KML_EXIST 0x10
-#define PRINT_KML_DELETE 0x20
-extern void kml_printrec (struct kml_rec *rec, int printop);
-extern int print_allkmlrec (struct list_head *head, int printop);
-extern int delete_kmlrec (struct list_head *head);
-extern int kml_decoderec (char *buf, int pos, int buflen, int *size,
- struct kml_rec **newrec);
-extern int decode_kmlrec (struct list_head *head, char *kml_buf, int buflen);
-extern void kml_freerec (struct kml_rec *rec);
-
-/* defined in kml_reint.c */
-#define KML_CLOSE_BACKFETCH 1
-extern int kml_reintbuf (struct kml_fsdata *kml_fsdata,
- char *mtpt, struct kml_rec **rec);
-
-/* defined in kml_setup.c */
-extern int kml_init (struct presto_file_set *fset);
-extern int kml_cleanup (struct presto_file_set *fset);
-
-#endif
-
diff --git a/include/linux/intermezzo_psdev.h b/include/linux/intermezzo_psdev.h
deleted file mode 100644
index aa7fe70df356..000000000000
--- a/include/linux/intermezzo_psdev.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- */
-
-#ifndef __PRESTO_PSDEV_H
-#define __PRESTO_PSDEV_H
-
-#define MAX_CHANNEL 16
-#define PROCNAME_SIZE 32
-#include <linux/smp_lock.h>
-#include <linux/smp_lock.h>
-#include <linux/version.h>
-
-/* represents state of an instance reached with /dev/intermezzo */
-/* communication pending & processing queues */
-struct upc_channel {
- unsigned int uc_seq;
- wait_queue_head_t uc_waitq; /* Lento wait queue */
- struct list_head uc_pending;
- struct list_head uc_processing;
- spinlock_t uc_lock;
- int uc_pid; /* Lento's pid */
- int uc_hard; /* allows signals during upcalls */
- int uc_no_filter;
- int uc_no_journal;
- int uc_no_upcall;
- int uc_timeout; /* . sec: signals will dequeue upc */
- long uc_errorval; /* for testing I/O failures */
- struct list_head uc_cache_list;
- int uc_minor;
-};
-
-#define ISLENTO(minor) (current->pid == izo_channels[minor].uc_pid \
- || current->real_parent->pid == izo_channels[minor].uc_pid \
- || current->real_parent->real_parent->pid == izo_channels[minor].uc_pid)
-
-extern struct upc_channel izo_channels[MAX_CHANNEL];
-
-/* message types between presto filesystem in kernel */
-#define REQ_READ 1
-#define REQ_WRITE 2
-#define REQ_ASYNC 4
-#define REQ_DEAD 8
-
-struct upc_req {
- struct list_head rq_chain;
- caddr_t rq_data;
- int rq_flags;
- int rq_bufsize;
- int rq_rep_size;
- int rq_opcode; /* copied from data to save lookup */
- int rq_unique;
- wait_queue_head_t rq_sleep; /* process' wait queue */
- unsigned long rq_posttime;
-};
-
-#endif
diff --git a/include/linux/intermezzo_upcall.h b/include/linux/intermezzo_upcall.h
deleted file mode 100644
index 0b3e6ff74e3a..000000000000
--- a/include/linux/intermezzo_upcall.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Based on cfs.h from Coda, but revamped for increased simplicity.
- * Linux modifications by Peter Braam, Aug 1996
- * Rewritten for InterMezzo
- */
-
-#ifndef _PRESTO_HEADER_
-#define _PRESTO_HEADER_
-
-
-/* upcall.c */
-#define SYNCHRONOUS 0
-#define ASYNCHRONOUS 1
-
-int lento_permit(int minor, int pathlen, int fsetnamelen, char *path, char *fset);
-int lento_opendir(int minor, int pathlen, char *path, int async);
-int lento_kml(int minor, unsigned int offset, unsigned int first_recno,
- unsigned int length, unsigned int last_recno, int namelen,
- char *fsetname);
-int lento_open(int minor, int pathlen, char *path);
-int lento_journal(int minor, char *page, int async);
-int lento_release_permit(int minor, int cookie);
-
-/*
- * Kernel <--> Lento communications.
- */
-/* upcalls */
-#define LENTO_PERMIT 1
-#define LENTO_JOURNAL 2
-#define LENTO_OPENDIR 3
-#define LENTO_OPEN 4
-#define LENTO_SIGNAL 5
-#define LENTO_KML 6
-#define LENTO_COOKIE 7
-
-/* Lento <-> Presto RPC arguments */
-struct lento_up_hdr {
- unsigned int opcode;
- unsigned int unique; /* Keep multiple outstanding msgs distinct */
- u_short pid; /* Common to all */
- u_short uid;
-};
-
-/* This structure _must_ sit at the beginning of the buffer */
-struct lento_down_hdr {
- unsigned int opcode;
- unsigned int unique;
- unsigned int result;
-};
-
-/* lento_permit: */
-struct lento_permit_in {
- struct lento_up_hdr uh;
- int pathlen;
- int fsetnamelen;
- char path[0];
-};
-struct lento_permit_out {
- struct lento_down_hdr dh;
-};
-
-
-/* lento_opendir: */
-struct lento_opendir_in {
- struct lento_up_hdr uh;
- int async;
- int pathlen;
- char path[0];
-};
-struct lento_opendir_out {
- struct lento_down_hdr dh;
-};
-
-
-/* lento_kml: */
-struct lento_kml_in {
- struct lento_up_hdr uh;
- unsigned int offset;
- unsigned int first_recno;
- unsigned int length;
- unsigned int last_recno;
- int namelen;
- char fsetname[0];
-};
-
-struct lento_kml_out {
- struct lento_down_hdr dh;
-};
-
-
-/* lento_open: */
-struct lento_open_in {
- struct lento_up_hdr uh;
- int pathlen;
- char path[0];
-};
-struct lento_open_out {
- struct lento_down_hdr dh;
-};
-
-/* lento_response_cookie */
-struct lento_response_cookie_in {
- struct lento_up_hdr uh;
- int cookie;
-};
-
-struct lento_response_cookie_out {
- struct lento_down_hdr dh;
-};
-
-
-struct lento_mknod {
- struct lento_down_hdr dh;
- int major;
- int minor;
- int mode;
- char path[0];
-};
-
-
-/* NB: every struct below begins with an up_hdr */
-union up_args {
- struct lento_up_hdr uh;
- struct lento_permit_in lento_permit;
- struct lento_open_in lento_open;
- struct lento_opendir_in lento_opendir;
- struct lento_kml_in lento_kml;
- struct lento_response_cookie_in lento_response_cookie;
-};
-
-union down_args {
- struct lento_down_hdr dh;
- struct lento_permit_out lento_permit;
- struct lento_open_out lento_open;
- struct lento_opendir_out lento_opendir;
- struct lento_kml_out lento_kml;
- struct lento_response_cookie_out lento_response_cookie;
-};
-
-#include "intermezzo_psdev.h"
-
-int lento_upcall(int minor, int read_size, int *rep_size,
- union up_args *buffer, int async,
- struct upc_req *rq );
-#endif
-
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 80a3e97ab59b..f3cadd9416ad 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -38,6 +38,13 @@
#define KERN_INFO "<6>" /* informational */
#define KERN_DEBUG "<7>" /* debug-level messages */
+extern int console_printk[];
+
+#define console_loglevel (console_printk[0])
+#define default_message_loglevel (console_printk[1])
+#define minimum_console_loglevel (console_printk[2])
+#define default_console_loglevel (console_printk[3])
+
struct completion;
#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
@@ -71,7 +78,7 @@ extern int sscanf(const char *, const char *, ...)
extern int vsscanf(const char *, const char *, va_list);
extern int get_option(char **str, int *pint);
-extern char *get_options(char *str, int nints, int *ints);
+extern char *get_options(const char *str, int nints, int *ints);
extern unsigned long long memparse(char *ptr, char **retptr);
extern void dev_probe_lock(void);
extern void dev_probe_unlock(void);
@@ -81,8 +88,6 @@ extern int session_of_pgrp(int pgrp);
asmlinkage int printk(const char * fmt, ...)
__attribute__ ((format (printf, 1, 2)));
-extern int console_loglevel;
-
static inline void console_silent(void)
{
console_loglevel = 0;
diff --git a/include/linux/mm.h b/include/linux/mm.h
index d91bd3e8ce14..df49cb472866 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -70,7 +70,6 @@ struct vm_area_struct {
unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE
units, *not* PAGE_CACHE_SIZE */
struct file * vm_file; /* File we map to (can be NULL). */
- unsigned long vm_raend; /* XXX: put full readahead info here. */
void * vm_private_data; /* was vm_pte (shared mem) */
};
@@ -355,7 +354,6 @@ extern struct page *mem_map;
extern void show_free_areas(void);
-extern int fail_writepage(struct page *);
struct page * shmem_nopage(struct vm_area_struct * vma, unsigned long address, int unused);
struct file *shmem_file_setup(char * name, loff_t size, unsigned long flags);
extern void shmem_lock(struct file * file, int lock);
@@ -517,6 +515,7 @@ void page_cache_readaround(struct address_space *mapping,
unsigned long offset);
void handle_ra_miss(struct address_space *mapping,
struct file_ra_state *ra);
+unsigned long max_sane_readahead(unsigned long nr);
/* Do stack extension */
extern int expand_stack(struct vm_area_struct * vma, unsigned long address);
diff --git a/include/linux/module.h b/include/linux/module.h
index 0362a206ccd9..2392edcc3307 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -20,10 +20,6 @@
#include <asm/module.h>
#include <asm/uaccess.h> /* For struct exception_table_entry */
-/* Indirect stringification */
-#define __MODULE_STRING_1(x) #x
-#define __MODULE_STRING(x) __MODULE_STRING_1(x)
-
/* Not Yet Implemented */
#define MODULE_LICENSE(name)
#define MODULE_AUTHOR(name)
@@ -116,10 +112,16 @@ struct module_ref
atomic_t count;
} ____cacheline_aligned;
+enum module_state
+{
+ MODULE_STATE_LIVE,
+ MODULE_STATE_COMING,
+ MODULE_STATE_GOING,
+};
+
struct module
{
- /* Am I live (yet)? */
- int live;
+ enum module_state state;
/* Member of list of modules */
struct list_head list;
@@ -177,6 +179,14 @@ struct module
char args[0];
};
+/* FIXME: It'd be nice to isolate modules during init, too, so they
+ aren't used before they (may) fail. But presently too much code
+ (IDE & SCSI) require entry into the module during init.*/
+static inline int module_is_live(struct module *mod)
+{
+ return mod->state != MODULE_STATE_GOING;
+}
+
#ifdef CONFIG_MODULE_UNLOAD
void __symbol_put(const char *symbol);
@@ -195,7 +205,7 @@ static inline int try_module_get(struct module *module)
if (module) {
unsigned int cpu = get_cpu();
- if (likely(module->live))
+ if (likely(module_is_live(module)))
local_inc(&module->ref[cpu].count);
else
ret = 0;
@@ -210,7 +220,7 @@ static inline void module_put(struct module *module)
unsigned int cpu = get_cpu();
local_dec(&module->ref[cpu].count);
/* Maybe they're waiting for us to drop reference? */
- if (unlikely(!module->live))
+ if (unlikely(!module_is_live(module)))
wake_up_process(module->waiter);
put_cpu();
}
@@ -219,7 +229,7 @@ static inline void module_put(struct module *module)
#else /*!CONFIG_MODULE_UNLOAD*/
static inline int try_module_get(struct module *module)
{
- return !module || module->live;
+ return !module || module_is_live(module);
}
static inline void module_put(struct module *module)
{
@@ -291,6 +301,21 @@ extern spinlock_t modlist_lock;
#define __MOD_DEC_USE_COUNT(mod) module_put(mod)
#define SET_MODULE_OWNER(dev) ((dev)->owner = THIS_MODULE)
+struct obsolete_modparm {
+ char name[64];
+ char type[64-sizeof(void *)];
+ void *addr;
+};
+#ifdef MODULE
+/* DEPRECATED: Do not use. */
+#define MODULE_PARM(var,type) \
+struct obsolete_modparm __parm_##var __attribute__((section("__obsparm"))) = \
+{ __stringify(var), type };
+
+#else
+#define MODULE_PARM(var,type)
+#endif
+
/* People do this inside their init routines, when the module isn't
"live" yet. They should no longer be doing that, but
meanwhile... */
@@ -303,11 +328,11 @@ extern spinlock_t modlist_lock;
#endif
#define MOD_DEC_USE_COUNT module_put(THIS_MODULE)
#define try_inc_mod_count(mod) try_module_get(mod)
-#define MODULE_PARM(parm,string)
#define EXPORT_NO_SYMBOLS
extern int module_dummy_usage;
#define GET_USE_COUNT(module) (module_dummy_usage)
#define MOD_IN_USE 0
+#define __MODULE_STRING(x) __stringify(x)
#define __mod_between(a_start, a_len, b_start, b_len) \
(((a_start) >= (b_start) && (a_start) <= (b_start)+(b_len)) \
|| ((a_start)+(a_len) >= (b_start) \
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
new file mode 100644
index 000000000000..92a1bc154e8e
--- /dev/null
+++ b/include/linux/moduleparam.h
@@ -0,0 +1,127 @@
+#ifndef _LINUX_MODULE_PARAMS_H
+#define _LINUX_MODULE_PARAMS_H
+/* (C) Copyright 2001, 2002 Rusty Russell IBM Corporation */
+#include <linux/init.h>
+#include <linux/stringify.h>
+
+/* You can override this manually, but generally this should match the
+ module name. */
+#ifdef MODULE
+#define MODULE_PARAM_PREFIX /* empty */
+#else
+#define MODULE_PARAM_PREFIX __stringify(KBUILD_MODNAME) "."
+#endif
+
+struct kernel_param;
+
+/* Returns 0, or -errno. arg is in kp->arg. */
+typedef int (*param_set_fn)(const char *val, struct kernel_param *kp);
+/* Returns length written or -errno. Buffer is 4k (ie. be short!) */
+typedef int (*param_get_fn)(char *buffer, struct kernel_param *kp);
+
+struct kernel_param {
+ const char *name;
+ unsigned int perm;
+ param_set_fn set;
+ param_get_fn get;
+ void *arg;
+};
+
+/* Special one for strings we want to copy into */
+struct kparam_string {
+ unsigned int maxlen;
+ char *string;
+};
+
+/* This is the fundamental function for registering boot/module
+ parameters. perm sets the visibility in driverfs: 000 means it's
+ not there, read bits mean it's readable, write bits mean it's
+ writable. */
+#define __module_param_call(prefix, name, set, get, arg, perm) \
+ static char __param_str_##name[] __initdata = prefix #name; \
+ static struct kernel_param __param_##name \
+ __attribute__ ((unused,__section__ ("__param"))) \
+ = { __param_str_##name, perm, set, get, arg }
+
+#define module_param_call(name, set, get, arg, perm) \
+ __module_param_call(MODULE_PARAM_PREFIX, name, set, get, arg, perm)
+
+/* Helper functions: type is byte, short, ushort, int, uint, long,
+ ulong, charp, bool or invbool, or XXX if you define param_get_XXX,
+ param_set_XXX and param_check_XXX. */
+#define module_param_named(name, value, type, perm) \
+ param_check_##type(name, &(value)); \
+ module_param_call(name, param_set_##type, param_get_##type, &value, perm)
+
+#define module_param(name, type, perm) \
+ module_param_named(name, name, type, perm)
+
+/* Actually copy string: maxlen param is usually sizeof(string). */
+#define module_param_string(name, string, len, perm) \
+ static struct kparam_string __param_string_##name __initdata \
+ = { len, string }; \
+ module_param_call(name, param_set_copystring, param_get_charp, \
+ &__param_string_##name, perm)
+
+/* Called on module insert or kernel boot */
+extern int parse_args(const char *name,
+ char *args,
+ struct kernel_param *params,
+ unsigned num,
+ int (*unknown)(char *param, char *val));
+
+/* All the helper functions */
+/* The macros to do compile-time type checking stolen from Jakub
+ Jelinek, who IIRC came up with this idea for the 2.4 module init code. */
+#define __param_check(name, p, type) \
+ static inline type *__check_##name(void) { return(p); }
+
+extern int param_set_short(const char *val, struct kernel_param *kp);
+extern int param_get_short(char *buffer, struct kernel_param *kp);
+#define param_check_short(name, p) __param_check(name, p, short)
+
+extern int param_set_ushort(const char *val, struct kernel_param *kp);
+extern int param_get_ushort(char *buffer, struct kernel_param *kp);
+#define param_check_ushort(name, p) __param_check(name, p, unsigned short)
+
+extern int param_set_int(const char *val, struct kernel_param *kp);
+extern int param_get_int(char *buffer, struct kernel_param *kp);
+#define param_check_int(name, p) __param_check(name, p, int)
+
+extern int param_set_uint(const char *val, struct kernel_param *kp);
+extern int param_get_uint(char *buffer, struct kernel_param *kp);
+#define param_check_uint(name, p) __param_check(name, p, unsigned int)
+
+extern int param_set_long(const char *val, struct kernel_param *kp);
+extern int param_get_long(char *buffer, struct kernel_param *kp);
+#define param_check_long(name, p) __param_check(name, p, long)
+
+extern int param_set_ulong(const char *val, struct kernel_param *kp);
+extern int param_get_ulong(char *buffer, struct kernel_param *kp);
+#define param_check_ulong(name, p) __param_check(name, p, unsigned long)
+
+extern int param_set_charp(const char *val, struct kernel_param *kp);
+extern int param_get_charp(char *buffer, struct kernel_param *kp);
+#define param_check_charp(name, p) __param_check(name, p, char *)
+
+extern int param_set_bool(const char *val, struct kernel_param *kp);
+extern int param_get_bool(char *buffer, struct kernel_param *kp);
+#define param_check_bool(name, p) __param_check(name, p, int)
+
+extern int param_set_invbool(const char *val, struct kernel_param *kp);
+extern int param_get_invbool(char *buffer, struct kernel_param *kp);
+#define param_check_invbool(name, p) __param_check(name, p, int)
+
+/* First two elements are the max and min array length (which don't change) */
+extern int param_set_intarray(const char *val, struct kernel_param *kp);
+extern int param_get_intarray(char *buffer, struct kernel_param *kp);
+#define param_check_intarray(name, p) __param_check(name, p, int *)
+
+extern int param_set_copystring(const char *val, struct kernel_param *kp);
+
+int param_array(const char *name,
+ const char *val,
+ unsigned int min, unsigned int max,
+ void *elem, int elemsize,
+ int (*set)(const char *, struct kernel_param *kp));
+#endif /* _LINUX_MODULE_PARAM_TYPES_H */
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index d320dd969b07..36e71c8ed51e 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -196,6 +196,16 @@ enum open_delegation_type4 {
#define NFS4_MINOR_VERSION 0
#define NFS4_DEBUG 1
+#ifdef __KERNEL__
+
+/* Index of predefined Linux client operations */
+
+enum {
+ NFSPROC4_CLNT_NULL = 0, /* Unused */
+ NFSPROC4_CLNT_COMPOUND, /* Soon to be unused */
+};
+
+#endif
#endif
/*
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 8d15e17c0b94..2673e32cc4ba 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -291,7 +291,7 @@ extern void nfs_complete_unlink(struct dentry *);
/*
* linux/fs/nfs/write.c
*/
-extern int nfs_writepage(struct page *);
+extern int nfs_writepage(struct page *page, struct writeback_control *wbc);
extern int nfs_writepages(struct address_space *, struct writeback_control *);
extern int nfs_flush_incompatible(struct file *file, struct page *page);
extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int);
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 970ffa785f78..af914e160fc6 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -488,7 +488,6 @@ struct nfs4_write {
struct nfs4_op {
u32 opnum;
- u32 nfserr;
union {
struct nfs4_access access;
struct nfs4_close close;
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index 982b64e0518a..8e7422a320ed 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -55,7 +55,7 @@ int oprofile_arch_init(struct oprofile_operations ** ops, enum oprofile_cpu * cp
* 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));
+extern void 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
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 7018961aea91..a50e09ff79ea 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -79,35 +79,36 @@
* allowed.
*/
struct page_state {
- unsigned long nr_dirty;
- unsigned long nr_writeback;
- unsigned long nr_pagecache;
- unsigned long nr_page_table_pages;
- unsigned long nr_reverse_maps;
- unsigned long nr_mapped;
- unsigned long nr_slab;
+ unsigned long nr_dirty; /* Dirty writeable pages */
+ unsigned long nr_writeback; /* Pages under writeback */
+ unsigned long nr_pagecache; /* Pages in pagecache */
+ unsigned long nr_page_table_pages;/* Pages used for pagetables */
+ unsigned long nr_reverse_maps; /* includes PageDirect */
+ unsigned long nr_mapped; /* mapped into pagetables */
+ unsigned long nr_slab; /* In slab */
#define GET_PAGE_STATE_LAST nr_slab
/*
* The below are zeroed by get_page_state(). Use get_full_page_state()
* to add up all these.
*/
- unsigned long pgpgin;
- unsigned long pgpgout;
- unsigned long pswpin;
- unsigned long pswpout;
- unsigned long pgalloc;
- unsigned long pgfree;
- unsigned long pgactivate;
- unsigned long pgdeactivate;
- unsigned long pgfault;
- unsigned long pgmajfault;
- unsigned long pgscan;
- unsigned long pgrefill;
- unsigned long pgsteal;
- unsigned long kswapd_steal;
- unsigned long pageoutrun;
- unsigned long allocstall;
+ unsigned long pgpgin; /* Disk reads */
+ unsigned long pgpgout; /* Disk writes */
+ unsigned long pswpin; /* swap reads */
+ unsigned long pswpout; /* swap writes */
+ unsigned long pgalloc; /* page allocations */
+ unsigned long pgfree; /* page freeings */
+ unsigned long pgactivate; /* pages moved inactive->active */
+ unsigned long pgdeactivate; /* pages moved active->inactive */
+ unsigned long pgfault; /* faults (major+minor) */
+ unsigned long pgmajfault; /* faults (major only) */
+ unsigned long pgscan; /* pages scanned by page reclaim */
+ unsigned long pgrefill; /* inspected in refill_inactive_zone */
+ unsigned long pgsteal; /* total pages reclaimed */
+ unsigned long kswapd_steal; /* pages reclaimed by kswapd */
+ unsigned long pageoutrun; /* kswapd's calls to page reclaim */
+ unsigned long allocstall; /* direct reclaim calls */
+ unsigned long pgrotated; /* pages rotated to tail of the LRU */
} ____cacheline_aligned;
DECLARE_PER_CPU(struct page_state, page_states);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 7c0e1de47668..4f90ff1ccbe8 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1727,6 +1727,9 @@
#define PCI_DEVICE_ID_INTEL_82092AA_0 0x1221
#define PCI_DEVICE_ID_INTEL_82092AA_1 0x1222
#define PCI_DEVICE_ID_INTEL_7116 0x1223
+#define PCI_DEVICE_ID_INTEL_7505_0 0x2550
+#define PCI_DEVICE_ID_INTEL_7505_1 0x2552
+#define PCI_DEVICE_ID_INTEL_7205_0 0x255d
#define PCI_DEVICE_ID_INTEL_82596 0x1226
#define PCI_DEVICE_ID_INTEL_82865 0x1227
#define PCI_DEVICE_ID_INTEL_82557 0x1229
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 9841fd436cfe..bd3f28d266c2 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -2073,13 +2073,14 @@ extern inline int reiserfs_new_form_blocknrs (struct tree_balance * tb,
}
extern inline int reiserfs_new_unf_blocknrs (struct reiserfs_transaction_handle *th,
+ struct inode *inode,
b_blocknr_t *new_blocknrs,
struct path * path, long block)
{
reiserfs_blocknr_hint_t hint = {
.th = th,
.path = path,
- .inode = NULL,
+ .inode = inode,
.block = block,
.formatted_node = 0,
.preallocate = 0
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 80a9836df919..d0726cb87145 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -424,9 +424,8 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0)
#define PF_FREEZE 0x00008000 /* this task should be frozen for suspend */
#define PF_IOTHREAD 0x00010000 /* this thread is needed for doing I/O to swap */
#define PF_FROZEN 0x00020000 /* frozen for system suspend */
-#define PF_SYNC 0x00040000 /* performing fsync(), etc */
-#define PF_FSTRANS 0x00080000 /* inside a filesystem transaction */
-#define PF_KSWAPD 0x00100000 /* I am kswapd */
+#define PF_FSTRANS 0x00040000 /* inside a filesystem transaction */
+#define PF_KSWAPD 0x00080000 /* I am kswapd */
/*
* Ptrace flags
diff --git a/include/linux/sem.h b/include/linux/sem.h
index 429e72a2eadd..1b869bf3aad9 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -140,6 +140,8 @@ struct sysv_sem {
asmlinkage long sys_semget (key_t key, int nsems, int semflg);
asmlinkage long sys_semop (int semid, struct sembuf *sops, unsigned nsops);
asmlinkage long sys_semctl (int semid, int semnum, int cmd, union semun arg);
+asmlinkage long sys_semtimedop(int semid, struct sembuf *sops,
+ unsigned nsops, const struct timespec *timeout);
#endif /* __KERNEL__ */
diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h
index 89ead755abfe..e10e33a99574 100644
--- a/include/linux/sonypi.h
+++ b/include/linux/sonypi.h
@@ -43,9 +43,9 @@
#define SONYPI_EVENT_JOGDIAL_DOWN_PRESSED 3
#define SONYPI_EVENT_JOGDIAL_UP_PRESSED 4
#define SONYPI_EVENT_JOGDIAL_PRESSED 5
-#define SONYPI_EVENT_JOGDIAL_RELEASED 6
+#define SONYPI_EVENT_JOGDIAL_RELEASED 6 /* obsolete */
#define SONYPI_EVENT_CAPTURE_PRESSED 7
-#define SONYPI_EVENT_CAPTURE_RELEASED 8
+#define SONYPI_EVENT_CAPTURE_RELEASED 8 /* obsolete */
#define SONYPI_EVENT_CAPTURE_PARTIALPRESSED 9
#define SONYPI_EVENT_CAPTURE_PARTIALRELEASED 10
#define SONYPI_EVENT_FNKEY_ESC 11
@@ -93,7 +93,7 @@
#define SONYPI_EVENT_MEYE_OPPOSITE 53
#define SONYPI_EVENT_MEMORYSTICK_INSERT 54
#define SONYPI_EVENT_MEMORYSTICK_EJECT 55
-
+#define SONYPI_EVENT_ANYBUTTON_RELEASED 56
/* get/set brightness */
#define SONYPI_IOCGBRT _IOR('v', 0, __u8)
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index 74c5260b2343..fd871e87f7f4 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -211,6 +211,10 @@ xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes)
return p;
}
+extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages,
+ unsigned int base, unsigned int len);
+extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len);
+
/*
* Initialize an xdr_stream for decoding data.
*/
diff --git a/include/linux/swap.h b/include/linux/swap.h
index f6b1421f86b0..c635f392d6c1 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -65,6 +65,7 @@ typedef struct {
struct sysinfo;
struct address_space;
struct zone;
+struct writeback_control;
/*
* A swap extent maps a range of a swapfile's PAGE_SIZE pages onto a range of
@@ -180,7 +181,7 @@ extern int shmem_unuse(swp_entry_t entry, struct page *page);
#ifdef CONFIG_SWAP
/* linux/mm/page_io.c */
extern int swap_readpage(struct file *, struct page *);
-extern int swap_writepage(struct page *);
+extern int swap_writepage(struct page *page, struct writeback_control *wbc);
extern int rw_swap_page_sync(int, swp_entry_t, struct page *);
/* linux/mm/swap_state.c */
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index e70fc2ef0856..0b905659ac4b 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -154,6 +154,7 @@ enum
VM_PAGEBUF=17, /* struct: Control pagebuf parameters */
VM_HUGETLB_PAGES=18, /* int: Number of available Huge Pages */
VM_SWAPPINESS=19, /* Tendency to steal mapped memory */
+ VM_LOWER_ZONE_PROTECTION=20,/* Amount of protection of lower zones */
};
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 9cc9f1d2e2df..88557d5957a7 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -117,6 +117,7 @@ struct usb_interface {
unsigned max_altsetting; /* total memory allocated */
struct usb_driver *driver; /* driver */
+ kdev_t kdev; /* node this interface is bound to */
struct device dev; /* interface specific device info */
void *private_data;
};
@@ -271,6 +272,8 @@ extern void usb_driver_release_interface(struct usb_driver *driver,
const struct usb_device_id *usb_match_id(struct usb_interface *interface,
const struct usb_device_id *id);
+struct usb_interface *usb_find_interface(struct usb_driver *drv, kdev_t kdev);
+
/**
* usb_make_path - returns stable device path in the usb tree
* @dev: the device whose path is being constructed
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 687091648a3a..620f18f5ceeb 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -1,9 +1,5 @@
/*
* include/linux/writeback.h.
- *
- * These declarations are private to fs/ and mm/.
- * Declarations which are exported to filesystems do not
- * get placed here.
*/
#ifndef WRITEBACK_H
#define WRITEBACK_H
@@ -45,8 +41,19 @@ struct writeback_control {
this for each page written */
int nonblocking; /* Don't get stuck on request queues */
int encountered_congestion; /* An output: a queue is full */
+ int for_kupdate; /* A kupdate writeback */
+ int for_reclaim; /* Invoked from the page allocator */
};
-
+
+/*
+ * ->writepage() return values (make these much larger than a pagesize, in
+ * case some fs is returning number-of-bytes-written from writepage)
+ */
+#define WRITEPAGE_ACTIVATE 0x80000 /* IO was not started: activate page */
+
+/*
+ * fs/fs-writeback.c
+ */
void writeback_inodes(struct writeback_control *wbc);
void wake_up_inode(struct inode *inode);
void __wait_on_inode(struct inode * inode);
@@ -82,13 +89,4 @@ extern int nr_pdflush_threads; /* Global so it can be exported to sysctl
read-only. */
-/*
- * Tell the writeback paths that they are being called for a "data integrity"
- * operation such as fsync().
- */
-static inline int called_for_sync(void)
-{
- return current->flags & PF_SYNC;
-}
-
#endif /* WRITEBACK_H */