diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-07-09 02:54:55 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-07-09 02:54:55 +0000 |
commit | 493c987f7a352ca64fdb4dc03a21e24cbaf46f55 (patch) | |
tree | 184cddc0925e082c0500afd042f92e9f340fe890 /include/linux | |
parent | 2d25612a92c62b5708d6d43f38d28c6141173328 (diff) |
Merge with Linux 2.4.0-pre3-test6.
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/dcache.h | 11 | ||||
-rw-r--r-- | include/linux/fs.h | 5 | ||||
-rw-r--r-- | include/linux/slab.h | 16 | ||||
-rw-r--r-- | include/linux/spinlock.h | 9 | ||||
-rw-r--r-- | include/linux/sunrpc/sched.h | 40 | ||||
-rw-r--r-- | include/linux/sunrpc/xprt.h | 8 |
6 files changed, 50 insertions, 39 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index bae5641fd..7c0acf4bb 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -198,8 +198,8 @@ extern void d_rehash(struct dentry *); static __inline__ void d_add(struct dentry * entry, struct inode * inode) { - d_rehash(entry); d_instantiate(entry, inode); + d_rehash(entry); } /* used for rename() and baskets */ @@ -227,6 +227,8 @@ extern char * __d_path(struct dentry *, struct vfsmount *, struct dentry *, static __inline__ struct dentry * dget(struct dentry *dentry) { + if (!atomic_read(&dentry->d_count)) + BUG(); if (dentry) atomic_inc(&dentry->d_count); return dentry; @@ -244,12 +246,7 @@ static __inline__ int d_unhashed(struct dentry *dentry) return list_empty(&dentry->d_hash); } -extern void __dput(struct dentry *); -static __inline__ void dput(struct dentry *dentry) -{ - if (dentry && atomic_dec_and_test(&dentry->d_count)) - __dput(dentry); -} +extern void dput(struct dentry *); static __inline__ int d_mountpoint(struct dentry *dentry) { diff --git a/include/linux/fs.h b/include/linux/fs.h index da3f0e56e..dcb93786e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -883,8 +883,9 @@ extern struct file *filp_open(const char *, int, int); extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); extern int filp_close(struct file *, fl_owner_t id); extern char * getname(const char *); -#define __getname() ((char *) __get_free_page(GFP_KERNEL)) -#define putname(name) free_page((unsigned long)(name)) + +#define __getname() kmem_cache_alloc(names_cachep, SLAB_KERNEL) +#define putname(name) kmem_cache_free(names_cachep, (void *)(name)) enum {BDEV_FILE, BDEV_SWAP, BDEV_FS, BDEV_RAW}; extern int register_blkdev(unsigned int, const char *, struct block_device_operations *); diff --git a/include/linux/slab.h b/include/linux/slab.h index 019538c7c..58edc3b0c 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -35,9 +35,7 @@ typedef struct kmem_cache_s kmem_cache_t; #define SLAB_POISON 0x00000800UL /* Poison objects */ #define SLAB_NO_REAP 0x00001000UL /* never reap from the cache */ #define SLAB_HWCACHE_ALIGN 0x00002000UL /* align objs on a h/w cache lines */ -#if 0 -#define SLAB_HIGH_PACK 0x00004000UL /* XXX */ -#endif +#define SLAB_CACHE_DMA 0x00004000UL /* use GFP_DMA memory */ /* flags passed to a constructor func */ #define SLAB_CTOR_CONSTRUCTOR 0x001UL /* if not set, then deconstructor */ @@ -47,7 +45,9 @@ typedef struct kmem_cache_s kmem_cache_t; /* prototypes */ extern void kmem_cache_init(void); extern void kmem_cache_sizes_init(void); -extern kmem_cache_t *kmem_find_general_cachep(size_t); +extern void kmem_cpucache_init(void); + +extern kmem_cache_t *kmem_find_general_cachep(size_t, int gfpflags); extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned long, void (*)(void *, kmem_cache_t *, unsigned long), void (*)(void *, kmem_cache_t *, unsigned long)); @@ -58,14 +58,18 @@ extern void kmem_cache_free(kmem_cache_t *, void *); extern void *kmalloc(size_t, int); extern void kfree(const void *); -extern void kfree_s(const void *, size_t); +#define kfree_s(objp,s) kfree(objp) extern void kmem_cache_reap(int); -extern int get_slabinfo(char *); +extern int slabinfo_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data); +extern int slabinfo_write_proc(struct file *file, const char *buffer, + unsigned long count, void *data); /* System wide caches */ extern kmem_cache_t *vm_area_cachep; extern kmem_cache_t *mm_cachep; +extern kmem_cache_t *names_cachep; #endif /* __KERNEL__ */ diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index b4a190d65..86fce1e7d 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h @@ -40,6 +40,8 @@ #if (DEBUG_SPINLOCKS < 1) +#define atomic_dec_and_lock(atomic,lock) atomic_dec_and_test(atomic) + /* * Your basic spinlocks, allowing only a single CPU anywhere * @@ -122,4 +124,11 @@ typedef struct { #define write_unlock(lock) do { } while(0) #endif /* !SMP */ + +/* "lock on reference count zero" */ +#ifndef atomic_dec_and_lock +#include <asm/atomic.h> +extern int atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock); +#endif + #endif /* __LINUX_SPINLOCK_H */ diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index a45f0ae2e..8b559703a 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h @@ -43,7 +43,7 @@ struct rpc_task { struct rpc_task * tk_prev_task; /* global list of tasks */ struct rpc_clnt * tk_client; /* RPC client */ struct rpc_rqst * tk_rqstp; /* RPC request */ - int tk_status; /* result of last operation */ + volatile int tk_status; /* result of last operation */ struct rpc_wait_queue * tk_rpcwait; /* RPC wait queue we're on */ /* @@ -56,10 +56,12 @@ struct rpc_task { tk_suid_retry; /* + * timeout_fn to be executed by timer bottom half * callback to be executed after waking up * action next procedure for async tasks * exit exit async task and report to caller */ + void (*tk_timeout_fn)(struct rpc_task *); void (*tk_callback)(struct rpc_task *); void (*tk_action)(struct rpc_task *); void (*tk_exit)(struct rpc_task *); @@ -76,9 +78,10 @@ struct rpc_task { unsigned long tk_timeout; /* timeout for rpc_sleep() */ unsigned short tk_flags; /* misc flags */ unsigned short tk_lock; /* Task lock counter */ - unsigned int tk_wakeup : 1,/* Task waiting to wake up */ - tk_sleeping : 1,/* Task is truly asleep */ - tk_active : 1;/* Task has been activated */ + unsigned char tk_active : 1,/* Task has been activated */ + tk_wakeup : 1;/* Task waiting to wake up */ + volatile unsigned char tk_running : 1,/* Task is running */ + tk_sleeping : 1;/* Task is truly asleep */ #ifdef RPC_DEBUG unsigned short tk_pid; /* debugging aid */ #endif @@ -91,29 +94,26 @@ typedef void (*rpc_action)(struct rpc_task *); /* * RPC task flags */ -#define RPC_TASK_RUNNING 0x0001 /* is running */ -#define RPC_TASK_ASYNC 0x0002 /* is an async task */ -#define RPC_TASK_CALLBACK 0x0004 /* invoke callback */ -#define RPC_TASK_SWAPPER 0x0008 /* is swapping in/out */ -#define RPC_TASK_SETUID 0x0010 /* is setuid process */ -#define RPC_TASK_CHILD 0x0020 /* is child of other task */ -#define RPC_CALL_REALUID 0x0040 /* try using real uid */ -#define RPC_CALL_MAJORSEEN 0x0080 /* major timeout seen */ -#define RPC_TASK_ROOTCREDS 0x0100 /* force root creds */ -#define RPC_TASK_DYNAMIC 0x0200 /* task was kmalloc'ed */ -#define RPC_TASK_KILLED 0x0400 /* task was killed */ -#define RPC_TASK_NFSWRITE 0x1000 /* an NFS writeback */ - -#define RPC_IS_RUNNING(t) ((t)->tk_flags & RPC_TASK_RUNNING) +#define RPC_TASK_ASYNC 0x0001 /* is an async task */ +#define RPC_TASK_SWAPPER 0x0002 /* is swapping in/out */ +#define RPC_TASK_SETUID 0x0004 /* is setuid process */ +#define RPC_TASK_CHILD 0x0008 /* is child of other task */ +#define RPC_CALL_REALUID 0x0010 /* try using real uid */ +#define RPC_CALL_MAJORSEEN 0x0020 /* major timeout seen */ +#define RPC_TASK_ROOTCREDS 0x0040 /* force root creds */ +#define RPC_TASK_DYNAMIC 0x0080 /* task was kmalloc'ed */ +#define RPC_TASK_KILLED 0x0100 /* task was killed */ + #define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC) #define RPC_IS_SETUID(t) ((t)->tk_flags & RPC_TASK_SETUID) #define RPC_IS_CHILD(t) ((t)->tk_flags & RPC_TASK_CHILD) #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) -#define RPC_DO_CALLBACK(t) ((t)->tk_flags & RPC_TASK_CALLBACK) #define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS) #define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED) +#define RPC_IS_RUNNING(t) ((t)->tk_running) #define RPC_IS_SLEEPING(t) ((t)->tk_sleeping) #define RPC_IS_ACTIVATED(t) ((t)->tk_active) +#define RPC_DO_CALLBACK(t) ((t)->tk_callback != NULL) /* * RPC synchronization objects @@ -154,7 +154,7 @@ void rpc_wake_up_task(struct rpc_task *); void rpc_wake_up(struct rpc_wait_queue *); struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *); void rpc_wake_up_status(struct rpc_wait_queue *, int); -int rpc_lock_task(struct rpc_task *); +int __rpc_lock_task(struct rpc_task *); void rpc_unlock_task(struct rpc_task *); void rpc_delay(struct rpc_task *, unsigned long); void * rpc_allocate(unsigned int flags, unsigned int); diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index e5e66c1de..dd27162ff 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h @@ -96,7 +96,7 @@ struct rpc_rqst { struct rpc_task * rq_task; /* RPC task data */ __u32 rq_xid; /* request XID */ struct rpc_rqst * rq_next; /* free list */ - unsigned char rq_damaged; /* reply being received */ + volatile unsigned char rq_received : 1;/* receive completed */ /* * For authentication (e.g. auth_des) @@ -138,9 +138,9 @@ struct rpc_xprt { struct rpc_wait_queue reconn; /* waiting for reconnect */ struct rpc_rqst * free; /* free slots */ struct rpc_rqst slot[RPC_MAXREQS]; - unsigned int connected : 1, /* TCP: connected */ - write_space: 1, /* TCP: can send */ - shutdown : 1, /* being shut down */ + volatile unsigned char connected : 1, /* TCP: connected */ + write_space: 1; /* TCP: can send */ + unsigned char shutdown : 1, /* being shut down */ nocong : 1, /* no congestion control */ stream : 1, /* TCP */ tcp_more : 1, /* more record fragments */ |