📄 fist-2.2.18.diff
字号:
diff -ruN linux-2.2.18-vanilla/fs/buffer.c linux-2.2.18-fist/fs/buffer.c--- linux-2.2.18-vanilla/fs/buffer.c Sun Dec 10 19:49:44 2000+++ linux-2.2.18-fist/fs/buffer.c Sun Jan 14 19:24:47 2001@@ -1156,23 +1156,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.18-vanilla/fs/namei.c linux-2.2.18-fist/fs/namei.c--- linux-2.2.18-vanilla/fs/namei.c Sun Dec 10 19:49:44 2000+++ linux-2.2.18-fist/fs/namei.c Sun Jan 14 19:24:47 2001@@ -16,6 +16,7 @@ #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>@@ -549,83 +550,6 @@ return -EEXIST; 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- * that the parent is still our parent and- * that we are still hashed onto it..- *- * This is requied in case two processes race- * on removing (or moving) the same entry: the- * parent lock will serialize them, but the- * other process will be too late..- */-#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.18-vanilla/fs/read_write.c linux-2.2.18-fist/fs/read_write.c--- linux-2.2.18-vanilla/fs/read_write.c Mon Sep 4 13:39:27 2000+++ linux-2.2.18-fist/fs/read_write.c Sun Jan 14 19:24:47 2001@@ -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.18-vanilla/include/linux/dcache_func.h linux-2.2.18-fist/include/linux/dcache_func.h--- linux-2.2.18-vanilla/include/linux/dcache_func.h Wed Dec 31 19:00:00 1969+++ linux-2.2.18-fist/include/linux/dcache_func.h Mon Jan 15 12:01:00 2001@@ -0,0 +1,91 @@+#ifndef __LINUX_DCACHE_FUNC_H+#define __LINUX_DCACHE_FUNC_H++/*+ * Common dentry functions for inclusion in the VFS+ * or in other stackable file systems. Some of these+ * functions were in linux/fs/ C (VFS) files.+ */+#ifdef __KERNEL__+#include <linux/dcache.h>+#include <asm/semaphore.h>++/*+ * We need to do a check-parent every time+ * after we have locked the parent - to verify+ * that the parent is still our parent and+ * that we are still hashed onto it..+ *+ * This is required in case two processes race+ * on removing (or moving) the same entry: the+ * parent lock will serialize them, but the+ * other process will be too late..+ */+#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;+}++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.18-vanilla/include/linux/fs.h linux-2.2.18-fist/include/linux/fs.h--- linux-2.2.18-vanilla/include/linux/fs.h Sun Dec 10 19:49:44 2000+++ linux-2.2.18-fist/include/linux/fs.h Mon Jan 15 12:00:16 2001@@ -906,6 +906,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.18-vanilla/include/linux/pagemap.h linux-2.2.18-fist/include/linux/pagemap.h--- linux-2.2.18-vanilla/include/linux/pagemap.h Sun Dec 10 19:49:44 2000+++ linux-2.2.18-fist/include/linux/pagemap.h Mon Jan 15 12:00:41 2001@@ -150,6 +150,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_conditional(struct inode *, unsigned long, const char *, int, unsigned long); extern void update_vm_cache(struct inode *, unsigned long, const char *, int); diff -ruN linux-2.2.18-vanilla/include/linux/swap.h linux-2.2.18-fist/include/linux/swap.h--- linux-2.2.18-vanilla/include/linux/swap.h Tue Jan 4 13:12:25 2000+++ linux-2.2.18-fist/include/linux/swap.h Mon Jan 15 11:59:54 2001@@ -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.18-vanilla/kernel/ksyms.c linux-2.2.18-fist/kernel/ksyms.c--- linux-2.2.18-vanilla/kernel/ksyms.c Sun Dec 10 19:49:44 2000+++ linux-2.2.18-fist/kernel/ksyms.c Mon Jan 15 12:25:24 2001@@ -210,6 +210,10 @@ EXPORT_SYMBOL(page_hash_bits); EXPORT_SYMBOL(__wait_on_page); +/* for stackable file systems (lofs, wrapfs, etc.) */+EXPORT_SYMBOL(default_llseek);+EXPORT_SYMBOL(swap_after_unlock_page);+ #if !defined(CONFIG_NFSD) && defined(CONFIG_NFSD_MODULE) EXPORT_SYMBOL(do_nfsservctl); #endifdiff -ruN linux-2.2.18-vanilla/mm/filemap.c linux-2.2.18-fist/mm/filemap.c--- linux-2.2.18-vanilla/mm/filemap.c Sun Dec 10 19:49:44 2000+++ linux-2.2.18-fist/mm/filemap.c Sun Jan 14 19:35:30 2001@@ -297,17 +297,6 @@ } -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,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -