?? fist-2.2.15.diff
字號:
+ 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.15-vanilla/include/linux/fs.h linux-2.2.15-fist/include/linux/fs.h--- linux-2.2.15-vanilla/include/linux/fs.h Tue Jan 4 13:12:24 2000+++ linux-2.2.15-fist/include/linux/fs.h Mon May 8 12:43:20 2000@@ -875,6 +875,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.15-vanilla/include/linux/mm.h linux-2.2.15-fist/include/linux/mm.h--- linux-2.2.15-vanilla/include/linux/mm.h Wed May 3 20:16:52 2000+++ linux-2.2.15-fist/include/linux/mm.h Wed May 10 16:56:48 2000@@ -56,7 +56,7 @@ struct vm_operations_struct * vm_ops; unsigned long vm_offset; struct file * vm_file;- unsigned long vm_pte; /* shared mem */+ void * vm_private_data; /* was vm_pte (shared mem) */ }; /*@@ -322,6 +322,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 vm_area_ops exported for stackable file systems */+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.15-vanilla/include/linux/pagemap.h linux-2.2.15-fist/include/linux/pagemap.h--- linux-2.2.15-vanilla/include/linux/pagemap.h Tue Jan 4 13:12:25 2000+++ linux-2.2.15-fist/include/linux/pagemap.h Wed May 10 16:56:49 2000@@ -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.15-vanilla/include/linux/swap.h linux-2.2.15-fist/include/linux/swap.h--- linux-2.2.15-vanilla/include/linux/swap.h Tue Jan 4 13:12:25 2000+++ linux-2.2.15-fist/include/linux/swap.h Mon May 8 12:43:26 2000@@ -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.15-vanilla/ipc/shm.c linux-2.2.15-fist/ipc/shm.c--- linux-2.2.15-vanilla/ipc/shm.c Wed May 3 20:16:53 2000+++ linux-2.2.15-fist/ipc/shm.c Mon May 8 12:30:49 2000@@ -363,7 +363,7 @@ * shmd->vm_next next attach for task * shmd->vm_next_share next attach for segment * shmd->vm_offset offset into segment- * shmd->vm_pte signature for this attach+ * shmd->vm_private_data signature for this attach */ static struct vm_operations_struct shm_vm_ops = {@@ -504,7 +504,7 @@ goto out; } - shmd->vm_pte = SWP_ENTRY(SHM_SWP_TYPE, id);+ shmd->vm_private_data = (void *) SWP_ENTRY(SHM_SWP_TYPE, id); shmd->vm_start = addr; shmd->vm_end = addr + shp->shm_npages * PAGE_SIZE; shmd->vm_mm = current->mm;@@ -543,7 +543,7 @@ unsigned int id; struct shmid_kernel *shp; - id = SWP_OFFSET(shmd->vm_pte) & SHM_ID_MASK;+ id = SWP_OFFSET((unsigned long) shmd->vm_private_data) & SHM_ID_MASK; shp = shm_segs[id]; if (shp == IPC_UNUSED) { printk("shm_open: unused id=%d PANIC\n", id);@@ -567,7 +567,7 @@ int id; /* remove from the list of attaches of the shm segment */- id = SWP_OFFSET(shmd->vm_pte) & SHM_ID_MASK;+ id = SWP_OFFSET((unsigned long) shmd->vm_private_data) & SHM_ID_MASK; shp = shm_segs[id]; remove_attach(shp,shmd); /* remove from shp->attaches */ shp->u.shm_lpid = current->pid;@@ -619,7 +619,7 @@ struct shmid_kernel *shp; unsigned int id, idx; - id = SWP_OFFSET(shmd->vm_pte) & SHM_ID_MASK;+ id = SWP_OFFSET((unsigned long) shmd->vm_private_data) & SHM_ID_MASK; idx = (address - shmd->vm_start + shmd->vm_offset) >> PAGE_SHIFT; #ifdef DEBUG_SHMdiff -ruN linux-2.2.15-vanilla/kernel/ksyms.c linux-2.2.15-fist/kernel/ksyms.c--- linux-2.2.15-vanilla/kernel/ksyms.c Wed May 3 20:16:53 2000+++ linux-2.2.15-fist/kernel/ksyms.c Wed May 10 20:32:53 2000@@ -197,6 +197,17 @@ EXPORT_SYMBOL(ROOT_DEV); EXPORT_SYMBOL(inode_generation_count); +/* for stackable file systems (lofs, wrapfs, etc.) */+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_mask);+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.15-vanilla/mm/filemap.c linux-2.2.15-fist/mm/filemap.c--- linux-2.2.15-vanilla/mm/filemap.c Wed May 3 20:16:53 2000+++ linux-2.2.15-fist/mm/filemap.c Mon May 8 12:30:49 2000@@ -272,17 +272,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,@@ -957,7 +946,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;@@ -1277,7 +1266,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;diff -ruN linux-2.2.15-vanilla/mm/mmap.c linux-2.2.15-fist/mm/mmap.c--- linux-2.2.15-vanilla/mm/mmap.c Tue Jan 4 13:12:26 2000+++ linux-2.2.15-fist/mm/mmap.c Mon May 8 12:30:50 2000@@ -281,7 +281,7 @@ vma->vm_ops = NULL; vma->vm_offset = off; vma->vm_file = NULL;- vma->vm_pte = 0;+ vma->vm_private_data = (void *) 0; /* Clear old maps */ error = -ENOMEM;@@ -532,7 +532,7 @@ mpnt->vm_ops = area->vm_ops; mpnt->vm_offset = area->vm_offset + (end - area->vm_start); mpnt->vm_file = area->vm_file;- mpnt->vm_pte = area->vm_pte;+ mpnt->vm_private_data = area->vm_private_data; if (mpnt->vm_file) mpnt->vm_file->f_count++; if (mpnt->vm_ops && mpnt->vm_ops->open)@@ -821,7 +821,7 @@ /* To share, we must have the same file, operations.. */ if ((mpnt->vm_file != prev->vm_file)||- (mpnt->vm_pte != prev->vm_pte) ||+ (mpnt->vm_private_data != prev->vm_private_data) || (mpnt->vm_ops != prev->vm_ops) || (mpnt->vm_flags != prev->vm_flags) || (prev->vm_end != mpnt->vm_start))
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -