?? fist-2.2.12.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.12-vanilla/include/linux/fs.h linux-2.2.12-fist/include/linux/fs.h--- linux-2.2.12-vanilla/include/linux/fs.h Wed Aug 25 20:29:52 1999+++ linux-2.2.12-fist/include/linux/fs.h Fri Aug 27 22:27:38 1999@@ -918,6 +918,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.12-vanilla/include/linux/mm.h linux-2.2.12-fist/include/linux/mm.h--- linux-2.2.12-vanilla/include/linux/mm.h Wed Aug 25 20:29:52 1999+++ linux-2.2.12-fist/include/linux/mm.h Fri Aug 27 22:27:39 1999@@ -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.12-vanilla/include/linux/pagemap.h linux-2.2.12-fist/include/linux/pagemap.h--- linux-2.2.12-vanilla/include/linux/pagemap.h Tue May 11 13:35:49 1999+++ linux-2.2.12-fist/include/linux/pagemap.h Fri Aug 27 22:27:45 1999@@ -148,6 +148,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.12-vanilla/include/linux/swap.h linux-2.2.12-fist/include/linux/swap.h--- linux-2.2.12-vanilla/include/linux/swap.h Tue May 11 13:35:43 1999+++ linux-2.2.12-fist/include/linux/swap.h Fri Aug 27 22:27:46 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.12-vanilla/ipc/shm.c linux-2.2.12-fist/ipc/shm.c--- linux-2.2.12-vanilla/ipc/shm.c Wed Aug 25 20:29:53 1999+++ linux-2.2.12-fist/ipc/shm.c Fri Aug 27 21:49:02 1999@@ -355,7 +355,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 = {@@ -496,7 +496,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;@@ -535,7 +535,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);@@ -559,7 +559,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;@@ -611,7 +611,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.12-vanilla/kernel/ksyms.c linux-2.2.12-fist/kernel/ksyms.c--- linux-2.2.12-vanilla/kernel/ksyms.c Mon Aug 9 15:04:41 1999+++ linux-2.2.12-fist/kernel/ksyms.c Fri Aug 27 21:49:02 1999@@ -189,6 +189,16 @@ EXPORT_SYMBOL(__pollwait); EXPORT_SYMBOL(ROOT_DEV); +/* 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_table);+EXPORT_SYMBOL(swap_after_unlock_page);+ #if !defined(CONFIG_NFSD) && defined(CONFIG_NFSD_MODULE) EXPORT_SYMBOL(do_nfsservctl); #endifdiff -ruN linux-2.2.12-vanilla/mm/filemap.c linux-2.2.12-fist/mm/filemap.c--- linux-2.2.12-vanilla/mm/filemap.c Tue May 11 11:51:13 1999+++ linux-2.2.12-fist/mm/filemap.c Fri Aug 27 21:49:02 1999@@ -242,17 +242,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,@@ -927,7 +916,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;@@ -1242,7 +1231,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.12-vanilla/mm/mmap.c linux-2.2.12-fist/mm/mmap.c--- linux-2.2.12-vanilla/mm/mmap.c Wed Aug 25 20:29:53 1999+++ linux-2.2.12-fist/mm/mmap.c Fri Aug 27 21:49:03 1999@@ -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;@@ -535,7 +535,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)@@ -824,7 +824,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))
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -