Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
70d4c9f2
Commit
70d4c9f2
authored
Jan 19, 2004
by
Andrew Morton
Committed by
Linus Torvalds
Jan 19, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] ext2_new_inode nanocleanup
We've cached EXT2_SB(sb) in local variable `sbi'. Use it.
parent
0fd0c48e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
fs/ext2/ialloc.c
fs/ext2/ialloc.c
+10
-10
No files found.
fs/ext2/ialloc.c
View file @
70d4c9f2
...
@@ -507,7 +507,7 @@ struct inode *ext2_new_inode(struct inode *dir, int mode)
...
@@ -507,7 +507,7 @@ struct inode *ext2_new_inode(struct inode *dir, int mode)
group
=
0
;
group
=
0
;
continue
;
continue
;
}
}
if
(
ext2_set_bit_atomic
(
sb_bgl_lock
(
EXT2_SB
(
sb
)
,
group
),
if
(
ext2_set_bit_atomic
(
sb_bgl_lock
(
sbi
,
group
),
ino
,
bitmap_bh
->
b_data
))
{
ino
,
bitmap_bh
->
b_data
))
{
/* we lost this inode */
/* we lost this inode */
if
(
++
ino
>=
EXT2_INODES_PER_GROUP
(
sb
))
{
if
(
++
ino
>=
EXT2_INODES_PER_GROUP
(
sb
))
{
...
@@ -543,23 +543,23 @@ struct inode *ext2_new_inode(struct inode *dir, int mode)
...
@@ -543,23 +543,23 @@ struct inode *ext2_new_inode(struct inode *dir, int mode)
goto
fail
;
goto
fail
;
}
}
percpu_counter_mod
(
&
EXT2_SB
(
sb
)
->
s_freeinodes_counter
,
-
1
);
percpu_counter_mod
(
&
sbi
->
s_freeinodes_counter
,
-
1
);
if
(
S_ISDIR
(
mode
))
if
(
S_ISDIR
(
mode
))
percpu_counter_inc
(
&
EXT2_SB
(
sb
)
->
s_dirs_counter
);
percpu_counter_inc
(
&
sbi
->
s_dirs_counter
);
spin_lock
(
sb_bgl_lock
(
EXT2_SB
(
sb
)
,
group
));
spin_lock
(
sb_bgl_lock
(
sbi
,
group
));
gdp
->
bg_free_inodes_count
=
gdp
->
bg_free_inodes_count
=
cpu_to_le16
(
le16_to_cpu
(
gdp
->
bg_free_inodes_count
)
-
1
);
cpu_to_le16
(
le16_to_cpu
(
gdp
->
bg_free_inodes_count
)
-
1
);
if
(
S_ISDIR
(
mode
))
{
if
(
S_ISDIR
(
mode
))
{
if
(
EXT2_SB
(
sb
)
->
s_debts
[
group
]
<
255
)
if
(
sbi
->
s_debts
[
group
]
<
255
)
EXT2_SB
(
sb
)
->
s_debts
[
group
]
++
;
sbi
->
s_debts
[
group
]
++
;
gdp
->
bg_used_dirs_count
=
gdp
->
bg_used_dirs_count
=
cpu_to_le16
(
le16_to_cpu
(
gdp
->
bg_used_dirs_count
)
+
1
);
cpu_to_le16
(
le16_to_cpu
(
gdp
->
bg_used_dirs_count
)
+
1
);
}
else
{
}
else
{
if
(
EXT2_SB
(
sb
)
->
s_debts
[
group
])
if
(
sbi
->
s_debts
[
group
])
EXT2_SB
(
sb
)
->
s_debts
[
group
]
--
;
sbi
->
s_debts
[
group
]
--
;
}
}
spin_unlock
(
sb_bgl_lock
(
EXT2_SB
(
sb
)
,
group
));
spin_unlock
(
sb_bgl_lock
(
sbi
,
group
));
sb
->
s_dirt
=
1
;
sb
->
s_dirt
=
1
;
mark_buffer_dirty
(
bh2
);
mark_buffer_dirty
(
bh2
);
...
@@ -599,7 +599,7 @@ struct inode *ext2_new_inode(struct inode *dir, int mode)
...
@@ -599,7 +599,7 @@ struct inode *ext2_new_inode(struct inode *dir, int mode)
ei
->
i_dir_start_lookup
=
0
;
ei
->
i_dir_start_lookup
=
0
;
ei
->
i_state
=
EXT2_STATE_NEW
;
ei
->
i_state
=
EXT2_STATE_NEW
;
ext2_set_inode_flags
(
inode
);
ext2_set_inode_flags
(
inode
);
inode
->
i_generation
=
EXT2_SB
(
sb
)
->
s_next_generation
++
;
inode
->
i_generation
=
sbi
->
s_next_generation
++
;
insert_inode_hash
(
inode
);
insert_inode_hash
(
inode
);
if
(
DQUOT_ALLOC_INODE
(
inode
))
{
if
(
DQUOT_ALLOC_INODE
(
inode
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment