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
c4da2aea
Commit
c4da2aea
authored
Mar 14, 2002
by
Brian Gerst
Committed by
Linus Torvalds
Mar 14, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] struct super_block cleanup - qnx4
Seperates qnx4_sb_info from struct super_block.
parent
88774498
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
46 deletions
+40
-46
fs/qnx4/bitmap.c
fs/qnx4/bitmap.c
+6
-6
fs/qnx4/inode.c
fs/qnx4/inode.c
+22
-11
include/linux/fs.h
include/linux/fs.h
+0
-2
include/linux/qnx4_fs.h
include/linux/qnx4_fs.h
+12
-0
include/linux/qnx4_fs_sb.h
include/linux/qnx4_fs_sb.h
+0
-27
No files found.
fs/qnx4/bitmap.c
View file @
c4da2aea
...
...
@@ -62,11 +62,11 @@ void count_bits(const register char *bmPart, register int size,
unsigned
long
qnx4_count_free_blocks
(
struct
super_block
*
sb
)
{
int
start
=
le32_to_cpu
(
sb
->
u
.
qnx4_sb
.
BitMap
->
di_first_xtnt
.
xtnt_blk
)
-
1
;
int
start
=
le32_to_cpu
(
qnx4_sb
(
sb
)
->
BitMap
->
di_first_xtnt
.
xtnt_blk
)
-
1
;
int
total
=
0
;
int
total_free
=
0
;
int
offset
=
0
;
int
size
=
le32_to_cpu
(
sb
->
u
.
qnx4_sb
.
BitMap
->
di_size
);
int
size
=
le32_to_cpu
(
qnx4_sb
(
sb
)
->
BitMap
->
di_size
);
struct
buffer_head
*
bh
;
while
(
total
<
size
)
{
...
...
@@ -87,8 +87,8 @@ unsigned long qnx4_count_free_blocks(struct super_block *sb)
int
qnx4_is_free
(
struct
super_block
*
sb
,
long
block
)
{
int
start
=
le32_to_cpu
(
sb
->
u
.
qnx4_sb
.
BitMap
->
di_first_xtnt
.
xtnt_blk
)
-
1
;
int
size
=
le32_to_cpu
(
sb
->
u
.
qnx4_sb
.
BitMap
->
di_size
);
int
start
=
le32_to_cpu
(
qnx4_sb
(
sb
)
->
BitMap
->
di_first_xtnt
.
xtnt_blk
)
-
1
;
int
size
=
le32_to_cpu
(
qnx4_sb
(
sb
)
->
BitMap
->
di_size
);
struct
buffer_head
*
bh
;
const
char
*
g
;
int
ret
=
-
EIO
;
...
...
@@ -116,8 +116,8 @@ int qnx4_is_free(struct super_block *sb, long block)
int
qnx4_set_bitmap
(
struct
super_block
*
sb
,
long
block
,
int
busy
)
{
int
start
=
le32_to_cpu
(
sb
->
u
.
qnx4_sb
.
BitMap
->
di_first_xtnt
.
xtnt_blk
)
-
1
;
int
size
=
le32_to_cpu
(
sb
->
u
.
qnx4_sb
.
BitMap
->
di_size
);
int
start
=
le32_to_cpu
(
qnx4_sb
(
sb
)
->
BitMap
->
di_first_xtnt
.
xtnt_blk
)
-
1
;
int
size
=
le32_to_cpu
(
qnx4_sb
(
sb
)
->
BitMap
->
di_size
);
struct
buffer_head
*
bh
;
char
*
g
;
...
...
fs/qnx4/inode.c
View file @
c4da2aea
...
...
@@ -147,7 +147,7 @@ static int qnx4_remount(struct super_block *sb, int *flags, char *data)
{
struct
qnx4_sb_info
*
qs
;
qs
=
&
sb
->
u
.
qnx4_sb
;
qs
=
qnx4_sb
(
sb
)
;
qs
->
Version
=
QNX4_VERSION
;
if
(
*
flags
&
MS_RDONLY
)
{
return
0
;
...
...
@@ -280,7 +280,7 @@ static int qnx4_statfs(struct super_block *sb, struct statfs *buf)
{
buf
->
f_type
=
sb
->
s_magic
;
buf
->
f_bsize
=
sb
->
s_blocksize
;
buf
->
f_blocks
=
le32_to_cpu
(
sb
->
u
.
qnx4_sb
.
BitMap
->
di_size
)
*
8
;
buf
->
f_blocks
=
le32_to_cpu
(
qnx4_sb
(
sb
)
->
BitMap
->
di_size
)
*
8
;
buf
->
f_bfree
=
qnx4_count_free_blocks
(
sb
);
buf
->
f_bavail
=
buf
->
f_bfree
;
buf
->
f_namelen
=
QNX4_NAME_MAX
;
...
...
@@ -301,12 +301,12 @@ static const char *qnx4_checkroot(struct super_block *sb)
int
i
,
j
;
int
found
=
0
;
if
(
*
(
sb
->
u
.
qnx4_sb
.
sb
->
RootDir
.
di_fname
)
!=
'/'
)
{
if
(
*
(
qnx4_sb
(
sb
)
->
sb
->
RootDir
.
di_fname
)
!=
'/'
)
{
return
"no qnx4 filesystem (no root dir)."
;
}
else
{
QNX4DEBUG
((
"QNX4 filesystem found on dev %s.
\n
"
,
sb
->
s_id
));
rd
=
le32_to_cpu
(
sb
->
u
.
qnx4_sb
.
sb
->
RootDir
.
di_first_xtnt
.
xtnt_blk
)
-
1
;
rl
=
le32_to_cpu
(
sb
->
u
.
qnx4_sb
.
sb
->
RootDir
.
di_first_xtnt
.
xtnt_size
);
rd
=
le32_to_cpu
(
qnx4_sb
(
sb
)
->
sb
->
RootDir
.
di_first_xtnt
.
xtnt_blk
)
-
1
;
rl
=
le32_to_cpu
(
qnx4_sb
(
sb
)
->
sb
->
RootDir
.
di_first_xtnt
.
xtnt_size
);
for
(
j
=
0
;
j
<
rl
;
j
++
)
{
bh
=
sb_bread
(
sb
,
rd
+
j
);
/* root dir, first block */
if
(
bh
==
NULL
)
{
...
...
@@ -318,8 +318,8 @@ static const char *qnx4_checkroot(struct super_block *sb)
QNX4DEBUG
((
"Rootdir entry found : [%s]
\n
"
,
rootdir
->
di_fname
));
if
(
!
strncmp
(
rootdir
->
di_fname
,
QNX4_BMNAME
,
sizeof
QNX4_BMNAME
))
{
found
=
1
;
sb
->
u
.
qnx4_sb
.
BitMap
=
kmalloc
(
sizeof
(
struct
qnx4_inode_entry
),
GFP_KERNEL
);
memcpy
(
sb
->
u
.
qnx4_sb
.
BitMap
,
rootdir
,
sizeof
(
struct
qnx4_inode_entry
)
);
/* keep bitmap inode known */
qnx4_sb
(
sb
)
->
BitMap
=
kmalloc
(
sizeof
(
struct
qnx4_inode_entry
),
GFP_KERNEL
);
memcpy
(
qnx4_sb
(
sb
)
->
BitMap
,
rootdir
,
sizeof
(
struct
qnx4_inode_entry
)
);
/* keep bitmap inode known */
break
;
}
}
...
...
@@ -341,6 +341,13 @@ static int qnx4_fill_super(struct super_block *s, void *data, int silent)
struct
buffer_head
*
bh
;
struct
inode
*
root
;
const
char
*
errmsg
;
struct
qnx4_sb_info
*
qs
;
qs
=
kmalloc
(
sizeof
(
struct
qnx4_sb_info
),
GFP_KERNEL
);
if
(
!
qs
)
return
-
ENOMEM
;
s
->
u
.
generic_sbp
=
qs
;
memset
(
qs
,
0
,
sizeof
(
struct
qnx4_sb_info
));
sb_set_blocksize
(
s
,
QNX4_BLOCK_SIZE
);
...
...
@@ -369,8 +376,8 @@ static int qnx4_fill_super(struct super_block *s, void *data, int silent)
#ifndef CONFIG_QNX4FS_RW
s
->
s_flags
|=
MS_RDONLY
;
/* Yup, read-only yet */
#endif
s
->
u
.
qnx4_sb
.
sb_buf
=
bh
;
s
->
u
.
qnx4_sb
.
sb
=
(
struct
qnx4_super_block
*
)
bh
->
b_data
;
qnx4_sb
(
s
)
->
sb_buf
=
bh
;
qnx4_sb
(
s
)
->
sb
=
(
struct
qnx4_super_block
*
)
bh
->
b_data
;
/* check before allocating dentries, inodes, .. */
...
...
@@ -401,13 +408,17 @@ static int qnx4_fill_super(struct super_block *s, void *data, int silent)
out:
brelse
(
bh
);
outnobh:
kfree
(
qs
);
s
->
u
.
generic_sbp
=
NULL
;
return
-
EINVAL
;
}
static
void
qnx4_put_super
(
struct
super_block
*
sb
)
{
kfree
(
sb
->
u
.
qnx4_sb
.
BitMap
);
struct
qnx4_sb_info
*
qs
=
qnx4_sb
(
sb
);
kfree
(
qs
->
BitMap
);
kfree
(
qs
);
sb
->
u
.
generic_sbp
=
NULL
;
return
;
}
...
...
include/linux/fs.h
View file @
c4da2aea
...
...
@@ -655,7 +655,6 @@ struct quota_mount_options
#include <linux/romfs_fs_sb.h>
#include <linux/hfs_fs_sb.h>
#include <linux/adfs_fs_sb.h>
#include <linux/qnx4_fs_sb.h>
#include <linux/reiserfs_fs_sb.h>
#include <linux/bfs_fs_sb.h>
#include <linux/udf_fs_sb.h>
...
...
@@ -706,7 +705,6 @@ struct super_block {
struct
romfs_sb_info
romfs_sb
;
struct
hfs_sb_info
hfs_sb
;
struct
adfs_sb_info
adfs_sb
;
struct
qnx4_sb_info
qnx4_sb
;
struct
reiserfs_sb_info
reiserfs_sb
;
struct
bfs_sb_info
bfs_sb
;
struct
udf_sb_info
udf_sb
;
...
...
include/linux/qnx4_fs.h
View file @
c4da2aea
...
...
@@ -97,6 +97,13 @@ struct qnx4_super_block {
#define QNX4DEBUG(X) (void) 0
#endif
struct
qnx4_sb_info
{
struct
buffer_head
*
sb_buf
;
/* superblock buffer */
struct
qnx4_super_block
*
sb
;
/* our superblock */
unsigned
int
Version
;
/* may be useful */
struct
qnx4_inode_entry
*
BitMap
;
/* useful */
};
struct
qnx4_inode_info
{
struct
qnx4_inode_entry
raw
;
unsigned
long
mmu_private
;
...
...
@@ -126,6 +133,11 @@ extern int qnx4_sync_file(struct file *file, struct dentry *dentry, int);
extern
int
qnx4_sync_inode
(
struct
inode
*
inode
);
extern
int
qnx4_get_block
(
struct
inode
*
inode
,
sector_t
iblock
,
struct
buffer_head
*
bh
,
int
create
);
static
inline
struct
qnx4_sb_info
*
qnx4_sb
(
struct
super_block
*
sb
)
{
return
sb
->
u
.
generic_sbp
;
}
static
inline
struct
qnx4_inode_info
*
qnx4_i
(
struct
inode
*
inode
)
{
return
list_entry
(
inode
,
struct
qnx4_inode_info
,
vfs_inode
);
...
...
include/linux/qnx4_fs_sb.h
deleted
100644 → 0
View file @
88774498
/*
* Name : qnx4_fs_sb.h
* Author : Richard Frowijn
* Function : qnx4 superblock definitions
* Version : 1.0.2
* Last modified : 2000-01-06
*
* History : 23-03-1998 created
*
*/
#ifndef _QNX4_FS_SB
#define _QNX4_FS_SB
#include <linux/qnx4_fs.h>
/*
* qnx4 super-block data in memory
*/
struct
qnx4_sb_info
{
struct
buffer_head
*
sb_buf
;
/* superblock buffer */
struct
qnx4_super_block
*
sb
;
/* our superblock */
unsigned
int
Version
;
/* may be useful */
struct
qnx4_inode_entry
*
BitMap
;
/* useful */
};
#endif
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