From a78b3fc6e8b9f04a8b89288c3dfa3897ee46433e Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 27 Apr 2006 08:44:27 +0200 Subject: [PATCH] --- yaml --- r: 26221 b: refs/heads/master c: eb645a24de82496434cc81171d7f350edb327399 h: refs/heads/master i: 26219: 2612353dd8bef5b7027a1d92e3f03edb7163d0a0 v: v3 --- [refs] | 2 +- trunk/fs/splice.c | 4 ++-- trunk/include/asm-i386/pgtable-2level.h | 3 --- trunk/include/asm-i386/pgtable-3level.h | 20 -------------------- trunk/include/asm-i386/pgtable.h | 4 +++- 5 files changed, 6 insertions(+), 27 deletions(-) diff --git a/[refs] b/[refs] index fa9570fe3bf6..3970cfba6593 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6e5882cfa24e1456702e463f6920fc0ca3c3d2b8 +refs/heads/master: eb645a24de82496434cc81171d7f350edb327399 diff --git a/trunk/fs/splice.c b/trunk/fs/splice.c index 447ebc0a37f3..dc205f643090 100644 --- a/trunk/fs/splice.c +++ b/trunk/fs/splice.c @@ -299,8 +299,8 @@ __generic_file_splice_read(struct file *in, loff_t *ppos, * read-ahead if this is a non-zero offset (we are likely doing small * chunk splice and the page is already there) for a single page. */ - if (!loff || spd.nr_pages > 1) - do_page_cache_readahead(mapping, in, index, spd.nr_pages); + if (!loff || nr_pages > 1) + page_cache_readahead(mapping, &in->f_ra, in, index, nr_pages); /* * Now fill in the holes: diff --git a/trunk/include/asm-i386/pgtable-2level.h b/trunk/include/asm-i386/pgtable-2level.h index 2756d4b04c27..27bde973abc7 100644 --- a/trunk/include/asm-i386/pgtable-2level.h +++ b/trunk/include/asm-i386/pgtable-2level.h @@ -18,9 +18,6 @@ #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval) #define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval)) -#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0) -#define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0) - #define ptep_get_and_clear(mm,addr,xp) __pte(xchg(&(xp)->pte_low, 0)) #define pte_same(a, b) ((a).pte_low == (b).pte_low) #define pte_page(x) pfn_to_page(pte_pfn(x)) diff --git a/trunk/include/asm-i386/pgtable-3level.h b/trunk/include/asm-i386/pgtable-3level.h index dccb1b3337ad..36a5aa63cbbf 100644 --- a/trunk/include/asm-i386/pgtable-3level.h +++ b/trunk/include/asm-i386/pgtable-3level.h @@ -85,26 +85,6 @@ static inline void pud_clear (pud_t * pud) { } #define pmd_offset(pud, address) ((pmd_t *) pud_page(*(pud)) + \ pmd_index(address)) -/* - * For PTEs and PDEs, we must clear the P-bit first when clearing a page table - * entry, so clear the bottom half first and enforce ordering with a compiler - * barrier. - */ -static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) -{ - ptep->pte_low = 0; - smp_wmb(); - ptep->pte_high = 0; -} - -static inline void pmd_clear(pmd_t *pmd) -{ - u32 *tmp = (u32 *)pmd; - *tmp = 0; - smp_wmb(); - *(tmp + 1) = 0; -} - static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { pte_t res; diff --git a/trunk/include/asm-i386/pgtable.h b/trunk/include/asm-i386/pgtable.h index 672c3f76b9df..ee056c41a9fb 100644 --- a/trunk/include/asm-i386/pgtable.h +++ b/trunk/include/asm-i386/pgtable.h @@ -204,10 +204,12 @@ extern unsigned long long __PAGE_KERNEL, __PAGE_KERNEL_EXEC; extern unsigned long pg0[]; #define pte_present(x) ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE)) +#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0) /* To avoid harmful races, pmd_none(x) should check only the lower when PAE */ #define pmd_none(x) (!(unsigned long)pmd_val(x)) #define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT) +#define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0) #define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) @@ -266,7 +268,7 @@ static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long pte_t pte; if (full) { pte = *ptep; - pte_clear(mm, addr, ptep); + *ptep = __pte(0); } else { pte = ptep_get_and_clear(mm, addr, ptep); }