diff options
author | Marco Stornelli <marco.stornelli@gmail.com> | 2012-10-06 06:41:46 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-09 23:33:39 -0400 |
commit | c07cb01c45d6f5f80da63e0b17dca889dba48cc1 (patch) | |
tree | 5f1ed5896c0a791deee0d6b12eb66a43bebcf421 /fs/sysv/ialloc.c | |
parent | f6e12dc4fc6f78745fd48a24ff2f06efb0bdeb0d (diff) |
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>
Diffstat (limited to 'fs/sysv/ialloc.c')
-rw-r--r-- | fs/sysv/ialloc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/sysv/ialloc.c b/fs/sysv/ialloc.c index 8233b02eccae..f9db4eb31db4 100644 --- a/fs/sysv/ialloc.c +++ b/fs/sysv/ialloc.c | |||
@@ -118,7 +118,7 @@ void sysv_free_inode(struct inode * inode) | |||
118 | "%s\n", inode->i_sb->s_id); | 118 | "%s\n", inode->i_sb->s_id); |
119 | return; | 119 | return; |
120 | } | 120 | } |
121 | lock_super(sb); | 121 | mutex_lock(&sbi->s_lock); |
122 | count = fs16_to_cpu(sbi, *sbi->s_sb_fic_count); | 122 | count = fs16_to_cpu(sbi, *sbi->s_sb_fic_count); |
123 | if (count < sbi->s_fic_size) { | 123 | if (count < sbi->s_fic_size) { |
124 | *sv_sb_fic_inode(sb,count++) = cpu_to_fs16(sbi, ino); | 124 | *sv_sb_fic_inode(sb,count++) = cpu_to_fs16(sbi, ino); |
@@ -128,7 +128,7 @@ void sysv_free_inode(struct inode * inode) | |||
128 | dirty_sb(sb); | 128 | dirty_sb(sb); |
129 | memset(raw_inode, 0, sizeof(struct sysv_inode)); | 129 | memset(raw_inode, 0, sizeof(struct sysv_inode)); |
130 | mark_buffer_dirty(bh); | 130 | mark_buffer_dirty(bh); |
131 | unlock_super(sb); | 131 | mutex_unlock(&sbi->s_lock); |
132 | brelse(bh); | 132 | brelse(bh); |
133 | } | 133 | } |
134 | 134 | ||
@@ -147,13 +147,13 @@ struct inode * sysv_new_inode(const struct inode * dir, umode_t mode) | |||
147 | if (!inode) | 147 | if (!inode) |
148 | return ERR_PTR(-ENOMEM); | 148 | return ERR_PTR(-ENOMEM); |
149 | 149 | ||
150 | lock_super(sb); | 150 | mutex_lock(&sbi->s_lock); |
151 | count = fs16_to_cpu(sbi, *sbi->s_sb_fic_count); | 151 | count = fs16_to_cpu(sbi, *sbi->s_sb_fic_count); |
152 | if (count == 0 || (*sv_sb_fic_inode(sb,count-1) == 0)) { | 152 | if (count == 0 || (*sv_sb_fic_inode(sb,count-1) == 0)) { |
153 | count = refill_free_cache(sb); | 153 | count = refill_free_cache(sb); |
154 | if (count == 0) { | 154 | if (count == 0) { |
155 | iput(inode); | 155 | iput(inode); |
156 | unlock_super(sb); | 156 | mutex_unlock(&sbi->s_lock); |
157 | return ERR_PTR(-ENOSPC); | 157 | return ERR_PTR(-ENOSPC); |
158 | } | 158 | } |
159 | } | 159 | } |
@@ -174,7 +174,7 @@ struct inode * sysv_new_inode(const struct inode * dir, umode_t mode) | |||
174 | sysv_write_inode(inode, &wbc); /* ensure inode not allocated again */ | 174 | sysv_write_inode(inode, &wbc); /* ensure inode not allocated again */ |
175 | mark_inode_dirty(inode); /* cleared by sysv_write_inode() */ | 175 | mark_inode_dirty(inode); /* cleared by sysv_write_inode() */ |
176 | /* That's it. */ | 176 | /* That's it. */ |
177 | unlock_super(sb); | 177 | mutex_unlock(&sbi->s_lock); |
178 | return inode; | 178 | return inode; |
179 | } | 179 | } |
180 | 180 | ||
@@ -185,7 +185,7 @@ unsigned long sysv_count_free_inodes(struct super_block * sb) | |||
185 | struct sysv_inode * raw_inode; | 185 | struct sysv_inode * raw_inode; |
186 | int ino, count, sb_count; | 186 | int ino, count, sb_count; |
187 | 187 | ||
188 | lock_super(sb); | 188 | mutex_lock(&sbi->s_lock); |
189 | 189 | ||
190 | sb_count = fs16_to_cpu(sbi, *sbi->s_sb_total_free_inodes); | 190 | sb_count = fs16_to_cpu(sbi, *sbi->s_sb_total_free_inodes); |
191 | 191 | ||
@@ -213,7 +213,7 @@ unsigned long sysv_count_free_inodes(struct super_block * sb) | |||
213 | if (count != sb_count) | 213 | if (count != sb_count) |
214 | goto Einval; | 214 | goto Einval; |
215 | out: | 215 | out: |
216 | unlock_super(sb); | 216 | mutex_unlock(&sbi->s_lock); |
217 | return count; | 217 | return count; |
218 | 218 | ||
219 | Einval: | 219 | Einval: |