Commit 6c952404 authored by David Woodhouse's avatar David Woodhouse

Revert some bogus changes from mainline -- an over-excessive search/replace and some

BKL additions from someone who evidently didn't bother to look at either the code they
were modifying or the documentation in README.Locking which explicitly states the BKL
is not needed.
parent b43e708b
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include <linux/jffs2_fs_i.h> #include <linux/jffs2_fs_i.h>
#include <linux/jffs2_fs_sb.h> #include <linux/jffs2_fs_sb.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/smp_lock.h>
#include "nodelist.h" #include "nodelist.h"
static int jffs2_readdir (struct file *, void *, filldir_t); static int jffs2_readdir (struct file *, void *, filldir_t);
...@@ -144,8 +143,6 @@ static int jffs2_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -144,8 +143,6 @@ static int jffs2_readdir(struct file *filp, void *dirent, filldir_t filldir)
D1(printk(KERN_DEBUG "jffs2_readdir() for dir_i #%lu\n", filp->f_dentry->d_inode->i_ino)); D1(printk(KERN_DEBUG "jffs2_readdir() for dir_i #%lu\n", filp->f_dentry->d_inode->i_ino));
lock_kernel();
f = JFFS2_INODE_INFO(inode); f = JFFS2_INODE_INFO(inode);
c = JFFS2_SB_INFO(inode->i_sb); c = JFFS2_SB_INFO(inode->i_sb);
...@@ -189,7 +186,6 @@ static int jffs2_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -189,7 +186,6 @@ static int jffs2_readdir(struct file *filp, void *dirent, filldir_t filldir)
up(&f->sem); up(&f->sem);
out: out:
filp->f_pos = offset; filp->f_pos = offset;
unlock_kernel();
return 0; return 0;
} }
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include <linux/pagemap.h> #include <linux/pagemap.h>
#include <linux/crc32.h> #include <linux/crc32.h>
#include <linux/jffs2.h> #include <linux/jffs2.h>
#include <linux/smp_lock.h>
#include "nodelist.h" #include "nodelist.h"
extern int generic_file_open(struct inode *, struct file *) __attribute__((weak)); extern int generic_file_open(struct inode *, struct file *) __attribute__((weak));
...@@ -110,12 +109,11 @@ int jffs2_setattr (struct dentry *dentry, struct iattr *iattr) ...@@ -110,12 +109,11 @@ int jffs2_setattr (struct dentry *dentry, struct iattr *iattr)
int mdatalen = 0; int mdatalen = 0;
unsigned int ivalid; unsigned int ivalid;
uint32_t phys_ofs, alloclen; uint32_t phys_ofs, alloclen;
int ret = 0; int ret;
lock_kernel();
D1(printk(KERN_DEBUG "jffs2_setattr(): ino #%lu\n", inode->i_ino)); D1(printk(KERN_DEBUG "jffs2_setattr(): ino #%lu\n", inode->i_ino));
ret = inode_change_ok(inode, iattr); ret = inode_change_ok(inode, iattr);
if (ret) if (ret)
goto out; return ret;
/* Special cases - we don't want more than one data node /* Special cases - we don't want more than one data node
for these types on the medium at any time. So setattr for these types on the medium at any time. So setattr
...@@ -132,14 +130,12 @@ int jffs2_setattr (struct dentry *dentry, struct iattr *iattr) ...@@ -132,14 +130,12 @@ int jffs2_setattr (struct dentry *dentry, struct iattr *iattr)
} else if (S_ISLNK(inode->i_mode)) { } else if (S_ISLNK(inode->i_mode)) {
mdatalen = f->metadata->size; mdatalen = f->metadata->size;
mdata = kmalloc(f->metadata->size, GFP_USER); mdata = kmalloc(f->metadata->size, GFP_USER);
if (!mdata) { if (!mdata)
ret = -ENOMEM; return -ENOMEM;
goto out;
}
ret = jffs2_read_dnode(c, f->metadata, mdata, 0, mdatalen); ret = jffs2_read_dnode(c, f->metadata, mdata, 0, mdatalen);
if (ret) { if (ret) {
kfree(mdata); kfree(mdata);
goto out; return ret;
} }
D1(printk(KERN_DEBUG "jffs2_setattr(): Writing %d bytes of symlink target\n", mdatalen)); D1(printk(KERN_DEBUG "jffs2_setattr(): Writing %d bytes of symlink target\n", mdatalen));
} }
...@@ -148,8 +144,7 @@ int jffs2_setattr (struct dentry *dentry, struct iattr *iattr) ...@@ -148,8 +144,7 @@ int jffs2_setattr (struct dentry *dentry, struct iattr *iattr)
if (!ri) { if (!ri) {
if (S_ISLNK(inode->i_mode)) if (S_ISLNK(inode->i_mode))
kfree(mdata); kfree(mdata);
ret = -ENOMEM; return -ENOMEM;
goto out;
} }
ret = jffs2_reserve_space(c, sizeof(*ri) + mdatalen, &phys_ofs, &alloclen, ALLOC_NORMAL); ret = jffs2_reserve_space(c, sizeof(*ri) + mdatalen, &phys_ofs, &alloclen, ALLOC_NORMAL);
...@@ -157,7 +152,7 @@ int jffs2_setattr (struct dentry *dentry, struct iattr *iattr) ...@@ -157,7 +152,7 @@ int jffs2_setattr (struct dentry *dentry, struct iattr *iattr)
jffs2_free_raw_inode(ri); jffs2_free_raw_inode(ri);
if (S_ISLNK(inode->i_mode & S_IFMT)) if (S_ISLNK(inode->i_mode & S_IFMT))
kfree(mdata); kfree(mdata);
goto out; return ret;
} }
down(&f->sem); down(&f->sem);
ivalid = iattr->ia_valid; ivalid = iattr->ia_valid;
...@@ -206,8 +201,7 @@ int jffs2_setattr (struct dentry *dentry, struct iattr *iattr) ...@@ -206,8 +201,7 @@ int jffs2_setattr (struct dentry *dentry, struct iattr *iattr)
jffs2_complete_reservation(c); jffs2_complete_reservation(c);
jffs2_free_raw_inode(ri); jffs2_free_raw_inode(ri);
up(&f->sem); up(&f->sem);
ret = PTR_ERR(new_metadata); return PTR_ERR(new_metadata);
goto out;
} }
/* It worked. Update the inode */ /* It worked. Update the inode */
inode->i_atime = ri->atime; inode->i_atime = ri->atime;
...@@ -241,9 +235,7 @@ int jffs2_setattr (struct dentry *dentry, struct iattr *iattr) ...@@ -241,9 +235,7 @@ int jffs2_setattr (struct dentry *dentry, struct iattr *iattr)
up(&f->sem); up(&f->sem);
jffs2_complete_reservation(c); jffs2_complete_reservation(c);
out: return 0;
unlock_kernel();
return ret;
} }
int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg) int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg)
......
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/pagemap.h> #include <linux/pagemap.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/smp_lock.h>
#include "nodelist.h" #include "nodelist.h"
int jffs2_statfs(struct super_block *sb, struct statfs *buf) int jffs2_statfs(struct super_block *sb, struct statfs *buf)
...@@ -321,21 +320,16 @@ int jffs2_remount_fs (struct super_block *sb, int *flags, char *data) ...@@ -321,21 +320,16 @@ int jffs2_remount_fs (struct super_block *sb, int *flags, char *data)
void jffs2_write_super (struct super_block *sb) void jffs2_write_super (struct super_block *sb)
{ {
struct jffs2_sb_info *c = JFFS2_SB_INFO(sb); struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);
lock_kernel();
sb->s_dirt = 0; sb->s_dirt = 0;
if (sb->s_flags & MS_RDONLY) { if (sb->s_flags & MS_RDONLY)
unlock_kernel();
return; return;
}
D1(printk("jffs2_write_super(): flush_wbuf before gc-trigger\n")); D1(printk("jffs2_write_super(): flush_wbuf before gc-trigger\n"));
jffs2_flush_wbuf(c, 2); jffs2_flush_wbuf(c, 2);
jffs2_garbage_collect_trigger(c); jffs2_garbage_collect_trigger(c);
jffs2_erase_pending_blocks(c); jffs2_erase_pending_blocks(c);
jffs2_mark_erased_blocks(c); jffs2_mark_erased_blocks(c);
unlock_kernel();
} }
......
...@@ -760,7 +760,7 @@ static int jffs2_garbage_collect_dnode(struct jffs2_sb_info *c, struct jffs2_era ...@@ -760,7 +760,7 @@ static int jffs2_garbage_collect_dnode(struct jffs2_sb_info *c, struct jffs2_era
kunmap(pg); kunmap(pg);
/* XXX: Does the page get freed automatically? */ /* XXX: Does the page get freed automatically? */
/* AAA: Judging by the unmount getting stuck in __wait_on_page_locked, nope. */ /* AAA: Judging by the unmount getting stuck in __wait_on_page, nope. */
page_cache_release(pg); page_cache_release(pg);
return ret; return ret;
} }
......
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