?? fist-2.2.3.diff
字號:
diff -ruN linux-2.2.3-vanilla/fs/buffer.c linux-2.2.3-fist/fs/buffer.c--- linux-2.2.3-vanilla/fs/buffer.c Fri Mar 5 19:19:34 1999+++ linux-2.2.3-fist/fs/buffer.c Mon Mar 8 22:24:10 1999@@ -1128,23 +1128,6 @@ goto try_again; } -/* Run the hooks that have to be done when a page I/O has completed. */-static inline void after_unlock_page (struct page * page)-{- if (test_and_clear_bit(PG_decr_after, &page->flags)) {- atomic_dec(&nr_async_pages);-#ifdef DEBUG_SWAP- printk ("DebugVM: Finished IO on page %p, nr_async_pages %d\n",- (char *) page_address(page), - atomic_read(&nr_async_pages));-#endif- }- if (test_and_clear_bit(PG_swap_unlock_after, &page->flags))- swap_after_unlock_page(page->offset);- if (test_and_clear_bit(PG_free_after, &page->flags))- __free_page(page);-}- /* * Free all temporary buffers belonging to a page. * This needs to be called with interrupts disabled.diff -ruN linux-2.2.3-vanilla/fs/namei.c linux-2.2.3-fist/fs/namei.c--- linux-2.2.3-vanilla/fs/namei.c Mon Jan 25 00:48:39 1999+++ linux-2.2.3-fist/fs/namei.c Mon Mar 8 22:24:10 1999@@ -16,25 +16,13 @@ #include <linux/proc_fs.h> #include <linux/smp_lock.h> #include <linux/quotaops.h>+#include <linux/dcache_func.h> #include <asm/uaccess.h> #include <asm/unaligned.h> #include <asm/semaphore.h> #include <asm/page.h> #include <asm/pgtable.h>--/*- * The bitmask for a lookup event:- * - follow links at the end- * - require a directory- * - ending slashes ok even for nonexistent files- * - internal "there are more path compnents" flag- */-#define LOOKUP_FOLLOW (1)-#define LOOKUP_DIRECTORY (2)-#define LOOKUP_SLASHOK (4)-#define LOOKUP_CONTINUE (8)- #include <asm/namei.h> /* This can be removed after the beta phase. */@@ -549,17 +537,6 @@ return permission(dir,MAY_WRITE | MAY_EXEC); } -static inline struct dentry *get_parent(struct dentry *dentry)-{- return dget(dentry->d_parent);-}--static inline void unlock_dir(struct dentry *dir)-{- up(&dir->d_inode->i_sem);- dput(dir);-}- /* * We need to do a check-parent every time * after we have locked the parent - to verify@@ -573,58 +550,6 @@ */ #define check_parent(dir, dentry) \ ((dir) == (dentry)->d_parent && !list_empty(&dentry->d_hash))--/*- * Locking the parent is needed to:- * - serialize directory operations- * - make sure the parent doesn't change from- * under us in the middle of an operation.- *- * NOTE! Right now we'd rather use a "struct inode"- * for this, but as I expect things to move toward- * using dentries instead for most things it is- * probably better to start with the conceptually- * better interface of relying on a path of dentries.- */-static inline struct dentry *lock_parent(struct dentry *dentry)-{- struct dentry *dir = dget(dentry->d_parent);-- down(&dir->d_inode->i_sem);- return dir;-}--/*- * Whee.. Deadlock country. Happily there are only two VFS- * operations that do this..- */-static inline void double_lock(struct dentry *d1, struct dentry *d2)-{- struct semaphore *s1 = &d1->d_inode->i_sem;- struct semaphore *s2 = &d2->d_inode->i_sem;-- if (s1 != s2) {- if ((unsigned long) s1 < (unsigned long) s2) {- struct semaphore *tmp = s2;- s2 = s1; s1 = tmp;- }- down(s1);- }- down(s2);-}--static inline void double_unlock(struct dentry *d1, struct dentry *d2)-{- struct semaphore *s1 = &d1->d_inode->i_sem;- struct semaphore *s2 = &d2->d_inode->i_sem;-- up(s1);- if (s1 != s2)- up(s2);- dput(d1);- dput(d2);-}- /* * Special case: O_CREAT|O_EXCL implies O_NOFOLLOW for securitydiff -ruN linux-2.2.3-vanilla/fs/read_write.c linux-2.2.3-fist/fs/read_write.c--- linux-2.2.3-vanilla/fs/read_write.c Sun Dec 27 13:52:09 1998+++ linux-2.2.3-fist/fs/read_write.c Mon Mar 8 22:24:10 1999@@ -13,7 +13,7 @@ #include <asm/uaccess.h> -static loff_t default_llseek(struct file *file, loff_t offset, int origin)+loff_t default_llseek(struct file *file, loff_t offset, int origin) { long long retval; diff -ruN linux-2.2.3-vanilla/include/linux/dcache_func.h linux-2.2.3-fist/include/linux/dcache_func.h--- linux-2.2.3-vanilla/include/linux/dcache_func.h Wed Dec 31 19:00:00 1969+++ linux-2.2.3-fist/include/linux/dcache_func.h Mon Mar 8 22:24:10 1999@@ -0,0 +1,72 @@+#ifndef __LINUX_DCACHE_FUNC_H+#define __LINUX_DCACHE_FUNC_H++#ifdef __KERNEL__+#include <linux/dcache.h>+#include <asm/semaphore.h>++/*+ * Locking the parent is needed to:+ * - serialize directory operations+ * - make sure the parent doesn't change from+ * under us in the middle of an operation.+ *+ * NOTE! Right now we'd rather use a "struct inode"+ * for this, but as I expect things to move toward+ * using dentries instead for most things it is+ * probably better to start with the conceptually+ * better interface of relying on a path of dentries.+ */+static inline struct dentry *lock_parent(struct dentry *dentry)+{+ struct dentry *dir = dget(dentry->d_parent);++ down(&dir->d_inode->i_sem);+ return dir;+}++static inline struct dentry *get_parent(struct dentry *dentry)+{+ return dget(dentry->d_parent);+}++static inline void unlock_dir(struct dentry *dir)+{+ up(&dir->d_inode->i_sem);+ dput(dir);+}++/*+ * Whee.. Deadlock country. Happily there is only one VFS+ * operation that does this..+ */+static inline void double_lock(struct dentry *d1, struct dentry *d2)+{+ struct semaphore *s1 = &d1->d_inode->i_sem;+ struct semaphore *s2 = &d2->d_inode->i_sem;++ if (s1 != s2) {+ if ((unsigned long) s1 < (unsigned long) s2) {+ struct semaphore *tmp = s2;+ s2 = s1; s1 = tmp;+ }+ down(s1);+ }+ down(s2);+}++static inline void double_unlock(struct dentry *d1, struct dentry *d2)+{+ struct semaphore *s1 = &d1->d_inode->i_sem;+ struct semaphore *s2 = &d2->d_inode->i_sem;++ up(s1);+ if (s1 != s2)+ up(s2);+ dput(d1);+ dput(d2);+}++#endif /* __KERNEL__ */++#endif /* __LINUX_DCACHE_FUNC_H */diff -ruN linux-2.2.3-vanilla/include/linux/fcntl.h linux-2.2.3-fist/include/linux/fcntl.h--- linux-2.2.3-vanilla/include/linux/fcntl.h Fri Oct 23 13:14:44 1998+++ linux-2.2.3-fist/include/linux/fcntl.h Mon Mar 8 22:24:10 1999@@ -3,4 +3,16 @@ #include <asm/fcntl.h> +/*+ * The bitmask for a lookup event:+ * - follow links at the end+ * - require a directory+ * - ending slashes ok even for nonexistent files+ * - internal "there are more path compnents" flag+ */+#define LOOKUP_FOLLOW (1)+#define LOOKUP_DIRECTORY (2)+#define LOOKUP_SLASHOK (4)+#define LOOKUP_CONTINUE (8)+ #endifdiff -ruN linux-2.2.3-vanilla/include/linux/fs.h linux-2.2.3-fist/include/linux/fs.h--- linux-2.2.3-vanilla/include/linux/fs.h Mon Mar 8 18:51:33 1999+++ linux-2.2.3-fist/include/linux/fs.h Mon Mar 8 22:24:10 1999@@ -853,6 +853,7 @@ extern int generic_file_mmap(struct file *, struct vm_area_struct *); extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *); extern ssize_t generic_file_write(struct file *, const char*, size_t, loff_t*);+extern loff_t default_llseek(struct file *file, loff_t offset, int origin); extern struct super_block *get_super(kdev_t dev); extern void put_super(kdev_t dev);diff -ruN linux-2.2.3-vanilla/include/linux/mm.h linux-2.2.3-fist/include/linux/mm.h--- linux-2.2.3-vanilla/include/linux/mm.h Mon Mar 8 18:51:40 1999+++ linux-2.2.3-fist/include/linux/mm.h Mon Mar 8 22:24:10 1999@@ -57,6 +57,7 @@ unsigned long vm_offset; struct file * vm_file; unsigned long vm_pte; /* shared mem */+ void * vm_private_data; }; /*@@ -322,6 +323,14 @@ extern void truncate_inode_pages(struct inode *, unsigned long); extern unsigned long get_cached_page(struct inode *, unsigned long, int); extern void put_cached_page(unsigned long);+/* generic vmarea_ops exported for the benefit of stacked fs's */+extern int filemap_swapout(struct vm_area_struct * vma, struct page * page);+extern pte_t filemap_swapin(struct vm_area_struct * vma,+ unsigned long offset, unsigned long entry);+extern int filemap_sync(struct vm_area_struct * vma, unsigned long address,+ size_t size, unsigned int flags);+extern unsigned long filemap_nopage(struct vm_area_struct * area,+ unsigned long address, int no_share); /* * GFP bitmasks..diff -ruN linux-2.2.3-vanilla/include/linux/pagemap.h linux-2.2.3-fist/include/linux/pagemap.h--- linux-2.2.3-vanilla/include/linux/pagemap.h Mon Mar 8 18:51:46 1999+++ linux-2.2.3-fist/include/linux/pagemap.h Mon Mar 8 22:24:10 1999@@ -129,6 +129,17 @@ __wait_on_page(page); } +static inline void add_to_page_cache(struct page * page,+ struct inode * inode, unsigned long offset,+ struct page **hash)+{+ atomic_inc(&page->count);+ page->flags = (page->flags & ~((1 << PG_uptodate) | (1 << PG_error))) | (1 << PG_referenced);+ page->offset = offset;+ add_page_to_inode_queue(inode, page);+ __add_page_to_hash_queue(page, hash);+}+ extern void update_vm_cache(struct inode *, unsigned long, const char *, int); #endifdiff -ruN linux-2.2.3-vanilla/include/linux/swap.h linux-2.2.3-fist/include/linux/swap.h--- linux-2.2.3-vanilla/include/linux/swap.h Mon Mar 8 18:51:32 1999+++ linux-2.2.3-fist/include/linux/swap.h Mon Mar 8 22:24:11 1999@@ -170,6 +170,23 @@ return count > 1; } +/* Run the hooks that have to be done when a page I/O has completed. */+static inline void after_unlock_page (struct page * page)+{+ if (test_and_clear_bit(PG_decr_after, &page->flags)) {+ atomic_dec(&nr_async_pages);+#ifdef DEBUG_SWAP+ printk ("DebugVM: Finished IO on page %p, nr_async_pages %d\n",+ (char *) page_address(page), + atomic_read(&nr_async_pages));+#endif+ }+ if (test_and_clear_bit(PG_swap_unlock_after, &page->flags))+ swap_after_unlock_page(page->offset);+ if (test_and_clear_bit(PG_free_after, &page->flags))+ __free_page(page);+}+ #endif /* __KERNEL__*/ #endif /* _LINUX_SWAP_H */diff -ruN linux-2.2.3-vanilla/kernel/ksyms.c linux-2.2.3-fist/kernel/ksyms.c--- linux-2.2.3-vanilla/kernel/ksyms.c Thu Feb 18 13:44:10 1999+++ linux-2.2.3-fist/kernel/ksyms.c Mon Mar 8 22:24:11 1999@@ -184,6 +184,16 @@ EXPORT_SYMBOL(vfs_rename); EXPORT_SYMBOL(__pollwait); +/* for stackable file systems (wrapfs) */+EXPORT_SYMBOL(__wait_on_page);+EXPORT_SYMBOL(default_llseek);+EXPORT_SYMBOL(filemap_nopage);+EXPORT_SYMBOL(filemap_swapout);+EXPORT_SYMBOL(filemap_sync);+EXPORT_SYMBOL(page_cache_size);+EXPORT_SYMBOL(page_hash_table);+EXPORT_SYMBOL(swap_after_unlock_page);+ #if !defined(CONFIG_NFSD) && defined(CONFIG_NFSD_MODULE) EXPORT_SYMBOL(do_nfsservctl); #endifdiff -ruN linux-2.2.3-vanilla/mm/filemap.c linux-2.2.3-fist/mm/filemap.c--- linux-2.2.3-vanilla/mm/filemap.c Sun Mar 7 13:35:18 1999+++ linux-2.2.3-fist/mm/filemap.c Mon Mar 8 22:24:11 1999@@ -248,17 +248,6 @@ } while (count); } -static inline void add_to_page_cache(struct page * page,- struct inode * inode, unsigned long offset,- struct page **hash)-{- atomic_inc(&page->count);- page->flags = (page->flags & ~((1 << PG_uptodate) | (1 << PG_error))) | (1 << PG_referenced);- page->offset = offset;- add_page_to_inode_queue(inode, page);- __add_page_to_hash_queue(page, hash);-}- /* * Try to read ahead in the file. "page_cache" is a potentially free page * that we could use for the cache (if it is 0 we can try to create one,@@ -933,7 +922,7 @@ * WSH 06/04/97: fixed a memory leak and moved the allocation of new_page * ahead of the wait if we're sure to need it. */-static unsigned long filemap_nopage(struct vm_area_struct * area, unsigned long address, int no_share)+unsigned long filemap_nopage(struct vm_area_struct * area, unsigned long address, int no_share) { struct file * file = area->vm_file; struct dentry * dentry = file->f_dentry;@@ -1248,7 +1237,7 @@ return error; } -static int filemap_sync(struct vm_area_struct * vma, unsigned long address,+int filemap_sync(struct vm_area_struct * vma, unsigned long address, size_t size, unsigned int flags) { pgd_t * dir;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -