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 @@
#include <linux/jffs2_fs_i.h>
#include <linux/jffs2_fs_sb.h>
#include <linux/time.h>
#include <linux/smp_lock.h>
#include "nodelist.h"
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)
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);
c = JFFS2_SB_INFO(inode->i_sb);
......@@ -189,7 +186,6 @@ static int jffs2_readdir(struct file *filp, void *dirent, filldir_t filldir)
up(&f->sem);
out:
filp->f_pos = offset;
unlock_kernel();
return 0;
}
......
......@@ -43,7 +43,6 @@
#include <linux/pagemap.h>
#include <linux/crc32.h>
#include <linux/jffs2.h>
#include <linux/smp_lock.h>
#include "nodelist.h"
extern int generic_file_open(struct inode *, struct file *) __attribute__((weak));
......@@ -110,12 +109,11 @@ int jffs2_setattr (struct dentry *dentry, struct iattr *iattr)
int mdatalen = 0;
unsigned int ivalid;
uint32_t phys_ofs, alloclen;
int ret = 0;
lock_kernel();
int ret;
D1(printk(KERN_DEBUG "jffs2_setattr(): ino #%lu\n", inode->i_ino));
ret = inode_change_ok(inode, iattr);
if (ret)
goto out;
return ret;
/* Special cases - we don't want more than one data node
for these types on the medium at any time. So setattr
......@@ -132,14 +130,12 @@ int jffs2_setattr (struct dentry *dentry, struct iattr *iattr)
} else if (S_ISLNK(inode->i_mode)) {
mdatalen = f->metadata->size;
mdata = kmalloc(f->metadata->size, GFP_USER);
if (!mdata) {
ret = -ENOMEM;
goto out;
}
if (!mdata)
return -ENOMEM;
ret = jffs2_read_dnode(c, f->metadata, mdata, 0, mdatalen);
if (ret) {
kfree(mdata);
goto out;
return ret;
}
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)
if (!ri) {
if (S_ISLNK(inode->i_mode))
kfree(mdata);
ret = -ENOMEM;
goto out;
return -ENOMEM;
}
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)
jffs2_free_raw_inode(ri);
if (S_ISLNK(inode->i_mode & S_IFMT))
kfree(mdata);
goto out;
return ret;
}
down(&f->sem);
ivalid = iattr->ia_valid;
......@@ -206,8 +201,7 @@ int jffs2_setattr (struct dentry *dentry, struct iattr *iattr)
jffs2_complete_reservation(c);
jffs2_free_raw_inode(ri);
up(&f->sem);
ret = PTR_ERR(new_metadata);
goto out;
return PTR_ERR(new_metadata);
}
/* It worked. Update the inode */
inode->i_atime = ri->atime;
......@@ -241,9 +235,7 @@ int jffs2_setattr (struct dentry *dentry, struct iattr *iattr)
up(&f->sem);
jffs2_complete_reservation(c);
out:
unlock_kernel();
return ret;
return 0;
}
int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg)
......
......@@ -44,7 +44,6 @@
#include <linux/mtd/mtd.h>
#include <linux/pagemap.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include "nodelist.h"
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)
void jffs2_write_super (struct super_block *sb)
{
struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);
lock_kernel();
sb->s_dirt = 0;
if (sb->s_flags & MS_RDONLY) {
unlock_kernel();
if (sb->s_flags & MS_RDONLY)
return;
}
D1(printk("jffs2_write_super(): flush_wbuf before gc-trigger\n"));
jffs2_flush_wbuf(c, 2);
jffs2_garbage_collect_trigger(c);
jffs2_erase_pending_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
kunmap(pg);
/* 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);
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