Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
52576da3
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
52576da3
编写于
4月 17, 2012
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
hpfs: bitmaps are little-endian
annotate properly... Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
c4c99543
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
12 deletion
+12
-12
fs/hpfs/alloc.c
fs/hpfs/alloc.c
+7
-7
fs/hpfs/hpfs_fn.h
fs/hpfs/hpfs_fn.h
+3
-3
fs/hpfs/map.c
fs/hpfs/map.c
+2
-2
未找到文件。
fs/hpfs/alloc.c
浏览文件 @
52576da3
...
@@ -16,9 +16,9 @@
...
@@ -16,9 +16,9 @@
static
int
chk_if_allocated
(
struct
super_block
*
s
,
secno
sec
,
char
*
msg
)
static
int
chk_if_allocated
(
struct
super_block
*
s
,
secno
sec
,
char
*
msg
)
{
{
struct
quad_buffer_head
qbh
;
struct
quad_buffer_head
qbh
;
u
32
*
bmp
;
__le
32
*
bmp
;
if
(
!
(
bmp
=
hpfs_map_bitmap
(
s
,
sec
>>
14
,
&
qbh
,
"chk"
)))
goto
fail
;
if
(
!
(
bmp
=
hpfs_map_bitmap
(
s
,
sec
>>
14
,
&
qbh
,
"chk"
)))
goto
fail
;
if
((
cpu_to_le32
(
bmp
[(
sec
&
0x3fff
)
>>
5
])
>>
(
sec
&
0x1f
))
&
1
)
{
if
((
le32_to_cpu
(
bmp
[(
sec
&
0x3fff
)
>>
5
])
>>
(
sec
&
0x1f
))
&
1
)
{
hpfs_error
(
s
,
"sector '%s' - %08x not allocated in bitmap"
,
msg
,
sec
);
hpfs_error
(
s
,
"sector '%s' - %08x not allocated in bitmap"
,
msg
,
sec
);
goto
fail1
;
goto
fail1
;
}
}
...
@@ -62,7 +62,7 @@ int hpfs_chk_sectors(struct super_block *s, secno start, int len, char *msg)
...
@@ -62,7 +62,7 @@ int hpfs_chk_sectors(struct super_block *s, secno start, int len, char *msg)
static
secno
alloc_in_bmp
(
struct
super_block
*
s
,
secno
near
,
unsigned
n
,
unsigned
forward
)
static
secno
alloc_in_bmp
(
struct
super_block
*
s
,
secno
near
,
unsigned
n
,
unsigned
forward
)
{
{
struct
quad_buffer_head
qbh
;
struct
quad_buffer_head
qbh
;
unsigned
*
bmp
;
__le32
*
bmp
;
unsigned
bs
=
near
&
~
0x3fff
;
unsigned
bs
=
near
&
~
0x3fff
;
unsigned
nr
=
(
near
&
0x3fff
)
&
~
(
n
-
1
);
unsigned
nr
=
(
near
&
0x3fff
)
&
~
(
n
-
1
);
/*unsigned mnr;*/
/*unsigned mnr;*/
...
@@ -236,7 +236,7 @@ static secno alloc_in_dirband(struct super_block *s, secno near)
...
@@ -236,7 +236,7 @@ static secno alloc_in_dirband(struct super_block *s, secno near)
int
hpfs_alloc_if_possible
(
struct
super_block
*
s
,
secno
sec
)
int
hpfs_alloc_if_possible
(
struct
super_block
*
s
,
secno
sec
)
{
{
struct
quad_buffer_head
qbh
;
struct
quad_buffer_head
qbh
;
u
32
*
bmp
;
__le
32
*
bmp
;
if
(
!
(
bmp
=
hpfs_map_bitmap
(
s
,
sec
>>
14
,
&
qbh
,
"aip"
)))
goto
end
;
if
(
!
(
bmp
=
hpfs_map_bitmap
(
s
,
sec
>>
14
,
&
qbh
,
"aip"
)))
goto
end
;
if
(
le32_to_cpu
(
bmp
[(
sec
&
0x3fff
)
>>
5
])
&
(
1
<<
(
sec
&
0x1f
)))
{
if
(
le32_to_cpu
(
bmp
[(
sec
&
0x3fff
)
>>
5
])
&
(
1
<<
(
sec
&
0x1f
)))
{
bmp
[(
sec
&
0x3fff
)
>>
5
]
&=
cpu_to_le32
(
~
(
1
<<
(
sec
&
0x1f
)));
bmp
[(
sec
&
0x3fff
)
>>
5
]
&=
cpu_to_le32
(
~
(
1
<<
(
sec
&
0x1f
)));
...
@@ -254,7 +254,7 @@ int hpfs_alloc_if_possible(struct super_block *s, secno sec)
...
@@ -254,7 +254,7 @@ int hpfs_alloc_if_possible(struct super_block *s, secno sec)
void
hpfs_free_sectors
(
struct
super_block
*
s
,
secno
sec
,
unsigned
n
)
void
hpfs_free_sectors
(
struct
super_block
*
s
,
secno
sec
,
unsigned
n
)
{
{
struct
quad_buffer_head
qbh
;
struct
quad_buffer_head
qbh
;
u
32
*
bmp
;
__le
32
*
bmp
;
struct
hpfs_sb_info
*
sbi
=
hpfs_sb
(
s
);
struct
hpfs_sb_info
*
sbi
=
hpfs_sb
(
s
);
/*printk("2 - ");*/
/*printk("2 - ");*/
if
(
!
n
)
return
;
if
(
!
n
)
return
;
...
@@ -299,7 +299,7 @@ int hpfs_check_free_dnodes(struct super_block *s, int n)
...
@@ -299,7 +299,7 @@ int hpfs_check_free_dnodes(struct super_block *s, int n)
int
n_bmps
=
(
hpfs_sb
(
s
)
->
sb_fs_size
+
0x4000
-
1
)
>>
14
;
int
n_bmps
=
(
hpfs_sb
(
s
)
->
sb_fs_size
+
0x4000
-
1
)
>>
14
;
int
b
=
hpfs_sb
(
s
)
->
sb_c_bitmap
&
0x0fffffff
;
int
b
=
hpfs_sb
(
s
)
->
sb_c_bitmap
&
0x0fffffff
;
int
i
,
j
;
int
i
,
j
;
u
32
*
bmp
;
__le
32
*
bmp
;
struct
quad_buffer_head
qbh
;
struct
quad_buffer_head
qbh
;
if
((
bmp
=
hpfs_map_dnode_bitmap
(
s
,
&
qbh
)))
{
if
((
bmp
=
hpfs_map_dnode_bitmap
(
s
,
&
qbh
)))
{
for
(
j
=
0
;
j
<
512
;
j
++
)
{
for
(
j
=
0
;
j
<
512
;
j
++
)
{
...
@@ -351,7 +351,7 @@ void hpfs_free_dnode(struct super_block *s, dnode_secno dno)
...
@@ -351,7 +351,7 @@ void hpfs_free_dnode(struct super_block *s, dnode_secno dno)
hpfs_free_sectors
(
s
,
dno
,
4
);
hpfs_free_sectors
(
s
,
dno
,
4
);
}
else
{
}
else
{
struct
quad_buffer_head
qbh
;
struct
quad_buffer_head
qbh
;
u
32
*
bmp
;
__le
32
*
bmp
;
unsigned
ssec
=
(
dno
-
hpfs_sb
(
s
)
->
sb_dirband_start
)
/
4
;
unsigned
ssec
=
(
dno
-
hpfs_sb
(
s
)
->
sb_dirband_start
)
/
4
;
if
(
!
(
bmp
=
hpfs_map_dnode_bitmap
(
s
,
&
qbh
)))
{
if
(
!
(
bmp
=
hpfs_map_dnode_bitmap
(
s
,
&
qbh
)))
{
return
;
return
;
...
...
fs/hpfs/hpfs_fn.h
浏览文件 @
52576da3
...
@@ -178,7 +178,7 @@ static inline void copy_de(struct hpfs_dirent *dst, struct hpfs_dirent *src)
...
@@ -178,7 +178,7 @@ static inline void copy_de(struct hpfs_dirent *dst, struct hpfs_dirent *src)
dst
->
not_8x3
=
n
;
dst
->
not_8x3
=
n
;
}
}
static
inline
unsigned
tstbits
(
u
32
*
bmp
,
unsigned
b
,
unsigned
n
)
static
inline
unsigned
tstbits
(
__le
32
*
bmp
,
unsigned
b
,
unsigned
n
)
{
{
int
i
;
int
i
;
if
((
b
>=
0x4000
)
||
(
b
+
n
-
1
>=
0x4000
))
return
n
;
if
((
b
>=
0x4000
)
||
(
b
+
n
-
1
>=
0x4000
))
return
n
;
...
@@ -275,8 +275,8 @@ void hpfs_evict_inode(struct inode *);
...
@@ -275,8 +275,8 @@ void hpfs_evict_inode(struct inode *);
/* map.c */
/* map.c */
unsigned
*
hpfs_map_dnode_bitmap
(
struct
super_block
*
,
struct
quad_buffer_head
*
);
__le32
*
hpfs_map_dnode_bitmap
(
struct
super_block
*
,
struct
quad_buffer_head
*
);
unsigned
*
hpfs_map_bitmap
(
struct
super_block
*
,
unsigned
,
struct
quad_buffer_head
*
,
char
*
);
__le32
*
hpfs_map_bitmap
(
struct
super_block
*
,
unsigned
,
struct
quad_buffer_head
*
,
char
*
);
unsigned
char
*
hpfs_load_code_page
(
struct
super_block
*
,
secno
);
unsigned
char
*
hpfs_load_code_page
(
struct
super_block
*
,
secno
);
secno
*
hpfs_load_bitmap_directory
(
struct
super_block
*
,
secno
bmp
);
secno
*
hpfs_load_bitmap_directory
(
struct
super_block
*
,
secno
bmp
);
struct
fnode
*
hpfs_map_fnode
(
struct
super_block
*
s
,
ino_t
,
struct
buffer_head
**
);
struct
fnode
*
hpfs_map_fnode
(
struct
super_block
*
s
,
ino_t
,
struct
buffer_head
**
);
...
...
fs/hpfs/map.c
浏览文件 @
52576da3
...
@@ -8,12 +8,12 @@
...
@@ -8,12 +8,12 @@
#include "hpfs_fn.h"
#include "hpfs_fn.h"
unsigned
*
hpfs_map_dnode_bitmap
(
struct
super_block
*
s
,
struct
quad_buffer_head
*
qbh
)
__le32
*
hpfs_map_dnode_bitmap
(
struct
super_block
*
s
,
struct
quad_buffer_head
*
qbh
)
{
{
return
hpfs_map_4sectors
(
s
,
hpfs_sb
(
s
)
->
sb_dmap
,
qbh
,
0
);
return
hpfs_map_4sectors
(
s
,
hpfs_sb
(
s
)
->
sb_dmap
,
qbh
,
0
);
}
}
unsigned
int
*
hpfs_map_bitmap
(
struct
super_block
*
s
,
unsigned
bmp_block
,
__le32
*
hpfs_map_bitmap
(
struct
super_block
*
s
,
unsigned
bmp_block
,
struct
quad_buffer_head
*
qbh
,
char
*
id
)
struct
quad_buffer_head
*
qbh
,
char
*
id
)
{
{
secno
sec
;
secno
sec
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录