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
36615c12
Commit
36615c12
authored
Nov 01, 2002
by
Theodore Y. Ts'o
Committed by
Linus Torvalds
Nov 01, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] Orlov block allocator for ext3
Here's the ext3 version.
parent
4be68d9c
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
277 additions
and
79 deletions
+277
-79
fs/ext3/ialloc.c
fs/ext3/ialloc.c
+259
-77
fs/ext3/super.c
fs/ext3/super.c
+11
-0
include/linux/ext3_fs.h
include/linux/ext3_fs.h
+5
-2
include/linux/ext3_fs_sb.h
include/linux/ext3_fs_sb.h
+2
-0
No files found.
fs/ext3/ialloc.c
View file @
36615c12
This diff is collapsed.
Click to expand it.
fs/ext3/super.c
View file @
36615c12
...
...
@@ -390,6 +390,7 @@ void ext3_put_super (struct super_block * sb)
for
(
i
=
0
;
i
<
sbi
->
s_gdb_count
;
i
++
)
brelse
(
sbi
->
s_group_desc
[
i
]);
kfree
(
sbi
->
s_group_desc
);
kfree
(
sbi
->
s_debts
);
brelse
(
sbi
->
s_sbh
);
/* Debugging code just in case the in-memory inode orphan list
...
...
@@ -1221,6 +1222,13 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
printk
(
KERN_ERR
"EXT3-fs: not enough memory
\n
"
);
goto
failed_mount
;
}
sbi
->
s_debts
=
kmalloc
(
sbi
->
s_groups_count
*
sizeof
(
*
sbi
->
s_debts
),
GFP_KERNEL
);
if
(
!
sbi
->
s_debts
)
{
printk
(
"EXT3-fs: not enough memory
\n
"
);
goto
failed_mount2
;
}
memset
(
sbi
->
s_debts
,
0
,
sbi
->
s_groups_count
*
sizeof
(
*
sbi
->
s_debts
));
for
(
i
=
0
;
i
<
db_count
;
i
++
)
{
block
=
descriptor_loc
(
sb
,
logic_sb_block
,
i
);
sbi
->
s_group_desc
[
i
]
=
sb_bread
(
sb
,
block
);
...
...
@@ -1236,6 +1244,7 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
goto
failed_mount2
;
}
sbi
->
s_gdb_count
=
db_count
;
sbi
->
s_dir_count
=
ext3_count_dirs
(
sb
);
/*
* set up enough so that it can read an inode
*/
...
...
@@ -1339,6 +1348,8 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
failed_mount3:
journal_destroy
(
sbi
->
s_journal
);
failed_mount2:
if
(
sbi
->
s_debts
)
kfree
(
sbi
->
s_debts
);
for
(
i
=
0
;
i
<
db_count
;
i
++
)
brelse
(
sbi
->
s_group_desc
[
i
]);
kfree
(
sbi
->
s_group_desc
);
...
...
include/linux/ext3_fs.h
View file @
36615c12
...
...
@@ -186,10 +186,11 @@ struct ext3_group_desc
#define EXT3_JOURNAL_DATA_FL 0x00004000
/* file data should be journaled */
#define EXT3_NOTAIL_FL 0x00008000
/* file tail should not be merged */
#define EXT3_DIRSYNC_FL 0x00010000
/* dirsync behaviour (directories only) */
#define EXT3_TOPDIR_FL 0x00020000
/* Top of directory hierarchies*/
#define EXT3_RESERVED_FL 0x80000000
/* reserved for ext3 lib */
#define EXT3_FL_USER_VISIBLE 0x000
15
FFF
/* User visible flags */
#define EXT3_FL_USER_MODIFIABLE 0x000
10
0FF
/* User modifiable flags */
#define EXT3_FL_USER_VISIBLE 0x000
3D
FFF
/* User visible flags */
#define EXT3_FL_USER_MODIFIABLE 0x000
38
0FF
/* User modifiable flags */
/*
* Inode dynamic state flags
...
...
@@ -308,6 +309,7 @@ struct ext3_inode {
* Mount flags
*/
#define EXT3_MOUNT_CHECK 0x0001
/* Do mount-time checks */
#define EXT3_MOUNT_OLDALLOC 0x0002
/* Don't use the new Orlov allocator */
#define EXT3_MOUNT_GRPID 0x0004
/* Create files with directory's group */
#define EXT3_MOUNT_DEBUG 0x0008
/* Some debugging messages */
#define EXT3_MOUNT_ERRORS_CONT 0x0010
/* Continue on errors */
...
...
@@ -704,6 +706,7 @@ extern struct inode * ext3_new_inode (handle_t *, struct inode *, int);
extern
void
ext3_free_inode
(
handle_t
*
,
struct
inode
*
);
extern
struct
inode
*
ext3_orphan_get
(
struct
super_block
*
,
ino_t
);
extern
unsigned
long
ext3_count_free_inodes
(
struct
super_block
*
);
extern
unsigned
long
ext3_count_dirs
(
struct
super_block
*
);
extern
void
ext3_check_inodes_bitmap
(
struct
super_block
*
);
extern
unsigned
long
ext3_count_free
(
struct
buffer_head
*
,
unsigned
);
...
...
include/linux/ext3_fs_sb.h
View file @
36615c12
...
...
@@ -50,6 +50,8 @@ struct ext3_sb_info {
u32
s_next_generation
;
u32
s_hash_seed
[
4
];
int
s_def_hash_version
;
unsigned
long
s_dir_count
;
u8
*
s_debts
;
/* Journaling */
struct
inode
*
s_journal_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