mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-06 22:42:10 +00:00
sysv: drop lock/unlock super
Removed lock/unlock super. Added a new private s_lock mutex. Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
f6e12dc4fc
commit
c07cb01c45
5 changed files with 20 additions and 18 deletions
|
@ -118,7 +118,7 @@ void sysv_free_inode(struct inode * inode)
|
|||
"%s\n", inode->i_sb->s_id);
|
||||
return;
|
||||
}
|
||||
lock_super(sb);
|
||||
mutex_lock(&sbi->s_lock);
|
||||
count = fs16_to_cpu(sbi, *sbi->s_sb_fic_count);
|
||||
if (count < sbi->s_fic_size) {
|
||||
*sv_sb_fic_inode(sb,count++) = cpu_to_fs16(sbi, ino);
|
||||
|
@ -128,7 +128,7 @@ void sysv_free_inode(struct inode * inode)
|
|||
dirty_sb(sb);
|
||||
memset(raw_inode, 0, sizeof(struct sysv_inode));
|
||||
mark_buffer_dirty(bh);
|
||||
unlock_super(sb);
|
||||
mutex_unlock(&sbi->s_lock);
|
||||
brelse(bh);
|
||||
}
|
||||
|
||||
|
@ -147,13 +147,13 @@ struct inode * sysv_new_inode(const struct inode * dir, umode_t mode)
|
|||
if (!inode)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
lock_super(sb);
|
||||
mutex_lock(&sbi->s_lock);
|
||||
count = fs16_to_cpu(sbi, *sbi->s_sb_fic_count);
|
||||
if (count == 0 || (*sv_sb_fic_inode(sb,count-1) == 0)) {
|
||||
count = refill_free_cache(sb);
|
||||
if (count == 0) {
|
||||
iput(inode);
|
||||
unlock_super(sb);
|
||||
mutex_unlock(&sbi->s_lock);
|
||||
return ERR_PTR(-ENOSPC);
|
||||
}
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ struct inode * sysv_new_inode(const struct inode * dir, umode_t mode)
|
|||
sysv_write_inode(inode, &wbc); /* ensure inode not allocated again */
|
||||
mark_inode_dirty(inode); /* cleared by sysv_write_inode() */
|
||||
/* That's it. */
|
||||
unlock_super(sb);
|
||||
mutex_unlock(&sbi->s_lock);
|
||||
return inode;
|
||||
}
|
||||
|
||||
|
@ -185,7 +185,7 @@ unsigned long sysv_count_free_inodes(struct super_block * sb)
|
|||
struct sysv_inode * raw_inode;
|
||||
int ino, count, sb_count;
|
||||
|
||||
lock_super(sb);
|
||||
mutex_lock(&sbi->s_lock);
|
||||
|
||||
sb_count = fs16_to_cpu(sbi, *sbi->s_sb_total_free_inodes);
|
||||
|
||||
|
@ -213,7 +213,7 @@ unsigned long sysv_count_free_inodes(struct super_block * sb)
|
|||
if (count != sb_count)
|
||||
goto Einval;
|
||||
out:
|
||||
unlock_super(sb);
|
||||
mutex_unlock(&sbi->s_lock);
|
||||
return count;
|
||||
|
||||
Einval:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue