summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Robbins <drobbins@gentoo.org>2001-07-09 21:55:03 +0000
committerDaniel Robbins <drobbins@gentoo.org>2001-07-09 21:55:03 +0000
commit475108a9e2bbb468fad20222734dbd50a7875b19 (patch)
tree85cc3a6c4a7353107ed98664b5eefa829a7f3eda /sys-kernel
parentInitial import into portage tree. (diff)
downloadgentoo-2-475108a9e2bbb468fad20222734dbd50a7875b19.tar.gz
gentoo-2-475108a9e2bbb468fad20222734dbd50a7875b19.tar.bz2
gentoo-2-475108a9e2bbb468fad20222734dbd50a7875b19.zip
adding ext3 and JFS support at the moment; this process includes upgrading
e2fsprogs.
Diffstat (limited to 'sys-kernel')
-rw-r--r--sys-kernel/linux-sources/files/2.4.6/linux-2.4.6-reiserfs-NFS.patch647
-rw-r--r--sys-kernel/linux-sources/files/2.4.6/lvm.c.diff20
-rw-r--r--sys-kernel/linux-sources/files/digest-linux-sources-2.4.66
-rw-r--r--sys-kernel/linux-sources/linux-sources-2.4.6.ebuild412
4 files changed, 1085 insertions, 0 deletions
diff --git a/sys-kernel/linux-sources/files/2.4.6/linux-2.4.6-reiserfs-NFS.patch b/sys-kernel/linux-sources/files/2.4.6/linux-2.4.6-reiserfs-NFS.patch
new file mode 100644
index 000000000000..5f3830c8ffe1
--- /dev/null
+++ b/sys-kernel/linux-sources/files/2.4.6/linux-2.4.6-reiserfs-NFS.patch
@@ -0,0 +1,647 @@
+diff -u --recursive --new-file linux-2.4.6-file/fs/nfs/inode.c linux-2.4.6-mmap/fs/nfs/inode.c
+--- linux-2.4.6-file/fs/nfs/inode.c Wed Jul 4 17:30:28 2001
++++ linux-2.4.6-mmap/fs/nfs/inode.c Wed Jul 4 20:48:01 2001
+@@ -48,6 +48,7 @@
+ static void nfs_write_inode(struct inode *,int);
+ static void nfs_delete_inode(struct inode *);
+ static void nfs_put_super(struct super_block *);
++static void nfs_clear_inode(struct inode *);
+ static void nfs_umount_begin(struct super_block *);
+ static int nfs_statfs(struct super_block *, struct statfs *);
+
+@@ -57,6 +58,7 @@
+ delete_inode: nfs_delete_inode,
+ put_super: nfs_put_super,
+ statfs: nfs_statfs,
++ clear_inode: nfs_clear_inode,
+ umount_begin: nfs_umount_begin,
+ };
+
+@@ -141,6 +143,21 @@
+ clear_inode(inode);
+ }
+
++/*
++ * For the moment, the only task for the NFS clear_inode method is to
++ * release the mmap credential
++ */
++static void
++nfs_clear_inode(struct inode *inode)
++{
++ struct rpc_cred *cred = NFS_I(inode)->mm_cred;
++
++ if (cred) {
++ put_rpccred(cred);
++ NFS_I(inode)->mm_cred = 0;
++ }
++}
++
+ void
+ nfs_put_super(struct super_block *sb)
+ {
+@@ -600,7 +617,6 @@
+ inode->i_ctime = nfs_time_to_secs(fattr->ctime);
+ NFS_CACHE_CTIME(inode) = fattr->ctime;
+ NFS_CACHE_MTIME(inode) = fattr->mtime;
+- NFS_CACHE_ATIME(inode) = fattr->atime;
+ NFS_CACHE_ISIZE(inode) = fattr->size;
+ NFS_ATTRTIMEO(inode) = NFS_MINATTRTIMEO(inode);
+ NFS_ATTRTIMEO_UPDATE(inode) = jiffies;
+@@ -794,6 +810,20 @@
+ }
+
+ /*
++ * Ensure that mmap has a recent RPC credential for use when writing out
++ * shared pages
++ */
++static inline void
++nfs_set_mmcred(struct inode *inode, struct rpc_cred *cred)
++{
++ struct rpc_cred *oldcred = NFS_I(inode)->mm_cred;
++
++ NFS_I(inode)->mm_cred = get_rpccred(cred);
++ if (oldcred)
++ put_rpccred(oldcred);
++}
++
++/*
+ * These are probably going to contain hooks for
+ * allocating and releasing RPC credentials for
+ * the file. I'll have to think about Tronds patch
+@@ -808,20 +838,20 @@
+ auth = NFS_CLIENT(inode)->cl_auth;
+ cred = rpcauth_lookupcred(auth, 0);
+ filp->private_data = cred;
++ if (filp->f_mode & FMODE_WRITE)
++ nfs_set_mmcred(inode, cred);
+ unlock_kernel();
+ return 0;
+ }
+
+ int nfs_release(struct inode *inode, struct file *filp)
+ {
+- struct rpc_auth *auth;
+ struct rpc_cred *cred;
+
+ lock_kernel();
+- auth = NFS_CLIENT(inode)->cl_auth;
+ cred = nfs_file_cred(filp);
+ if (cred)
+- rpcauth_releasecred(auth, cred);
++ put_rpccred(cred);
+ unlock_kernel();
+ return 0;
+ }
+@@ -976,7 +1006,6 @@
+ NFS_CACHE_CTIME(inode) = fattr->ctime;
+ inode->i_ctime = nfs_time_to_secs(fattr->ctime);
+
+- NFS_CACHE_ATIME(inode) = fattr->atime;
+ inode->i_atime = nfs_time_to_secs(fattr->atime);
+
+ NFS_CACHE_MTIME(inode) = new_mtime;
+diff -u --recursive --new-file linux-2.4.6-file/fs/nfs/unlink.c linux-2.4.6-mmap/fs/nfs/unlink.c
+--- linux-2.4.6-file/fs/nfs/unlink.c Fri Feb 9 20:29:44 2001
++++ linux-2.4.6-mmap/fs/nfs/unlink.c Wed Jul 4 20:48:47 2001
+@@ -128,7 +128,7 @@
+ dir_i = dir->d_inode;
+ nfs_zap_caches(dir_i);
+ NFS_PROTO(dir_i)->unlink_done(dir, &task->tk_msg);
+- rpcauth_releasecred(task->tk_auth, data->cred);
++ put_rpccred(data->cred);
+ data->cred = NULL;
+ dput(dir);
+ }
+diff -u --recursive --new-file linux-2.4.6-file/fs/nfs/write.c linux-2.4.6-mmap/fs/nfs/write.c
+--- linux-2.4.6-file/fs/nfs/write.c Mon May 21 21:29:14 2001
++++ linux-2.4.6-mmap/fs/nfs/write.c Wed Jul 4 20:48:24 2001
+@@ -181,7 +181,9 @@
+
+
+ if (file)
+- cred = nfs_file_cred(file);
++ cred = get_rpccred(nfs_file_cred(file));
++ if (!cred)
++ cred = get_rpccred(NFS_I(inode)->mm_cred);
+
+ dprintk("NFS: nfs_writepage_sync(%x/%Ld %d@%Ld)\n",
+ inode->i_dev, (long long)NFS_FILEID(inode),
+@@ -226,6 +228,8 @@
+
+ io_error:
+ kunmap(page);
++ if (cred)
++ put_rpccred(cred);
+
+ return written? written : result;
+ }
+@@ -241,6 +245,9 @@
+ status = (IS_ERR(req)) ? PTR_ERR(req) : 0;
+ if (status < 0)
+ goto out;
++ if (!req->wb_cred)
++ req->wb_cred = get_rpccred(NFS_I(inode)->mm_cred);
++ nfs_unlock_request(req);
+ nfs_release_request(req);
+ nfs_strategy(inode);
+ out:
+@@ -557,13 +564,11 @@
+ req->wb_bytes = count;
+ req->wb_file = file;
+
+- /* If we have a struct file, use its cached credentials
+- * else cache the current process' credentials. */
++ /* If we have a struct file, use its cached credentials */
+ if (file) {
+ get_file(file);
+ req->wb_cred = nfs_file_cred(file);
+- } else
+- req->wb_cred = rpcauth_lookupcred(NFS_CLIENT(inode)->cl_auth, 0);
++ }
+ req->wb_inode = inode;
+ req->wb_count = 1;
+
+@@ -608,8 +613,8 @@
+ /* Release struct file or cached credential */
+ if (req->wb_file)
+ fput(req->wb_file);
+- else
+- rpcauth_releasecred(NFS_CLIENT(inode)->cl_auth, req->wb_cred);
++ else if (req->wb_cred)
++ put_rpccred(req->wb_cred);
+ page_cache_release(page);
+ nfs_page_free(req);
+ /* wake up anyone waiting to allocate a request */
+@@ -927,8 +932,6 @@
+ if (end > rqend)
+ req->wb_bytes = end - req->wb_offset;
+
+- nfs_unlock_request(req);
+-
+ return req;
+ }
+
+@@ -1049,6 +1052,7 @@
+ goto done;
+
+ status = 0;
++ nfs_unlock_request(req);
+ /* If we wrote past the end of the page.
+ * Call the strategy routine so it can send out a bunch
+ * of requests.
+diff -u --recursive --new-file linux-2.4.6-file/include/linux/nfs_fs.h linux-2.4.6-mmap/include/linux/nfs_fs.h
+--- linux-2.4.6-file/include/linux/nfs_fs.h Sat May 26 03:02:11 2001
++++ linux-2.4.6-mmap/include/linux/nfs_fs.h Wed Jul 4 17:32:16 2001
+@@ -63,6 +63,11 @@
+ */
+ #define NFS_SUPER_MAGIC 0x6969
+
++static inline struct nfs_inode_info *NFS_I(struct inode *inode)
++{
++ return &inode->u.nfs_i;
++}
++
+ #define NFS_FH(inode) (&(inode)->u.nfs_i.fh)
+ #define NFS_SERVER(inode) (&(inode)->i_sb->u.nfs_sb.s_server)
+ #define NFS_CLIENT(inode) (NFS_SERVER(inode)->client)
+@@ -74,7 +79,6 @@
+ #define NFS_READTIME(inode) ((inode)->u.nfs_i.read_cache_jiffies)
+ #define NFS_CACHE_CTIME(inode) ((inode)->u.nfs_i.read_cache_ctime)
+ #define NFS_CACHE_MTIME(inode) ((inode)->u.nfs_i.read_cache_mtime)
+-#define NFS_CACHE_ATIME(inode) ((inode)->u.nfs_i.read_cache_atime)
+ #define NFS_CACHE_ISIZE(inode) ((inode)->u.nfs_i.read_cache_isize)
+ #define NFS_NEXTSCAN(inode) ((inode)->u.nfs_i.nextscan)
+ #define NFS_CACHEINV(inode) \
+diff -u --recursive --new-file linux-2.4.6-file/include/linux/nfs_fs_i.h linux-2.4.6-mmap/include/linux/nfs_fs_i.h
+--- linux-2.4.6-file/include/linux/nfs_fs_i.h Thu May 31 15:27:10 2001
++++ linux-2.4.6-mmap/include/linux/nfs_fs_i.h Wed Jul 4 17:32:16 2001
+@@ -45,7 +45,6 @@
+ unsigned long read_cache_jiffies;
+ __u64 read_cache_ctime;
+ __u64 read_cache_mtime;
+- __u64 read_cache_atime;
+ __u64 read_cache_isize;
+ unsigned long attrtimeo;
+ unsigned long attrtimeo_timestamp;
+@@ -73,6 +72,9 @@
+ struct inode *hash_next,
+ *hash_prev;
+ unsigned long nextscan;
++
++ /* Credentials for shared mmap */
++ struct rpc_cred *mm_cred;
+ };
+
+ /*
+diff -u --recursive --new-file linux-2.4.6-file/include/linux/sunrpc/auth.h linux-2.4.6-mmap/include/linux/sunrpc/auth.h
+--- linux-2.4.6-file/include/linux/sunrpc/auth.h Fri Jun 22 19:30:22 2001
++++ linux-2.4.6-mmap/include/linux/sunrpc/auth.h Wed Jul 4 20:51:35 2001
+@@ -14,6 +14,8 @@
+ #include <linux/config.h>
+ #include <linux/sunrpc/sched.h>
+
++#include <asm/atomic.h>
++
+ /* size of the nodename buffer */
+ #define UNX_MAXNODENAME 32
+
+@@ -22,8 +24,10 @@
+ */
+ struct rpc_cred {
+ struct rpc_cred * cr_next; /* linked list */
++ struct rpc_auth * cr_auth;
++ struct rpc_credops * cr_ops;
+ unsigned long cr_expire; /* when to gc */
+- unsigned short cr_count; /* ref count */
++ atomic_t cr_count; /* ref count */
+ unsigned short cr_flags; /* various flags */
+ #ifdef RPC_DEBUG
+ unsigned long cr_magic; /* 0x0f4aa4f0 */
+@@ -71,6 +75,9 @@
+ void (*destroy)(struct rpc_auth *);
+
+ struct rpc_cred * (*crcreate)(int);
++};
++
++struct rpc_credops {
+ void (*crdestroy)(struct rpc_cred *);
+
+ int (*crmatch)(struct rpc_cred *, int);
+@@ -92,8 +99,7 @@
+ struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int);
+ struct rpc_cred * rpcauth_bindcred(struct rpc_task *);
+ void rpcauth_holdcred(struct rpc_task *);
+-void rpcauth_releasecred(struct rpc_auth *,
+- struct rpc_cred *);
++void put_rpccred(struct rpc_cred *);
+ void rpcauth_unbindcred(struct rpc_task *);
+ int rpcauth_matchcred(struct rpc_auth *,
+ struct rpc_cred *, int);
+@@ -106,6 +112,13 @@
+ void rpcauth_free_credcache(struct rpc_auth *);
+ void rpcauth_insert_credcache(struct rpc_auth *,
+ struct rpc_cred *);
++
++static inline
++struct rpc_cred * get_rpccred(struct rpc_cred *cred)
++{
++ atomic_inc(&cred->cr_count);
++ return cred;
++}
+
+ #endif /* __KERNEL__ */
+ #endif /* _LINUX_SUNRPC_AUTH_H */
+diff -u --recursive --new-file linux-2.4.6-file/net/sunrpc/auth.c linux-2.4.6-mmap/net/sunrpc/auth.c
+--- linux-2.4.6-file/net/sunrpc/auth.c Fri Feb 9 20:29:44 2001
++++ linux-2.4.6-mmap/net/sunrpc/auth.c Wed Jul 4 20:51:04 2001
+@@ -81,42 +81,61 @@
+ auth->au_nextgc = jiffies + (auth->au_expire >> 1);
+ }
+
++/*
++ * Destroy an unreferenced credential
++ */
+ static inline void
+-rpcauth_crdestroy(struct rpc_auth *auth, struct rpc_cred *cred)
++rpcauth_crdestroy(struct rpc_cred *cred)
+ {
+ #ifdef RPC_DEBUG
+ if (cred->cr_magic != RPCAUTH_CRED_MAGIC)
+ BUG();
+ cred->cr_magic = 0;
++ if (atomic_read(&cred->cr_count) || cred->cr_auth)
++ BUG();
+ #endif
+- if (auth->au_ops->crdestroy)
+- auth->au_ops->crdestroy(cred);
+- else
+- rpc_free(cred);
++ cred->cr_ops->crdestroy(cred);
+ }
+
+ /*
+- * Clear the RPC credential cache
++ * Destroy a list of credentials
++ */
++static inline
++void rpcauth_destroy_credlist(struct rpc_cred *head)
++{
++ struct rpc_cred *cred;
++
++ while ((cred = head) != NULL) {
++ head = cred->cr_next;
++ rpcauth_crdestroy(cred);
++ }
++}
++
++/*
++ * Clear the RPC credential cache, and delete those credentials
++ * that are not referenced.
+ */
+ void
+ rpcauth_free_credcache(struct rpc_auth *auth)
+ {
+- struct rpc_cred **q, *cred;
+- void (*destroy)(struct rpc_cred *);
++ struct rpc_cred **q, *cred, *free = NULL;
+ int i;
+
+- if (!(destroy = auth->au_ops->crdestroy))
+- destroy = (void (*)(struct rpc_cred *)) rpc_free;
+-
+ spin_lock(&rpc_credcache_lock);
+ for (i = 0; i < RPC_CREDCACHE_NR; i++) {
+ q = &auth->au_credcache[i];
+ while ((cred = *q) != NULL) {
+ *q = cred->cr_next;
+- destroy(cred);
++ cred->cr_auth = NULL;
++ if (atomic_read(&cred->cr_count) == 0) {
++ cred->cr_next = free;
++ free = cred;
++ } else
++ cred->cr_next = NULL;
+ }
+ }
+ spin_unlock(&rpc_credcache_lock);
++ rpcauth_destroy_credlist(free);
+ }
+
+ /*
+@@ -133,9 +152,10 @@
+ for (i = 0; i < RPC_CREDCACHE_NR; i++) {
+ q = &auth->au_credcache[i];
+ while ((cred = *q) != NULL) {
+- if (!cred->cr_count &&
++ if (!atomic_read(&cred->cr_count) &&
+ time_before(cred->cr_expire, jiffies)) {
+ *q = cred->cr_next;
++ cred->cr_auth = NULL;
+ cred->cr_next = free;
+ free = cred;
+ continue;
+@@ -144,10 +164,7 @@
+ }
+ }
+ spin_unlock(&rpc_credcache_lock);
+- while ((cred = free) != NULL) {
+- free = cred->cr_next;
+- rpcauth_crdestroy(auth, cred);
+- }
++ rpcauth_destroy_credlist(free);
+ auth->au_nextgc = jiffies + auth->au_expire;
+ }
+
+@@ -163,8 +180,8 @@
+ spin_lock(&rpc_credcache_lock);
+ cred->cr_next = auth->au_credcache[nr];
+ auth->au_credcache[nr] = cred;
+- cred->cr_count++;
+- cred->cr_expire = jiffies + auth->au_expire;
++ cred->cr_auth = auth;
++ get_rpccred(cred);
+ spin_unlock(&rpc_credcache_lock);
+ }
+
+@@ -187,7 +204,7 @@
+ q = &auth->au_credcache[nr];
+ while ((cred = *q) != NULL) {
+ if (!(cred->cr_flags & RPCAUTH_CRED_DEAD) &&
+- auth->au_ops->crmatch(cred, taskflags)) {
++ cred->cr_ops->crmatch(cred, taskflags)) {
+ *q = cred->cr_next;
+ break;
+ }
+@@ -213,23 +230,23 @@
+ * Remove cred handle from cache
+ */
+ static void
+-rpcauth_remove_credcache(struct rpc_auth *auth, struct rpc_cred *cred)
++rpcauth_remove_credcache(struct rpc_cred *cred)
+ {
++ struct rpc_auth *auth = cred->cr_auth;
+ struct rpc_cred **q, *cr;
+ int nr;
+
+ nr = (cred->cr_uid & RPC_CREDCACHE_MASK);
+- spin_lock(&rpc_credcache_lock);
+ q = &auth->au_credcache[nr];
+ while ((cr = *q) != NULL) {
+ if (cred == cr) {
+ *q = cred->cr_next;
+ cred->cr_next = NULL;
++ cred->cr_auth = NULL;
+ break;
+ }
+ q = &cred->cr_next;
+ }
+- spin_unlock(&rpc_credcache_lock);
+ }
+
+ struct rpc_cred *
+@@ -258,7 +275,7 @@
+ {
+ dprintk("RPC: matching %s cred %d\n",
+ auth->au_ops->au_name, taskflags);
+- return auth->au_ops->crmatch(cred, taskflags);
++ return cred->cr_ops->crmatch(cred, taskflags);
+ }
+
+ void
+@@ -266,26 +283,25 @@
+ {
+ dprintk("RPC: %4d holding %s cred %p\n",
+ task->tk_pid, task->tk_auth->au_ops->au_name, task->tk_msg.rpc_cred);
+- if (task->tk_msg.rpc_cred) {
+- spin_lock(&rpc_credcache_lock);
+- task->tk_msg.rpc_cred->cr_count++;
+- task->tk_msg.rpc_cred->cr_expire = jiffies + task->tk_auth->au_expire;
+- spin_unlock(&rpc_credcache_lock);
+- }
++ if (task->tk_msg.rpc_cred)
++ get_rpccred(task->tk_msg.rpc_cred);
+ }
+
+ void
+-rpcauth_releasecred(struct rpc_auth *auth, struct rpc_cred *cred)
++put_rpccred(struct rpc_cred *cred)
+ {
+- spin_lock(&rpc_credcache_lock);
+- if (cred != NULL && cred->cr_count > 0) {
+- if (!--cred->cr_count && (cred->cr_flags & RPCAUTH_CRED_DEAD)) {
+- spin_unlock(&rpc_credcache_lock);
+- rpcauth_remove_credcache(auth, cred);
+- rpcauth_crdestroy(auth, cred);
+- return;
+- }
++ if (!atomic_dec_and_lock(&cred->cr_count, &rpc_credcache_lock))
++ return;
++
++ if (cred->cr_auth && cred->cr_flags & RPCAUTH_CRED_DEAD)
++ rpcauth_remove_credcache(cred);
++
++ if (!cred->cr_auth) {
++ spin_unlock(&rpc_credcache_lock);
++ rpcauth_crdestroy(cred);
++ return;
+ }
++ cred->cr_expire = jiffies + cred->cr_auth->au_expire;
+ spin_unlock(&rpc_credcache_lock);
+ }
+
+@@ -298,7 +314,7 @@
+ dprintk("RPC: %4d releasing %s cred %p\n",
+ task->tk_pid, auth->au_ops->au_name, cred);
+
+- rpcauth_releasecred(auth, cred);
++ put_rpccred(cred);
+ task->tk_msg.rpc_cred = NULL;
+ }
+
+@@ -306,10 +322,11 @@
+ rpcauth_marshcred(struct rpc_task *task, u32 *p)
+ {
+ struct rpc_auth *auth = task->tk_auth;
++ struct rpc_cred *cred = task->tk_msg.rpc_cred;
+
+ dprintk("RPC: %4d marshaling %s cred %p\n",
+- task->tk_pid, auth->au_ops->au_name, task->tk_msg.rpc_cred);
+- return auth->au_ops->crmarshal(task, p,
++ task->tk_pid, auth->au_ops->au_name, cred);
++ return cred->cr_ops->crmarshal(task, p,
+ task->tk_flags & RPC_CALL_REALUID);
+ }
+
+@@ -317,20 +334,22 @@
+ rpcauth_checkverf(struct rpc_task *task, u32 *p)
+ {
+ struct rpc_auth *auth = task->tk_auth;
++ struct rpc_cred *cred = task->tk_msg.rpc_cred;
+
+ dprintk("RPC: %4d validating %s cred %p\n",
+- task->tk_pid, auth->au_ops->au_name, task->tk_msg.rpc_cred);
+- return auth->au_ops->crvalidate(task, p);
++ task->tk_pid, auth->au_ops->au_name, cred);
++ return cred->cr_ops->crvalidate(task, p);
+ }
+
+ int
+ rpcauth_refreshcred(struct rpc_task *task)
+ {
+ struct rpc_auth *auth = task->tk_auth;
++ struct rpc_cred *cred = task->tk_msg.rpc_cred;
+
+ dprintk("RPC: %4d refreshing %s cred %p\n",
+- task->tk_pid, auth->au_ops->au_name, task->tk_msg.rpc_cred);
+- task->tk_status = auth->au_ops->crrefresh(task);
++ task->tk_pid, auth->au_ops->au_name, cred);
++ task->tk_status = cred->cr_ops->crrefresh(task);
+ return task->tk_status;
+ }
+
+diff -u --recursive --new-file linux-2.4.6-file/net/sunrpc/auth_null.c linux-2.4.6-mmap/net/sunrpc/auth_null.c
+--- linux-2.4.6-file/net/sunrpc/auth_null.c Fri Feb 9 20:29:44 2001
++++ linux-2.4.6-mmap/net/sunrpc/auth_null.c Wed Jul 4 19:27:38 2001
+@@ -17,6 +17,8 @@
+ # define RPCDBG_FACILITY RPCDBG_AUTH
+ #endif
+
++static struct rpc_credops null_credops;
++
+ static struct rpc_auth *
+ nul_create(struct rpc_clnt *clnt)
+ {
+@@ -52,9 +54,10 @@
+
+ if (!(cred = (struct rpc_cred *) rpc_allocate(flags, sizeof(*cred))))
+ return NULL;
+- cred->cr_count = 0;
++ atomic_set(&cred->cr_count, 0);
+ cred->cr_flags = RPCAUTH_CRED_UPTODATE;
+ cred->cr_uid = current->uid;
++ cred->cr_ops = &null_credops;
+
+ return cred;
+ }
+@@ -124,7 +127,11 @@
+ #endif
+ nul_create,
+ nul_destroy,
+- nul_create_cred,
++ nul_create_cred
++};
++
++static
++struct rpc_credops null_credops = {
+ nul_destroy_cred,
+ nul_match,
+ nul_marshal,
+diff -u --recursive --new-file linux-2.4.6-file/net/sunrpc/auth_unix.c linux-2.4.6-mmap/net/sunrpc/auth_unix.c
+--- linux-2.4.6-file/net/sunrpc/auth_unix.c Fri Feb 9 20:29:44 2001
++++ linux-2.4.6-mmap/net/sunrpc/auth_unix.c Wed Jul 4 19:29:07 2001
+@@ -33,6 +33,8 @@
+ # define RPCDBG_FACILITY RPCDBG_AUTH
+ #endif
+
++static struct rpc_credops unix_credops;
++
+ static struct rpc_auth *
+ unx_create(struct rpc_clnt *clnt)
+ {
+@@ -71,7 +73,7 @@
+ if (!(cred = (struct unx_cred *) rpc_allocate(flags, sizeof(*cred))))
+ return NULL;
+
+- cred->uc_count = 0;
++ atomic_set(&cred->uc_count, 0);
+ cred->uc_flags = RPCAUTH_CRED_UPTODATE;
+ if (flags & RPC_TASK_ROOTCREDS) {
+ cred->uc_uid = cred->uc_fsuid = 0;
+@@ -91,6 +93,7 @@
+ if (i < NFS_NGROUPS)
+ cred->uc_gids[i] = NOGROUP;
+ }
++ cred->uc_base.cr_ops = &unix_credops;
+
+ return (struct rpc_cred *) cred;
+ }
+@@ -106,7 +109,7 @@
+ if (!(cred = (struct unx_cred *) rpc_malloc(task, sizeof(*cred))))
+ return NULL;
+
+- cred->uc_count = 1;
++ atomic_set(&cred->uc_count, 1);
+ cred->uc_flags = RPCAUTH_CRED_DEAD|RPCAUTH_CRED_UPTODATE;
+ cred->uc_uid = uid;
+ cred->uc_gid = gid;
+@@ -236,7 +239,11 @@
+ #endif
+ unx_create,
+ unx_destroy,
+- unx_create_cred,
++ unx_create_cred
++};
++
++static
++struct rpc_credops unix_credops = {
+ unx_destroy_cred,
+ unx_match,
+ unx_marshal,
+diff -u --recursive --new-file linux-2.4.6-file/net/sunrpc/sunrpc_syms.c linux-2.4.6-mmap/net/sunrpc/sunrpc_syms.c
+--- linux-2.4.6-file/net/sunrpc/sunrpc_syms.c Fri Jan 12 00:53:02 2001
++++ linux-2.4.6-mmap/net/sunrpc/sunrpc_syms.c Wed Jul 4 20:55:19 2001
+@@ -65,7 +65,7 @@
+ EXPORT_SYMBOL(rpcauth_lookupcred);
+ EXPORT_SYMBOL(rpcauth_bindcred);
+ EXPORT_SYMBOL(rpcauth_matchcred);
+-EXPORT_SYMBOL(rpcauth_releasecred);
++EXPORT_SYMBOL(put_rpccred);
+
+ /* RPC server stuff */
+ EXPORT_SYMBOL(svc_create);
+
+_______________________________________________
+NFS maillist - NFS@lists.sourceforge.net
+http://lists.sourceforge.net/lists/listinfo/nfs
+
+
diff --git a/sys-kernel/linux-sources/files/2.4.6/lvm.c.diff b/sys-kernel/linux-sources/files/2.4.6/lvm.c.diff
new file mode 100644
index 000000000000..6392671b8f7e
--- /dev/null
+++ b/sys-kernel/linux-sources/files/2.4.6/lvm.c.diff
@@ -0,0 +1,20 @@
+--- lvm.c.orig Sat Apr 28 10:48:37 2001
++++ lvm.c Sat Apr 28 11:07:07 2001
+@@ -1791,7 +1791,7 @@
+ int max_hardblocksize = 0, hardblocksize;
+
+ for (le = 0; le < lv->lv_allocated_le; le++) {
+- hardblocksize = get_hardblocksize(lv->lv_current_pe[le].dev);
++ hardblocksize = get_hardsect_size(lv->lv_current_pe[le].dev);
+ if (hardblocksize == 0)
+ hardblocksize = 512;
+ if (hardblocksize > max_hardblocksize)
+@@ -1801,7 +1801,7 @@
+ if (lv->lv_access & LV_SNAPSHOT) {
+ for (e = 0; e < lv->lv_remap_end; e++) {
+ hardblocksize =
+- get_hardblocksize(
++ get_hardsect_size(
+ lv->lv_block_exception[e].rdev_new);
+ if (hardblocksize == 0)
+ hardblocksize = 512;
diff --git a/sys-kernel/linux-sources/files/digest-linux-sources-2.4.6 b/sys-kernel/linux-sources/files/digest-linux-sources-2.4.6
new file mode 100644
index 000000000000..7006f768da71
--- /dev/null
+++ b/sys-kernel/linux-sources/files/digest-linux-sources-2.4.6
@@ -0,0 +1,6 @@
+MD5 ff807499928379c4274a307855b9eeeb alsa-driver-0.5.11.tar.bz2
+MD5 3b04fb645ab68a081ab02079be937462 jfs-1.0.0-patch.tar.gz
+MD5 f0fce862f60daf4cb8d7c5b589d01158 linux-2.4.6.tar.bz2
+MD5 53740608812efa82532da2f980e6f974 lm_sensors-2.5.5.tar.gz
+MD5 1ce6fb607f26dc20d4c77461057acb3c lvm_0.9.1_beta7.tar.gz
+MD5 2603105aa14dd39fe841feb21c9a0f0a pcmcia-cs-3.1.26.tar.gz
diff --git a/sys-kernel/linux-sources/linux-sources-2.4.6.ebuild b/sys-kernel/linux-sources/linux-sources-2.4.6.ebuild
new file mode 100644
index 000000000000..5c62fce036ec
--- /dev/null
+++ b/sys-kernel/linux-sources/linux-sources-2.4.6.ebuild
@@ -0,0 +1,412 @@
+# Copyright 1999-2000 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# Author Daniel Robbins <drobbins@gentoo.org>
+# /home/cvsroot/gentoo-x86/sys-kernel/linux/linux-2.4.4.3.ebuild,v 1.1 2001/05/02 14:31:06 achim Exp
+
+#OKV=original kernel version, KV=patched kernel version
+OKV=2.4.6
+KV=2.4.6
+S=${WORKDIR}/linux-${KV}
+
+# Versions of LVM
+LVMV=0.9.1_beta7
+
+LVMVARC=0.9.1_beta7
+# Versions of alsa
+AV=0.5.11
+
+# Versionos of jfs
+JFSV=1.0.0
+
+# Versions of lm_sensors
+SENV=2.5.5
+
+# Versions of reiserfs
+RV=20010327
+KNV="6.g"
+PIV="1.d"
+
+# Versions of xmlprocfs
+XMLV=0.3
+
+# Versions of pcmcia-cs
+PCV="3.1.26"
+
+[ "${PN}" = "linux" ] && DESCRIPTION="Linux kernel version ${KV}, including modules, binary tools, libraries and includes"
+[ "${PN}" = "linux-sources" ] && DESCRIPTION="Linux kernel version ${KV} - full sources"
+[ "${PN}" = "linux-extras" ] && DESCRIPTION="Linux kernel support tools and libraries"
+
+# We use build in /usr/src/linux in case of linux-extras
+# so we need no sources
+if [ ! "${PN}" = "linux-extras" ] ; then
+SRC_URI="http://www.kernel.org/pub/linux/kernel/v2.4/linux-${OKV}.tar.bz2
+ http://www.netroedge.com/~lm78/archive/lm_sensors-${SENV}.tar.gz
+ ftp://ftp.sistina.com/pub/LVM/0.9.1_beta/lvm_${LVMVARC}.tar.gz
+ ftp://ftp.alsa-project.org/pub/driver/alsa-driver-${AV}.tar.bz2
+ http://prdownloads.sourceforge.net/pcmcia-cs/pcmcia-cs-${PCV}.tar.gz
+ http://oss.software.ibm.com/developerworks/opensource/jfs/project/pub/jfs-1.0.0-patch.tar.gz"
+fi
+
+if [ "$PN" != "linux-extras" ]
+then
+ PROVIDE="virtual/kernel"
+fi
+if [ "$PN" != "linux-sources" ]
+then
+ if [ "`use alsa`" ]
+ then
+ PROVIDE="$PROVIDE virtual/alsa"
+ fi
+fi
+
+HOMEPAGE="http://www.kernel.org/
+ http://www.netroedge.com/~lm78/
+ http://www.namesys.com
+ http://www.sistina.com/lvm/
+ http://www.alsa-project.org
+ http://pcmcia-cs.sourceforge.net"
+
+
+
+if [ ! $PN = "linux-extras" ] ; then
+ RDEPEND=">=sys-apps/e2fsutils-1.22 >=sys-apps/util-linux-2.11f >=sys-apps/reiserfs-utils-3.6.25-r1"
+ DEPEND=">=sys-apps/modutils-2.4.2 sys-devel/perl"
+else
+ DEPEND=">=sys-kernel/${PF/extras/sources}"
+fi
+if [ "`use build`" ] && [ $PN = "linux-sources" ] ; then
+ DEPEND=""
+ RDEPEND=""
+fi
+
+# this is not pretty...
+LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I${S}/include"
+
+src_unpack() {
+
+ # We only need to unpack for linux and linux-sources
+
+ if [ ! "$PN" = "linux-extras" ]
+ then
+
+ #unpack kernel and apply reiserfs-related patches
+ cd ${WORKDIR}
+ unpack linux-${OKV}.tar.bz2
+ try mv linux linux-${KV}
+ cd ${S}
+# echo "Applying ${KV} patch..."
+# try bzip2 -dc ${DISTDIR}/patch-${KV}.bz2 | patch -p1
+ echo "Applying reiserfs-NFS fix..."
+ try cat ${FILESDIR}/2.4.6/linux-2.4.6-reiserfs-NFS.patch | patch -N -p1
+
+ if [ "`use lvm`" ] || [ "`use alsa`" ] || [ "`use lm_sensors`" ] || [ "`use pcmcia-cs`" ]
+ then
+ mkdir ${S}/extras
+ fi
+ if [ "`use lvm`" ]
+ then
+ #create and apply LVM patch. The tools get built later.
+ cd ${S}/extras
+ echo "Unpacking and applying LVM patch..."
+ unpack lvm_${LVMVARC}.tar.gz
+ try cd LVM/${LVMV}
+
+ # I had to hack this in so that LVM will look in the current linux
+ # source directory instead of /usr/src/linux for stuff - pete
+ try CFLAGS=\""${CFLAGS} -I${S}/include"\" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${S}"
+ cd PATCHES
+ try make KERNEL_VERSION=${KV} KERNEL_DIR=${S}
+ cd ${S}
+ # the -l option allows this patch to apply cleanly (ignore whitespace changes)
+ try patch -l -p1 < ${S}/extras/LVM/${LVMV}/PATCHES/lvm-${LVMV}-${KV}.patch
+ cd ${S}/drivers/md
+ try patch -p0 < ${FILESDIR}/${KV}/lvm.c.diff
+ fi
+
+ if [ "`use alsa`" ]
+ then
+ #unpack alsa drivers
+ echo "Unpacking ALSA drivers..."
+ cd ${S}/extras
+ unpack alsa-driver-${AV}.tar.bz2
+ fi
+
+ if [ "`use lm_sensors`" ]
+ then
+ #unpack and apply the lm_sensors patch
+ echo "Unpacking and applying lm_sensors patch..."
+ cd ${S}/extras
+ unpack lm_sensors-${SENV}.tar.gz
+ try cd lm_sensors-${SENV}
+ try mkpatch/mkpatch.pl . ${S} > ${S}/lm_sensors-patch
+ try rmdir src
+ try ln -s ../.. src
+ try cp -a Makefile Makefile.orig
+
+ cd ${S}
+ try patch -p1 < lm_sensors-patch
+ fi
+ if [ "`use pcmcia-cs`" ]
+ then
+ echo "Unpacking pcmcia-cs tools..."
+ cd ${S}/extras
+ unpack pcmcia-cs-${PCV}.tar.gz
+ patch -p0 < ${FILESDIR}/${KV}/pcmcia-cs-${PCV}-gentoo.diff
+ fi
+
+ if [ "`use jfs`" ]
+ then
+ echo "Applying JFS patch..."
+ cd ${WORKDIR}
+ unpack jfs-${JFSV}-patch.tar.gz
+ cd ${S}
+ patch -p1 < ${WORKDIR}/jfs-common-v1.0.0-patch
+ patch -p1 < ${WORKDIR}/jfs-2.4.5-v1.0.0-patch
+ fi
+ #get sources ready for compilation or for sitting at /usr/src/linux
+ echo "Preparing for compilation..."
+ cd ${S}
+ #sometimes we have icky kernel symbols; this seems to get rid of them
+ try make mrproper
+
+ #linux-sources needs to be fully configured, too. Not just linux
+ if [ "${PN}" != "linux-extras" ]
+ then
+ #this is the configuration for the default kernel
+ try cp ${FILESDIR}/${KV}/config.bootcomp .config
+ try yes \"\" \| make oldconfig
+ echo "Ignore any errors from the yes command above."
+ fi
+
+ #fix silly permissions in tarball
+ cd ${WORKDIR}
+ chown -R 0.0 ${S}
+ chmod -R a+r-w+X,u+w ${S}
+
+ fi
+}
+
+src_compile() {
+
+ if [ "${PN}" != "linux-sources" ]
+ then
+ if [ $PN = "linux-extras" ]
+ then
+ KS=/usr/src/linux
+ else
+ KS=${S}
+ fi
+ if [ $PN = "linux" ]
+ then
+ try make symlinks
+ fi
+ if [ "`use lvm`" ]
+ then
+ #LVM tools are included in the linux and linux-extras pakcages
+ cd ${KS}/extras/LVM/${LVMV}
+
+ # This is needed for linux-extras
+ if [ -f "Makefile" ]
+ then
+ try make clean
+ fi
+ # I had to hack this in so that LVM will look in the current linux
+ # source directory instead of /usr/src/linux for stuff - pete
+ try CFLAGS=\""${CFLAGS} -I${KS}/include"\" ./configure --prefix=/ --mandir=/usr/share/man --with-kernel_dir="${KS}"
+ try make
+ fi
+
+ if [ "`use lm_sensors`" ]
+ then
+ cd ${KS}/extras/lm_sensors-${SENV}
+ try sed -e \"s:^LINUX=.*:LINUX=src:\" \
+ -e \"s/^COMPILE_KERNEL.*/COMPILE_KERNEL := 0/\" \
+ -e \"s:^I2C_HEADERS.*:I2C_HEADERS=src/include:\" \
+ -e \"s#^DESTDIR.*#DESTDIR := ${D}#\" \
+ -e \"s#^PREFIX.*#PREFIX := /usr#\" \
+ -e \"s#^MANDIR.*#MANDIR := /usr/share/man#\" \
+ Makefile.orig > Makefile
+
+ try make
+ fi
+
+ cd ${S}
+
+ if [ "`use jfs`" ]
+ then
+ cd ${S}/fs/jfs/utils
+ try make
+ cd output
+ into /
+ dosbin *
+ doman `find -iname *.8`
+ fi
+
+ if [ "$PN" == "linux" ]
+ then
+ try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" dep
+ try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" bzImage
+ #LEX=\""flex -l"\" bzImage
+ try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" modules
+ #LEX=\""flex -l"\" modules
+ fi
+
+ # This must come after the kernel compilation in linux
+ if [ "`use alsa`" ]
+ then
+ cd ${KS}/extras/alsa-driver-${AV}
+ # This is needed for linux-extras
+ if [ -f "Makefile.conf" ]
+ then
+ try make clean
+ fi
+ try ./configure --with-kernel=\"${KS}\" --with-isapnp=yes --with-sequencer=yes --with-oss=yes --with-cards=all
+ try make
+ fi
+ if [ "`use pcmcia-cs`" ]
+ then
+ cd ${KS}/extras/pcmcia-cs-${PCV}
+ # This is needed for linux-extras
+ if [ -f "Makefile" ]
+ then
+ try make clean
+ fi
+ try ./Configure -n --kernel=${KS} --moddir=/lib/modules/${KV} \
+ --notrust --cardbus --nopnp --noapm --srctree --sysv --rcdir=/etc/rc.d/
+ try make all
+ fi
+ else
+ #linux-sources
+ try make HOSTCFLAGS=\""${LINUX_HOSTCFLAGS}"\" dep
+ fi
+}
+
+src_install() {
+
+ if [ $PN = "linux-extras" ] ; then
+ KS=/usr/src/linux
+ else
+ KS=${S}
+ fi
+ # We install the alsa headers in all three packages
+ if [ "`use alsa`" ]
+ then
+ #i get alsa includes
+ cd ${KS}/extras/alsa-driver-${AV}
+ insinto /usr/src/linux-${KV}/include/linux
+ cd include
+ doins asound.h asoundid.h asequencer.h ainstr_*.h
+ fi
+
+ if [ ! "${PN}" = "linux-sources" ]
+ then
+ if [ $PN = "linux" ]
+ then
+ KS=${S}
+ else
+ KS=/usr/src/linux
+ fi
+ dodir /usr/lib
+
+ if [ "`use lvm`" ]
+ then
+ cd ${KS}/extras/LVM/${LVMV}/tools
+
+ try CFLAGS=\""${CFLAGS} -I${KS}/include"\" make install -e prefix=${D} mandir=${D}/usr/share/man \
+ sbindir=${D}/sbin libdir=${D}/lib
+ #no need for a static library in /lib
+ mv ${D}/lib/*.a ${D}/usr/lib
+ fi
+
+ if [ "`use lm_sensors`" ]
+ then
+ echo "Install sensor tools..."
+ #install sensors tools
+ cd ${KS}/extras/lm_sensors-${SENV}
+ make install
+ fi
+ if [ "${PN}" = "linux" ]
+ then
+ dodir /usr/src
+ dodir /usr/src/linux-${KV}
+ cd ${D}/usr/src
+ #grab includes and documentation only
+ echo ">>> Copying includes and documentation..."
+ cp -ax ${S}/include ${D}/usr/src/linux-${KV}
+ cp -ax ${S}/Documentation ${D}/usr/src/linux-${KV}
+
+ #grab compiled kernel
+ dodir /boot/boot
+ insinto /boot/boot
+ cd ${S}
+ doins arch/i386/boot/bzImage
+
+ #grab modules
+ # Do we have a bug in modutils ?
+ # Meanwhile we use this quick fix (achim)
+
+ install -d ${D}/lib/modules/`uname -r`
+ try make INSTALL_MOD_PATH=${D} modules_install
+
+ depmod -b ${D} -F ${S}/System.map ${KV}
+ #rm -rf ${D}/lib/modules/`uname -r`
+ #fix symlink
+ cd ${D}/lib/modules/${KV}
+ rm build
+ ln -sf /usr/src/linux-${KV} build
+ fi
+
+ if [ "`use alsa`" ]
+ then
+ #install ALSA modules
+ cd ${KS}/extras/alsa-driver-${AV}
+ dodoc INSTALL FAQ
+ dodir /lib/modules/${KV}/misc
+ cp modules/*.o ${D}/lib/modules/${KV}/misc
+ fi
+ if [ "`use pcmcia-cs`" ]
+ then
+ #install PCMCIA modules and utilities
+ cd ${KS}/extras/pcmcia-cs-${PCV}
+ try make PREFIX=${D} MANDIR=${D}/usr/share/man install
+ rm -rf ${D}/etc/rc.d
+ exeinto /etc/rc.d/init.d
+ doexe ${FILESDIR}/${KV}/pcmcia
+ fi
+ else
+ dodir /usr/src
+ cd ${S}
+ #make mrproper
+
+ if [ "`use build`" ] ; then
+ dodir /usr/src/linux-${KV}
+ #grab includes and documentation only
+ echo ">>> Copying includes..."
+ cp -ax ${S}/include ${D}/usr/src/linux-${KV}
+ else
+ echo ">>> Copying sources..."
+ cp -ax ${S} ${D}/usr/src
+ fi
+ fi
+ if [ "$PN" != "linux-extras" ]
+ then
+ #don't overwrite existing .config if present
+ cd ${D}/usr/src/linux-${KV}
+ if [ -e .config ]
+ then
+ cp -a .config .config.eg
+ fi
+ fi
+}
+
+pkg_postinst() {
+ rm -f ${ROOT}/usr/src/linux
+ ln -sf linux-${KV} ${ROOT}/usr/src/linux
+
+ #copy over our .config if one isn't already present
+ cd ${ROOT}/usr/src/linux-${KV}
+ if [ "${PN}" = "linux-sources" ] && [ -e .config.eg ] && [ ! -e .config ]
+ then
+ cp -a .config.eg .config
+ fi
+}