Commit e899b4be authored by David S. Miller's avatar David S. Miller

Merge nuts.davemloft.net:/disk1/BK/sparcwork-2.6

into nuts.davemloft.net:/disk1/BK/sparc-2.6
parents f158809e 5c053495
...@@ -1089,7 +1089,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, i ...@@ -1089,7 +1089,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, i
{ {
struct linux_dirent32 * dirent; struct linux_dirent32 * dirent;
struct getdents_callback32 * buf = (struct getdents_callback32 *) __buf; struct getdents_callback32 * buf = (struct getdents_callback32 *) __buf;
int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1); int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 2);
buf->error = -EINVAL; /* only used if we fail.. */ buf->error = -EINVAL; /* only used if we fail.. */
if (reclen > buf->count) if (reclen > buf->count)
...@@ -1103,6 +1103,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, i ...@@ -1103,6 +1103,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, i
put_user(reclen, &dirent->d_reclen); put_user(reclen, &dirent->d_reclen);
copy_to_user(dirent->d_name, name, namlen); copy_to_user(dirent->d_name, name, namlen);
put_user(0, dirent->d_name + namlen); put_user(0, dirent->d_name + namlen);
put_user(d_type, (char *) dirent + reclen - 1);
((char *) dirent) += reclen; ((char *) dirent) += reclen;
buf->current_dir = dirent; buf->current_dir = dirent;
buf->count -= reclen; buf->count -= reclen;
......
...@@ -38,11 +38,12 @@ static __inline__ void free_pgd_fast(pgd_t *pgd) ...@@ -38,11 +38,12 @@ static __inline__ void free_pgd_fast(pgd_t *pgd)
preempt_disable(); preempt_disable();
if (!page->lru.prev) { if (!page->lru.prev) {
(unsigned long *)page->lru.next = pgd_quicklist; page->lru.next = (void *) pgd_quicklist;
pgd_quicklist = (unsigned long *)page; pgd_quicklist = (unsigned long *)page;
} }
(unsigned long)page->lru.prev |= page->lru.prev = (void *)
(((unsigned long)pgd & (PAGE_SIZE / 2)) ? 2 : 1); (((unsigned long)page->lru.prev) |
(((unsigned long)pgd & (PAGE_SIZE / 2)) ? 2 : 1));
pgd_cache_size++; pgd_cache_size++;
preempt_enable(); preempt_enable();
} }
...@@ -62,7 +63,7 @@ static __inline__ pgd_t *get_pgd_fast(void) ...@@ -62,7 +63,7 @@ static __inline__ pgd_t *get_pgd_fast(void)
off = PAGE_SIZE / 2; off = PAGE_SIZE / 2;
mask &= ~2; mask &= ~2;
} }
(unsigned long)ret->lru.prev = mask; ret->lru.prev = (void *) mask;
if (!mask) if (!mask)
pgd_quicklist = (unsigned long *)ret->lru.next; pgd_quicklist = (unsigned long *)ret->lru.next;
ret = (struct page *)(__page_address(ret) + off); ret = (struct page *)(__page_address(ret) + off);
...@@ -76,10 +77,10 @@ static __inline__ pgd_t *get_pgd_fast(void) ...@@ -76,10 +77,10 @@ static __inline__ pgd_t *get_pgd_fast(void)
if (page) { if (page) {
ret = (struct page *)page_address(page); ret = (struct page *)page_address(page);
clear_page(ret); clear_page(ret);
(unsigned long)page->lru.prev = 2; page->lru.prev = (void *) 2UL;
preempt_disable(); preempt_disable();
(unsigned long *)page->lru.next = pgd_quicklist; page->lru.next = (void *) pgd_quicklist;
pgd_quicklist = (unsigned long *)page; pgd_quicklist = (unsigned long *)page;
pgd_cache_size++; pgd_cache_size++;
preempt_enable(); preempt_enable();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment