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
Kirill Smelkov
linux
Commits
f7d5152e
Commit
f7d5152e
authored
Mar 12, 2002
by
Brian Gerst
Committed by
Linus Torvalds
Mar 12, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] struct super_block cleanup - ext2
Complete the ext2 superblock seperation.
parent
1b156290
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
8 deletions
+16
-8
fs/ext2/super.c
fs/ext2/super.c
+14
-5
include/linux/ext2_fs.h
include/linux/ext2_fs.h
+2
-1
include/linux/fs.h
include/linux/fs.h
+0
-2
No files found.
fs/ext2/super.c
View file @
f7d5152e
...
...
@@ -146,6 +146,8 @@ void ext2_put_super (struct super_block * sb)
if
(
sbi
->
s_block_bitmap
[
i
])
brelse
(
sbi
->
s_block_bitmap
[
i
]);
brelse
(
sbi
->
s_sbh
);
sb
->
u
.
generic_sbp
=
NULL
;
kfree
(
sbi
);
return
;
}
...
...
@@ -463,7 +465,11 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
int
db_count
;
int
i
,
j
;
sbi
=
EXT2_SB
(
sb
);
sbi
=
kmalloc
(
sizeof
(
struct
ext2_super_block
),
GFP_KERNEL
);
if
(
!
sbi
)
return
-
ENOMEM
;
sb
->
u
.
generic_sbp
=
sbi
;
/*
* See what the current blocksize for the device is, and
* use that as the blocksize. Otherwise (or if the blocksize
...
...
@@ -475,12 +481,12 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
sbi
->
s_mount_opt
=
0
;
if
(
!
parse_options
((
char
*
)
data
,
&
sb_block
,
&
resuid
,
&
resgid
,
&
sbi
->
s_mount_opt
))
return
-
EINVAL
;
goto
failed_sbi
;
blocksize
=
sb_min_blocksize
(
sb
,
BLOCK_SIZE
);
if
(
!
blocksize
)
{
printk
(
"EXT2-fs: unable to set blocksize
\n
"
);
return
-
EINVAL
;
goto
failed_sbi
;
}
/*
...
...
@@ -495,7 +501,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
if
(
!
(
bh
=
sb_bread
(
sb
,
logic_sb_block
)))
{
printk
(
"EXT2-fs: unable to read superblock
\n
"
);
return
-
EINVAL
;
goto
failed_sbi
;
}
/*
* Note: s_es must be initialized as soon as possible because
...
...
@@ -541,7 +547,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
if
(
!
sb_set_blocksize
(
sb
,
blocksize
))
{
printk
(
KERN_ERR
"EXT2-fs: blocksize too small for device.
\n
"
);
return
-
EINVAL
;
goto
failed_sbi
;
}
logic_sb_block
=
(
sb_block
*
BLOCK_SIZE
)
/
blocksize
;
...
...
@@ -699,6 +705,9 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
kfree
(
sbi
->
s_group_desc
);
failed_mount:
brelse
(
bh
);
failed_sbi:
sb
->
u
.
generic_sbp
=
NULL
;
kfree
(
sbi
);
return
-
EINVAL
;
}
...
...
include/linux/ext2_fs.h
View file @
f7d5152e
...
...
@@ -17,6 +17,7 @@
#define _LINUX_EXT2_FS_H
#include <linux/types.h>
#include <linux/ext2_fs_sb.h>
/*
* The second extended filesystem constants/structures
...
...
@@ -73,7 +74,7 @@
#ifdef __KERNEL__
static
inline
struct
ext2_sb_info
*
EXT2_SB
(
struct
super_block
*
sb
)
{
return
&
sb
->
u
.
ext2_sb
;
return
sb
->
u
.
generic_sbp
;
}
#else
/* Assume that user mode programs are passing in an ext2fs superblock, not
...
...
include/linux/fs.h
View file @
f7d5152e
...
...
@@ -648,7 +648,6 @@ struct quota_mount_options
#define MNT_FORCE 0x00000001
/* Attempt to forcibily umount */
#define MNT_DETACH 0x00000002
/* Just detach from the tree */
#include <linux/ext2_fs_sb.h>
#include <linux/ext3_fs_sb.h>
#include <linux/hpfs_fs_sb.h>
#include <linux/ntfs_fs_sb.h>
...
...
@@ -703,7 +702,6 @@ struct super_block {
char
s_id
[
32
];
/* Informational name */
union
{
struct
ext2_sb_info
ext2_sb
;
struct
ext3_sb_info
ext3_sb
;
struct
hpfs_sb_info
hpfs_sb
;
struct
ntfs_sb_info
ntfs_sb
;
...
...
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