summaryrefslogtreecommitdiffstats
path: root/fs/minix/bitmap.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-01-29 01:41:54 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-01-29 01:41:54 +0000
commitf969d69ba9f952e5bdd38278e25e26a3e4a61a70 (patch)
treeb3530d803df59d726afaabebc6626987dee1ca05 /fs/minix/bitmap.c
parenta10ce7ef2066b455d69187643ddf2073bfc4db24 (diff)
Merge with 2.3.27.
Diffstat (limited to 'fs/minix/bitmap.c')
-rw-r--r--fs/minix/bitmap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/minix/bitmap.c b/fs/minix/bitmap.c
index 060d5b26c..21057e7dc 100644
--- a/fs/minix/bitmap.c
+++ b/fs/minix/bitmap.c
@@ -251,13 +251,15 @@ struct inode * minix_new_inode(const struct inode * dir, int * error)
struct buffer_head * bh;
int i,j;
- if (!dir || !(inode = get_empty_inode()))
+ inode = get_empty_inode();
+ if (!inode)
return NULL;
sb = dir->i_sb;
inode->i_sb = sb;
inode->i_flags = 0;
j = 8192;
bh = NULL;
+ lock_super(sb);
for (i = 0; i < sb->u.minix_sb.s_imap_blocks; i++) {
bh = inode->i_sb->u.minix_sb.s_imap[i];
if ((j = minix_find_first_zero_bit(bh->b_data, 8192)) < 8192)
@@ -265,17 +267,20 @@ struct inode * minix_new_inode(const struct inode * dir, int * error)
}
if (!bh || j >= 8192) {
iput(inode);
+ unlock_super(sb);
return NULL;
}
if (minix_set_bit(j,bh->b_data)) { /* shouldn't happen */
printk("new_inode: bit already set");
iput(inode);
+ unlock_super(sb);
return NULL;
}
mark_buffer_dirty(bh, 1);
j += i*8192;
if (!j || j > inode->i_sb->u.minix_sb.s_ninodes) {
iput(inode);
+ unlock_super(sb);
return NULL;
}
inode->i_nlink = 1;