Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
f2c870e3
cloud-kernel
项目概览
openanolis
/
cloud-kernel
接近 2 年 前同步成功
通知
170
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看板
提交
f2c870e3
编写于
8月 18, 2009
作者:
T
Tao Ma
提交者:
Joel Becker
9月 22, 2009
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ocfs2: Add ocfs2_read_refcount_block.
Signed-off-by:
N
Tao Ma
<
tao.ma@oracle.com
>
上级
93c97087
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
105 addition
and
0 deletion
+105
-0
fs/ocfs2/Makefile
fs/ocfs2/Makefile
+1
-0
fs/ocfs2/cluster/masklog.c
fs/ocfs2/cluster/masklog.c
+1
-0
fs/ocfs2/cluster/masklog.h
fs/ocfs2/cluster/masklog.h
+1
-0
fs/ocfs2/ocfs2.h
fs/ocfs2/ocfs2.h
+3
-0
fs/ocfs2/refcounttree.c
fs/ocfs2/refcounttree.c
+99
-0
未找到文件。
fs/ocfs2/Makefile
浏览文件 @
f2c870e3
...
...
@@ -28,6 +28,7 @@ ocfs2-objs := \
locks.o
\
mmap.o
\
namei.o
\
refcounttree.o
\
resize.o
\
slot_map.o
\
suballoc.o
\
...
...
fs/ocfs2/cluster/masklog.c
浏览文件 @
f2c870e3
...
...
@@ -111,6 +111,7 @@ static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = {
define_mask
(
EXPORT
),
define_mask
(
XATTR
),
define_mask
(
QUOTA
),
define_mask
(
REFCOUNT
),
define_mask
(
ERROR
),
define_mask
(
NOTICE
),
define_mask
(
KTHREAD
),
...
...
fs/ocfs2/cluster/masklog.h
浏览文件 @
f2c870e3
...
...
@@ -113,6 +113,7 @@
#define ML_EXPORT 0x0000000010000000ULL
/* ocfs2 export operations */
#define ML_XATTR 0x0000000020000000ULL
/* ocfs2 extended attributes */
#define ML_QUOTA 0x0000000040000000ULL
/* ocfs2 quota operations */
#define ML_REFCOUNT 0x0000000080000000ULL
/* refcount tree operations */
/* bits that are infrequently given and frequently matched in the high word */
#define ML_ERROR 0x0000000100000000ULL
/* sent to KERN_ERR */
#define ML_NOTICE 0x0000000200000000ULL
/* setn to KERN_NOTICE */
...
...
fs/ocfs2/ocfs2.h
浏览文件 @
f2c870e3
...
...
@@ -610,6 +610,9 @@ static inline int ocfs2_uses_extended_slot_map(struct ocfs2_super *osb)
#define OCFS2_IS_VALID_DX_LEAF(ptr) \
(!strcmp((ptr)->dl_signature, OCFS2_DX_LEAF_SIGNATURE))
#define OCFS2_IS_VALID_REFCOUNT_BLOCK(ptr) \
(!strcmp((ptr)->rf_signature, OCFS2_REFCOUNT_BLOCK_SIGNATURE))
static
inline
unsigned
long
ino_from_blkno
(
struct
super_block
*
sb
,
u64
blkno
)
{
...
...
fs/ocfs2/refcounttree.c
0 → 100644
浏览文件 @
f2c870e3
/* -*- mode: c; c-basic-offset: 8; -*-
* vim: noexpandtab sw=8 ts=8 sts=0:
*
* refcounttree.c
*
* Copyright (C) 2009 Oracle. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
#define MLOG_MASK_PREFIX ML_REFCOUNT
#include <cluster/masklog.h>
#include "ocfs2.h"
#include "inode.h"
#include "alloc.h"
#include "suballoc.h"
#include "journal.h"
#include "uptodate.h"
#include "super.h"
#include "buffer_head_io.h"
#include "blockcheck.h"
static
int
ocfs2_validate_refcount_block
(
struct
super_block
*
sb
,
struct
buffer_head
*
bh
)
{
int
rc
;
struct
ocfs2_refcount_block
*
rb
=
(
struct
ocfs2_refcount_block
*
)
bh
->
b_data
;
mlog
(
0
,
"Validating refcount block %llu
\n
"
,
(
unsigned
long
long
)
bh
->
b_blocknr
);
BUG_ON
(
!
buffer_uptodate
(
bh
));
/*
* If the ecc fails, we return the error but otherwise
* leave the filesystem running. We know any error is
* local to this block.
*/
rc
=
ocfs2_validate_meta_ecc
(
sb
,
bh
->
b_data
,
&
rb
->
rf_check
);
if
(
rc
)
{
mlog
(
ML_ERROR
,
"Checksum failed for refcount block %llu
\n
"
,
(
unsigned
long
long
)
bh
->
b_blocknr
);
return
rc
;
}
if
(
!
OCFS2_IS_VALID_REFCOUNT_BLOCK
(
rb
))
{
ocfs2_error
(
sb
,
"Refcount block #%llu has bad signature %.*s"
,
(
unsigned
long
long
)
bh
->
b_blocknr
,
7
,
rb
->
rf_signature
);
return
-
EINVAL
;
}
if
(
le64_to_cpu
(
rb
->
rf_blkno
)
!=
bh
->
b_blocknr
)
{
ocfs2_error
(
sb
,
"Refcount block #%llu has an invalid rf_blkno "
"of %llu"
,
(
unsigned
long
long
)
bh
->
b_blocknr
,
(
unsigned
long
long
)
le64_to_cpu
(
rb
->
rf_blkno
));
return
-
EINVAL
;
}
if
(
le32_to_cpu
(
rb
->
rf_fs_generation
)
!=
OCFS2_SB
(
sb
)
->
fs_generation
)
{
ocfs2_error
(
sb
,
"Refcount block #%llu has an invalid "
"rf_fs_generation of #%u"
,
(
unsigned
long
long
)
bh
->
b_blocknr
,
le32_to_cpu
(
rb
->
rf_fs_generation
));
return
-
EINVAL
;
}
return
0
;
}
static
int
ocfs2_read_refcount_block
(
struct
ocfs2_caching_info
*
ci
,
u64
rb_blkno
,
struct
buffer_head
**
bh
)
{
int
rc
;
struct
buffer_head
*
tmp
=
*
bh
;
rc
=
ocfs2_read_block
(
ci
,
rb_blkno
,
&
tmp
,
ocfs2_validate_refcount_block
);
/* If ocfs2_read_block() got us a new bh, pass it up. */
if
(
!
rc
&&
!*
bh
)
*
bh
=
tmp
;
return
rc
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录