summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-08-08 19:25:53 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-08-08 19:25:53 +0000
commit57445428488a2862840c4d7c96d7746c11031aaf (patch)
tree60b88b3a21896a33ee4dccc727d88b745a9ff731 /fs
parent2e837819b1563679b55363d469239fdf4f17fbbb (diff)
Merge with Linu 2.4.0-test6-pre6.
Diffstat (limited to 'fs')
-rw-r--r--fs/Makefile3
-rw-r--r--fs/buffer.c16
-rw-r--r--fs/cramfs/inode.c5
-rw-r--r--fs/exec.c1
-rw-r--r--fs/ext2/balloc.c13
-rw-r--r--fs/jffs/inode-v23.c9
-rw-r--r--fs/ncpfs/mmap.c1
-rw-r--r--fs/nfs/read.c2
-rw-r--r--fs/nls/Makefile2
-rw-r--r--fs/ramfs/inode.c4
-rw-r--r--fs/romfs/inode.c11
-rw-r--r--fs/smbfs/file.c7
-rw-r--r--fs/udf/file.c3
-rw-r--r--fs/udf/inode.c1
-rw-r--r--fs/umsdos/emd.c8
-rw-r--r--fs/umsdos/inode.c2
16 files changed, 47 insertions, 41 deletions
diff --git a/fs/Makefile b/fs/Makefile
index 7573a7f95..4e67ec808 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -15,8 +15,7 @@ O_OBJS = open.o read_write.o devices.o file_table.o buffer.o \
dcache.o inode.o attr.o bad_inode.o file.o iobuf.o \
$(BINFMTS) $(FILESYSTEMS)
-MOD_LIST_NAME := FS_MODULES
-ALL_SUB_DIRS = coda minix ext2 fat msdos vfat proc isofs nfs umsdos ntfs \
+ALL_SUB_DIRS := coda minix ext2 fat msdos vfat proc isofs nfs umsdos ntfs \
hpfs sysv smbfs ncpfs ufs efs affs romfs autofs hfs lockd \
nfsd nls devpts devfs adfs partitions qnx4 udf bfs cramfs \
openpromfs autofs4 ramfs jffs
diff --git a/fs/buffer.c b/fs/buffer.c
index e6134c203..b296dad7b 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1149,7 +1149,7 @@ void set_bh_page (struct buffer_head *bh, struct page *page, unsigned long offse
*/
bh->b_data = (char *)(0 + offset);
else
- bh->b_data = (char *)(page_address(page) + offset);
+ bh->b_data = page_address(page) + offset;
}
/*
@@ -1475,6 +1475,8 @@ static int __block_prepare_write(struct inode *inode, struct page *page,
memset(kaddr+to, 0, block_end-to);
if (block_start < from)
memset(kaddr+block_start, 0, from-block_start);
+ if (block_end > to || block_start < from)
+ flush_dcache_page(page);
continue;
}
}
@@ -1578,6 +1580,7 @@ int block_read_full_page(struct page *page, get_block_t *get_block)
if (!kaddr)
kaddr = kmap(page);
memset((char *)(kaddr + i*blocksize), 0, blocksize);
+ flush_dcache_page(page);
set_bit(BH_Uptodate, &bh->b_state);
continue;
}
@@ -1642,8 +1645,9 @@ int cont_prepare_write(struct page *page, unsigned offset, unsigned to, get_bloc
PAGE_CACHE_SIZE, get_block);
if (status)
goto out_unmap;
- kaddr = (char*)page_address(new_page);
+ kaddr = page_address(new_page);
memset(kaddr+zerofrom, 0, PAGE_CACHE_SIZE-zerofrom);
+ flush_dcache_page(new_page);
__block_commit_write(inode, new_page, zerofrom, PAGE_CACHE_SIZE);
kunmap(new_page);
UnlockPage(new_page);
@@ -1670,9 +1674,10 @@ int cont_prepare_write(struct page *page, unsigned offset, unsigned to, get_bloc
status = __block_prepare_write(inode, page, zerofrom, to, get_block);
if (status)
goto out1;
- kaddr = (char*)page_address(page);
+ kaddr = page_address(page);
if (zerofrom < offset) {
memset(kaddr+zerofrom, 0, offset-zerofrom);
+ flush_dcache_page(page);
__block_commit_write(inode, page, zerofrom, offset);
}
return 0;
@@ -1733,7 +1738,8 @@ int block_write_full_page(struct page *page, get_block_t *get_block)
/* Sigh... will have to work, then... */
err = __block_prepare_write(inode, page, 0, offset, get_block);
if (!err) {
- memset((char *)page_address(page)+offset, 0, PAGE_CACHE_SIZE-offset);
+ memset(page_address(page) + offset, 0, PAGE_CACHE_SIZE - offset);
+ flush_dcache_page(page);
__block_commit_write(inode,page,0,offset);
done:
kunmap(page);
@@ -2035,7 +2041,7 @@ int block_symlink(struct inode *inode, const char *symname, int len)
err = mapping->a_ops->prepare_write(NULL, page, 0, len-1);
if (err)
goto fail_map;
- kaddr = (char*)page_address(page);
+ kaddr = page_address(page);
memcpy(kaddr, symname, len-1);
mapping->a_ops->commit_write(NULL, page, 0, len-1);
/*
diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c
index 3f51c2aa1..8b0a91426 100644
--- a/fs/cramfs/inode.c
+++ b/fs/cramfs/inode.c
@@ -328,12 +328,13 @@ static int cramfs_readpage(struct file *file, struct page * page)
if (compr_len == 0)
; /* hole */
else
- bytes_filled = cramfs_uncompress_block((void *) page_address(page),
+ bytes_filled = cramfs_uncompress_block(page_address(page),
PAGE_CACHE_SIZE,
cramfs_read(sb, start_offset, compr_len),
compr_len);
}
- memset((void *) (page_address(page) + bytes_filled), 0, PAGE_CACHE_SIZE - bytes_filled);
+ memset(page_address(page) + bytes_filled, 0, PAGE_CACHE_SIZE - bytes_filled);
+ flush_dcache_page(page);
SetPageUptodate(page);
UnlockPage(page);
return 0;
diff --git a/fs/exec.c b/fs/exec.c
index d162f8852..93aae1c7f 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -223,6 +223,7 @@ int copy_strings(int argc,char ** argv, struct linux_binprm *bprm)
memset(kaddr+offset+len, 0, PAGE_SIZE-offset-len);
}
err = copy_from_user(kaddr + offset, str, bytes_to_copy);
+ flush_dcache_page(page);
flush_page_to_ram(page);
kunmap(page);
diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c
index 8ca28e0a0..831aa67e9 100644
--- a/fs/ext2/balloc.c
+++ b/fs/ext2/balloc.c
@@ -540,23 +540,14 @@ got_block:
* Do block preallocation now if required.
*/
#ifdef EXT2_PREALLOCATE
- if (prealloc_block) {
+ /* Writer: ->i_prealloc* */
+ if (prealloc_count && !*prealloc_count) {
int prealloc_goal;
unsigned long next_block = tmp + 1;
prealloc_goal = es->s_prealloc_blocks ?
es->s_prealloc_blocks : EXT2_DEFAULT_PREALLOC_BLOCKS;
- /* Writer: ->i_prealloc* */
- /*
- * Can't happen right now, will need handling if we go for
- * per-group spinlocks. Handling == skipping preallocation if
- * condition below will be true. For now there is no legitimate
- * way it could happen, thus the BUG().
- */
- if (*prealloc_count)
- BUG();
- *prealloc_count = 0;
*prealloc_block = next_block;
/* Writer: end */
for (k = 1;
diff --git a/fs/jffs/inode-v23.c b/fs/jffs/inode-v23.c
index b1973918d..06ac42709 100644
--- a/fs/jffs/inode-v23.c
+++ b/fs/jffs/inode-v23.c
@@ -623,7 +623,7 @@ jffs_lookup_end:
static int
jffs_readpage(struct file *file, struct page *page)
{
- unsigned long buf;
+ void *buf;
unsigned long read_len;
int result = -EIO;
struct inode *inode = (struct inode*)page->mapping->host;
@@ -643,10 +643,10 @@ jffs_readpage(struct file *file, struct page *page)
offset = page->index << PAGE_CACHE_SHIFT;
if (offset < inode->i_size) {
read_len = jffs_min(inode->i_size - offset, PAGE_SIZE);
- r = jffs_read_data(f, (char *)buf, offset, read_len);
+ r = jffs_read_data(f, buf, offset, read_len);
if (r == read_len) {
if (read_len < PAGE_SIZE) {
- memset((void *)(buf + read_len), 0,
+ memset(buf + read_len, 0,
PAGE_SIZE - read_len);
}
SetPageUptodate(page);
@@ -659,9 +659,10 @@ jffs_readpage(struct file *file, struct page *page)
});
}
if (result) {
- memset((void *)buf, 0, PAGE_SIZE);
+ memset(buf, 0, PAGE_SIZE);
SetPageError(page);
}
+ flush_dcache_page(page);
UnlockPage(page);
diff --git a/fs/ncpfs/mmap.c b/fs/ncpfs/mmap.c
index 08d28d895..041dd0785 100644
--- a/fs/ncpfs/mmap.c
+++ b/fs/ncpfs/mmap.c
@@ -89,6 +89,7 @@ static struct page* ncp_file_mmap_nopage(struct vm_area_struct *area,
if (already_read < PAGE_SIZE)
memset((char*)(pg_addr + already_read), 0,
PAGE_SIZE - already_read);
+ flush_dcache_page(page);
kunmap(page);
return page;
}
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index e51adbd86..6575040d9 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -134,6 +134,7 @@ nfs_readpage_sync(struct file *file, struct page *page)
} while (count);
memset(buffer, 0, count);
+ flush_dcache_page(page);
SetPageUptodate(page);
if (PageError(page))
ClearPageError(page);
@@ -446,6 +447,7 @@ nfs_readpage_result(struct rpc_task *task)
count -= PAGE_CACHE_SIZE;
} else
SetPageError(page);
+ flush_dcache_page(page);
kunmap(page);
UnlockPage(page);
diff --git a/fs/nls/Makefile b/fs/nls/Makefile
index 8ffa8e67b..893d3e1e9 100644
--- a/fs/nls/Makefile
+++ b/fs/nls/Makefile
@@ -2,8 +2,6 @@
# Makefile for native language support
#
-MOD_LIST_NAME := NLS_MODULES
-
obj-y := nls_base.o
obj-m :=
obj-n :=
diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
index 22833d064..dc424b72e 100644
--- a/fs/ramfs/inode.c
+++ b/fs/ramfs/inode.c
@@ -65,7 +65,8 @@ static struct dentry * ramfs_lookup(struct inode *dir, struct dentry *dentry)
static int ramfs_readpage(struct file *file, struct page * page)
{
if (!Page_Uptodate(page)) {
- memset((void *) page_address(page), 0, PAGE_CACHE_SIZE);
+ memset(page_address(page), 0, PAGE_CACHE_SIZE);
+ flush_dcache_page(page);
SetPageUptodate(page);
}
UnlockPage(page);
@@ -89,6 +90,7 @@ static int ramfs_prepare_write(struct file *file, struct page *page, unsigned of
addr = (void *) kmap(page);
if (!Page_Uptodate(page)) {
memset(addr, 0, PAGE_CACHE_SIZE);
+ flush_dcache_page(page);
SetPageUptodate(page);
}
SetPageDirty(page);
diff --git a/fs/romfs/inode.c b/fs/romfs/inode.c
index 47665f936..8d01f17ba 100644
--- a/fs/romfs/inode.c
+++ b/fs/romfs/inode.c
@@ -391,8 +391,8 @@ static int
romfs_readpage(struct file *file, struct page * page)
{
struct inode *inode = (struct inode*)page->mapping->host;
- unsigned long buf;
unsigned long offset, avail, readlen;
+ void *buf;
int result = -EIO;
lock_kernel();
@@ -404,22 +404,23 @@ romfs_readpage(struct file *file, struct page * page)
if (offset < inode->i_size) {
avail = inode->i_size-offset;
readlen = min(avail, PAGE_SIZE);
- if (romfs_copyfrom(inode, (void *)buf, inode->u.romfs_i.i_dataoffset+offset, readlen) == readlen) {
+ if (romfs_copyfrom(inode, buf, inode->u.romfs_i.i_dataoffset+offset, readlen) == readlen) {
if (readlen < PAGE_SIZE) {
- memset((void *)(buf+readlen),0,PAGE_SIZE-readlen);
+ memset(buf + readlen,0,PAGE_SIZE-readlen);
}
SetPageUptodate(page);
result = 0;
}
}
if (result) {
- memset((void *)buf, 0, PAGE_SIZE);
+ memset(buf, 0, PAGE_SIZE);
SetPageError(page);
}
+ flush_dcache_page(page);
UnlockPage(page);
- free_page(buf);
+ __free_page(page);
unlock_kernel();
return result;
diff --git a/fs/smbfs/file.c b/fs/smbfs/file.c
index ec709e3e3..135e8707c 100644
--- a/fs/smbfs/file.c
+++ b/fs/smbfs/file.c
@@ -38,7 +38,7 @@ smb_fsync(struct file *file, struct dentry * dentry, int datasync)
static int
smb_readpage_sync(struct dentry *dentry, struct page *page)
{
- char *buffer = (char *) page_address(page);
+ char *buffer = page_address(page);
unsigned long offset = page->index << PAGE_CACHE_SHIFT;
int rsize = smb_get_rsize(server_from_dentry(dentry));
int count = PAGE_SIZE;
@@ -72,6 +72,7 @@ smb_readpage_sync(struct dentry *dentry, struct page *page)
} while (count);
memset(buffer, 0, count);
+ flush_dcache_page(page);
SetPageUptodate(page);
result = 0;
@@ -89,7 +90,7 @@ smb_readpage(struct file *file, struct page *page)
int error;
struct dentry *dentry = file->f_dentry;
- DEBUG1("readpage %08lx\n", page_address(page));
+ DEBUG1("readpage %p\n", page_address(page));
get_page(page);
error = smb_readpage_sync(dentry, page);
@@ -106,7 +107,7 @@ smb_writepage_sync(struct dentry *dentry, struct page *page,
unsigned long offset, unsigned int count)
{
struct inode *inode = dentry->d_inode;
- u8 *buffer = (u8 *) page_address(page) + offset;
+ u8 *buffer = page_address(page) + offset;
int wsize = smb_get_wsize(server_from_dentry(dentry));
int result, written = 0;
diff --git a/fs/udf/file.c b/fs/udf/file.c
index 662647088..0b3dce0d1 100644
--- a/fs/udf/file.c
+++ b/fs/udf/file.c
@@ -60,6 +60,7 @@ static int udf_adinicb_readpage(struct file *file, struct page * page)
bh = bread (inode->i_dev, block, inode->i_sb->s_blocksize);
memcpy(kaddr, bh->b_data + udf_ext0_offset(inode), inode->i_size);
brelse(bh);
+ flush_dcache_page(page);
SetPageUptodate(page);
kunmap(page);
UnlockPage(page);
@@ -100,7 +101,7 @@ static int udf_adinicb_commit_write(struct file *file, struct page *page, unsign
struct buffer_head *bh;
int block;
- char *kaddr = (char*)page_address(page);
+ char *kaddr = page_address(page);
block = udf_get_lb_pblock(inode->i_sb, UDF_I_LOCATION(inode), 0);
bh = bread (inode->i_dev, block, inode->i_sb->s_blocksize);
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index bbc4e30a5..e7e6c53e8 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -188,6 +188,7 @@ void udf_expand_file_adinicb(struct inode * inode, int newsize, int * err)
PAGE_CACHE_SIZE - UDF_I_LENALLOC(inode));
memcpy((char *)kaddr, bh->b_data + udf_file_entry_alloc_offset(inode),
UDF_I_LENALLOC(inode));
+ flush_dcache_page(page);
SetPageUptodate(page);
kunmap(page);
}
diff --git a/fs/umsdos/emd.c b/fs/umsdos/emd.c
index 9e4ace724..a8de0def8 100644
--- a/fs/umsdos/emd.c
+++ b/fs/umsdos/emd.c
@@ -142,7 +142,7 @@ int umsdos_emd_dir_readentry (struct dentry *demd, loff_t *pos, struct umsdos_di
recsize = umsdos_evalrecsize(p->name_len);
if (offs + recsize > PAGE_CACHE_SIZE) {
struct page *page2;
- int part = ((char*)page_address(page)+PAGE_CACHE_SIZE)-p->spare;
+ int part = (page_address(page) + PAGE_CACHE_SIZE) - p->spare;
page2 = read_cache_page(mapping, 1+(*pos>>PAGE_CACHE_SHIFT),
(filler_t*)mapping->a_ops->readpage, NULL);
if (IS_ERR(page2)) {
@@ -236,7 +236,7 @@ int umsdos_writeentry (struct dentry *parent, struct umsdos_info *info,
page = grab_cache_page(mapping, info->f_pos>>PAGE_CACHE_SHIFT);
if (!page)
goto out_dput;
- p = (struct umsdos_dirent*)((char*)page_address(page)+offs);
+ p = (struct umsdos_dirent *) (page_address(page) + offs);
if (offs + info->recsize > PAGE_CACHE_SIZE) {
ret = mapping->a_ops->prepare_write(NULL,page,offs,
PAGE_CACHE_SIZE);
@@ -261,8 +261,8 @@ int umsdos_writeentry (struct dentry *parent, struct umsdos_info *info,
p->rdev = cpu_to_le16(entry->rdev);
p->mode = cpu_to_le16(entry->mode);
memcpy(p->name,entry->name,
- ((char*)page_address(page)+PAGE_CACHE_SIZE)-p->spare);
- memcpy((char*)page_address(page2),
+ (page_address(page) + PAGE_CACHE_SIZE) - p->spare);
+ memcpy(page_address(page2),
entry->spare+PAGE_CACHE_SIZE-offs,
offs+info->recsize-PAGE_CACHE_SIZE);
ret = mapping->a_ops->commit_write(NULL,page2,0,
diff --git a/fs/umsdos/inode.c b/fs/umsdos/inode.c
index 12b34e849..4aebe9bda 100644
--- a/fs/umsdos/inode.c
+++ b/fs/umsdos/inode.c
@@ -230,7 +230,7 @@ dentry->d_parent->d_name.name, dentry->d_name.name, inode->u.umsdos_i.i_patched)
ret=mapping->a_ops->prepare_write(NULL,page,offs,offs+UMSDOS_REC_SIZE);
if (ret)
goto out_unlock;
- entry = (struct umsdos_dirent*)((char*)page_address(page)+offs);
+ entry = (struct umsdos_dirent *) (page_address(page) + offs);
if (attr->ia_valid & ATTR_UID)
entry->uid = cpu_to_le16(attr->ia_uid);
if (attr->ia_valid & ATTR_GID)