Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
abbede1b
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
abbede1b
编写于
7月 26, 2011
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xfs: get rid of open-coded S_ISREG(), etc.
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
c46c8877
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
33 addition
and
34 deletion
+33
-34
fs/xfs/linux-2.6/xfs_ioctl.c
fs/xfs/linux-2.6/xfs_ioctl.c
+2
-2
fs/xfs/xfs_bmap.c
fs/xfs/xfs_bmap.c
+3
-4
fs/xfs/xfs_dir2.c
fs/xfs/xfs_dir2.c
+8
-8
fs/xfs/xfs_filestream.c
fs/xfs/xfs_filestream.c
+1
-1
fs/xfs/xfs_inode.c
fs/xfs/xfs_inode.c
+8
-8
fs/xfs/xfs_inode.h
fs/xfs/xfs_inode.h
+1
-1
fs/xfs/xfs_log_recover.c
fs/xfs/xfs_log_recover.c
+2
-2
fs/xfs/xfs_mount.c
fs/xfs/xfs_mount.c
+1
-1
fs/xfs/xfs_rename.c
fs/xfs/xfs_rename.c
+2
-2
fs/xfs/xfs_vnodeops.c
fs/xfs/xfs_vnodeops.c
+5
-5
未找到文件。
fs/xfs/linux-2.6/xfs_ioctl.c
浏览文件 @
abbede1b
...
...
@@ -850,14 +850,14 @@ xfs_set_diflags(
di_flags
|=
XFS_DIFLAG_NODEFRAG
;
if
(
xflags
&
XFS_XFLAG_FILESTREAM
)
di_flags
|=
XFS_DIFLAG_FILESTREAM
;
if
(
(
ip
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFDIR
)
{
if
(
S_ISDIR
(
ip
->
i_d
.
di_mode
)
)
{
if
(
xflags
&
XFS_XFLAG_RTINHERIT
)
di_flags
|=
XFS_DIFLAG_RTINHERIT
;
if
(
xflags
&
XFS_XFLAG_NOSYMLINKS
)
di_flags
|=
XFS_DIFLAG_NOSYMLINKS
;
if
(
xflags
&
XFS_XFLAG_EXTSZINHERIT
)
di_flags
|=
XFS_DIFLAG_EXTSZINHERIT
;
}
else
if
(
(
ip
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFREG
)
{
}
else
if
(
S_ISREG
(
ip
->
i_d
.
di_mode
)
)
{
if
(
xflags
&
XFS_XFLAG_REALTIME
)
di_flags
|=
XFS_DIFLAG_REALTIME
;
if
(
xflags
&
XFS_XFLAG_EXTSIZE
)
...
...
fs/xfs/xfs_bmap.c
浏览文件 @
abbede1b
...
...
@@ -414,7 +414,7 @@ xfs_bmap_add_attrfork_local(
if
(
ip
->
i_df
.
if_bytes
<=
XFS_IFORK_DSIZE
(
ip
))
return
0
;
if
(
(
ip
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFDIR
)
{
if
(
S_ISDIR
(
ip
->
i_d
.
di_mode
)
)
{
mp
=
ip
->
i_mount
;
memset
(
&
dargs
,
0
,
sizeof
(
dargs
));
dargs
.
dp
=
ip
;
...
...
@@ -3344,8 +3344,7 @@ xfs_bmap_local_to_extents(
* We don't want to deal with the case of keeping inode data inline yet.
* So sending the data fork of a regular inode is invalid.
*/
ASSERT
(
!
((
ip
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFREG
&&
whichfork
==
XFS_DATA_FORK
));
ASSERT
(
!
(
S_ISREG
(
ip
->
i_d
.
di_mode
)
&&
whichfork
==
XFS_DATA_FORK
));
ifp
=
XFS_IFORK_PTR
(
ip
,
whichfork
);
ASSERT
(
XFS_IFORK_FORMAT
(
ip
,
whichfork
)
==
XFS_DINODE_FMT_LOCAL
);
flags
=
0
;
...
...
@@ -4052,7 +4051,7 @@ xfs_bmap_one_block(
#ifndef DEBUG
if
(
whichfork
==
XFS_DATA_FORK
)
{
return
((
ip
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFREG
)
?
return
S_ISREG
(
ip
->
i_d
.
di_mode
)
?
(
ip
->
i_size
==
ip
->
i_mount
->
m_sb
.
sb_blocksize
)
:
(
ip
->
i_d
.
di_size
==
ip
->
i_mount
->
m_sb
.
sb_blocksize
);
}
...
...
fs/xfs/xfs_dir2.c
浏览文件 @
abbede1b
...
...
@@ -121,7 +121,7 @@ xfs_dir_isempty(
{
xfs_dir2_sf_hdr_t
*
sfp
;
ASSERT
(
(
dp
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFDIR
);
ASSERT
(
S_ISDIR
(
dp
->
i_d
.
di_mode
)
);
if
(
dp
->
i_d
.
di_size
==
0
)
/* might happen during shutdown. */
return
1
;
if
(
dp
->
i_d
.
di_size
>
XFS_IFORK_DSIZE
(
dp
))
...
...
@@ -179,7 +179,7 @@ xfs_dir_init(
memset
((
char
*
)
&
args
,
0
,
sizeof
(
args
));
args
.
dp
=
dp
;
args
.
trans
=
tp
;
ASSERT
(
(
dp
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFDIR
);
ASSERT
(
S_ISDIR
(
dp
->
i_d
.
di_mode
)
);
if
((
error
=
xfs_dir_ino_validate
(
tp
->
t_mountp
,
pdp
->
i_ino
)))
return
error
;
return
xfs_dir2_sf_create
(
&
args
,
pdp
->
i_ino
);
...
...
@@ -202,7 +202,7 @@ xfs_dir_createname(
int
rval
;
int
v
;
/* type-checking value */
ASSERT
(
(
dp
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFDIR
);
ASSERT
(
S_ISDIR
(
dp
->
i_d
.
di_mode
)
);
if
((
rval
=
xfs_dir_ino_validate
(
tp
->
t_mountp
,
inum
)))
return
rval
;
XFS_STATS_INC
(
xs_dir_create
);
...
...
@@ -278,7 +278,7 @@ xfs_dir_lookup(
int
rval
;
int
v
;
/* type-checking value */
ASSERT
(
(
dp
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFDIR
);
ASSERT
(
S_ISDIR
(
dp
->
i_d
.
di_mode
)
);
XFS_STATS_INC
(
xs_dir_lookup
);
memset
(
&
args
,
0
,
sizeof
(
xfs_da_args_t
));
...
...
@@ -333,7 +333,7 @@ xfs_dir_removename(
int
rval
;
int
v
;
/* type-checking value */
ASSERT
(
(
dp
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFDIR
);
ASSERT
(
S_ISDIR
(
dp
->
i_d
.
di_mode
)
);
XFS_STATS_INC
(
xs_dir_remove
);
memset
(
&
args
,
0
,
sizeof
(
xfs_da_args_t
));
...
...
@@ -382,7 +382,7 @@ xfs_readdir(
if
(
XFS_FORCED_SHUTDOWN
(
dp
->
i_mount
))
return
XFS_ERROR
(
EIO
);
ASSERT
(
(
dp
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFDIR
);
ASSERT
(
S_ISDIR
(
dp
->
i_d
.
di_mode
)
);
XFS_STATS_INC
(
xs_dir_getdents
);
if
(
dp
->
i_d
.
di_format
==
XFS_DINODE_FMT_LOCAL
)
...
...
@@ -414,7 +414,7 @@ xfs_dir_replace(
int
rval
;
int
v
;
/* type-checking value */
ASSERT
(
(
dp
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFDIR
);
ASSERT
(
S_ISDIR
(
dp
->
i_d
.
di_mode
)
);
if
((
rval
=
xfs_dir_ino_validate
(
tp
->
t_mountp
,
inum
)))
return
rval
;
...
...
@@ -464,7 +464,7 @@ xfs_dir_canenter(
if
(
resblks
)
return
0
;
ASSERT
(
(
dp
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFDIR
);
ASSERT
(
S_ISDIR
(
dp
->
i_d
.
di_mode
)
);
memset
(
&
args
,
0
,
sizeof
(
xfs_da_args_t
));
args
.
name
=
name
->
name
;
...
...
fs/xfs/xfs_filestream.c
浏览文件 @
abbede1b
...
...
@@ -344,7 +344,7 @@ _xfs_filestream_update_ag(
* Either ip is a regular file and pip is a directory, or ip is a
* directory and pip is NULL.
*/
ASSERT
(
ip
&&
((
(
ip
->
i_d
.
di_mode
&
S_IFREG
)
&&
pip
&&
ASSERT
(
ip
&&
((
S_ISREG
(
ip
->
i_d
.
di_mode
)
&&
pip
&&
(
pip
->
i_d
.
di_mode
&
S_IFDIR
))
||
((
ip
->
i_d
.
di_mode
&
S_IFDIR
)
&&
!
pip
)));
...
...
fs/xfs/xfs_inode.c
浏览文件 @
abbede1b
...
...
@@ -368,7 +368,7 @@ xfs_iformat(
/*
* no local regular files yet
*/
if
(
unlikely
(
(
be16_to_cpu
(
dip
->
di_mode
)
&
S_IFMT
)
==
S_IFREG
))
{
if
(
unlikely
(
S_ISREG
(
be16_to_cpu
(
dip
->
di_mode
))
))
{
xfs_warn
(
ip
->
i_mount
,
"corrupt inode %Lu (local format for regular file)."
,
(
unsigned
long
long
)
ip
->
i_ino
);
...
...
@@ -1040,7 +1040,7 @@ xfs_ialloc(
if
(
pip
&&
XFS_INHERIT_GID
(
pip
))
{
ip
->
i_d
.
di_gid
=
pip
->
i_d
.
di_gid
;
if
((
pip
->
i_d
.
di_mode
&
S_ISGID
)
&&
(
mode
&
S_IFMT
)
==
S_IFDIR
)
{
if
((
pip
->
i_d
.
di_mode
&
S_ISGID
)
&&
S_ISDIR
(
mode
)
)
{
ip
->
i_d
.
di_mode
|=
S_ISGID
;
}
}
...
...
@@ -1097,14 +1097,14 @@ xfs_ialloc(
if
(
pip
&&
(
pip
->
i_d
.
di_flags
&
XFS_DIFLAG_ANY
))
{
uint
di_flags
=
0
;
if
(
(
mode
&
S_IFMT
)
==
S_IFDIR
)
{
if
(
S_ISDIR
(
mode
)
)
{
if
(
pip
->
i_d
.
di_flags
&
XFS_DIFLAG_RTINHERIT
)
di_flags
|=
XFS_DIFLAG_RTINHERIT
;
if
(
pip
->
i_d
.
di_flags
&
XFS_DIFLAG_EXTSZINHERIT
)
{
di_flags
|=
XFS_DIFLAG_EXTSZINHERIT
;
ip
->
i_d
.
di_extsize
=
pip
->
i_d
.
di_extsize
;
}
}
else
if
(
(
mode
&
S_IFMT
)
==
S_IFREG
)
{
}
else
if
(
S_ISREG
(
mode
)
)
{
if
(
pip
->
i_d
.
di_flags
&
XFS_DIFLAG_RTINHERIT
)
di_flags
|=
XFS_DIFLAG_REALTIME
;
if
(
pip
->
i_d
.
di_flags
&
XFS_DIFLAG_EXTSZINHERIT
)
{
...
...
@@ -1188,7 +1188,7 @@ xfs_isize_check(
int
nimaps
;
xfs_bmbt_irec_t
imaps
[
2
];
if
(
(
ip
->
i_d
.
di_mode
&
S_IFMT
)
!=
S_IFREG
)
if
(
!
S_ISREG
(
ip
->
i_d
.
di_mode
)
)
return
;
if
(
XFS_IS_REALTIME_INODE
(
ip
))
...
...
@@ -1828,7 +1828,7 @@ xfs_ifree(
ASSERT
(
ip
->
i_d
.
di_nextents
==
0
);
ASSERT
(
ip
->
i_d
.
di_anextents
==
0
);
ASSERT
((
ip
->
i_d
.
di_size
==
0
&&
ip
->
i_size
==
0
)
||
(
(
ip
->
i_d
.
di_mode
&
S_IFMT
)
!=
S_IFREG
));
(
!
S_ISREG
(
ip
->
i_d
.
di_mode
)
));
ASSERT
(
ip
->
i_d
.
di_nblocks
==
0
);
/*
...
...
@@ -2671,7 +2671,7 @@ xfs_iflush_int(
__func__
,
ip
->
i_ino
,
ip
,
ip
->
i_d
.
di_magic
);
goto
corrupt_out
;
}
if
(
(
ip
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFREG
)
{
if
(
S_ISREG
(
ip
->
i_d
.
di_mode
)
)
{
if
(
XFS_TEST_ERROR
(
(
ip
->
i_d
.
di_format
!=
XFS_DINODE_FMT_EXTENTS
)
&&
(
ip
->
i_d
.
di_format
!=
XFS_DINODE_FMT_BTREE
),
...
...
@@ -2681,7 +2681,7 @@ xfs_iflush_int(
__func__
,
ip
->
i_ino
,
ip
);
goto
corrupt_out
;
}
}
else
if
(
(
ip
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFDIR
)
{
}
else
if
(
S_ISDIR
(
ip
->
i_d
.
di_mode
)
)
{
if
(
XFS_TEST_ERROR
(
(
ip
->
i_d
.
di_format
!=
XFS_DINODE_FMT_EXTENTS
)
&&
(
ip
->
i_d
.
di_format
!=
XFS_DINODE_FMT_BTREE
)
&&
...
...
fs/xfs/xfs_inode.h
浏览文件 @
abbede1b
...
...
@@ -263,7 +263,7 @@ typedef struct xfs_inode {
struct
inode
i_vnode
;
/* embedded VFS inode */
}
xfs_inode_t
;
#define XFS_ISIZE(ip)
(((ip)->i_d.di_mode & S_IFMT) == S_IFREG
) ? \
#define XFS_ISIZE(ip)
S_ISREG((ip)->i_d.di_mode
) ? \
(ip)->i_size : (ip)->i_d.di_size;
/* Convert from vfs inode to xfs inode */
...
...
fs/xfs/xfs_log_recover.c
浏览文件 @
abbede1b
...
...
@@ -2283,7 +2283,7 @@ xlog_recover_inode_pass2(
/* Take the opportunity to reset the flush iteration count */
dicp
->
di_flushiter
=
0
;
if
(
unlikely
(
(
dicp
->
di_mode
&
S_IFMT
)
==
S_IFREG
))
{
if
(
unlikely
(
S_ISREG
(
dicp
->
di_mode
)
))
{
if
((
dicp
->
di_format
!=
XFS_DINODE_FMT_EXTENTS
)
&&
(
dicp
->
di_format
!=
XFS_DINODE_FMT_BTREE
))
{
XFS_CORRUPTION_ERROR
(
"xlog_recover_inode_pass2(3)"
,
...
...
@@ -2296,7 +2296,7 @@ xlog_recover_inode_pass2(
error
=
EFSCORRUPTED
;
goto
error
;
}
}
else
if
(
unlikely
(
(
dicp
->
di_mode
&
S_IFMT
)
==
S_IFDIR
))
{
}
else
if
(
unlikely
(
S_ISDIR
(
dicp
->
di_mode
)
))
{
if
((
dicp
->
di_format
!=
XFS_DINODE_FMT_EXTENTS
)
&&
(
dicp
->
di_format
!=
XFS_DINODE_FMT_BTREE
)
&&
(
dicp
->
di_format
!=
XFS_DINODE_FMT_LOCAL
))
{
...
...
fs/xfs/xfs_mount.c
浏览文件 @
abbede1b
...
...
@@ -1331,7 +1331,7 @@ xfs_mountfs(
ASSERT
(
rip
!=
NULL
);
if
(
unlikely
(
(
rip
->
i_d
.
di_mode
&
S_IFMT
)
!=
S_IFDIR
))
{
if
(
unlikely
(
!
S_ISDIR
(
rip
->
i_d
.
di_mode
)
))
{
xfs_warn
(
mp
,
"corrupted root inode %llu: not a directory"
,
(
unsigned
long
long
)
rip
->
i_ino
);
xfs_iunlock
(
rip
,
XFS_ILOCK_EXCL
);
...
...
fs/xfs/xfs_rename.c
浏览文件 @
abbede1b
...
...
@@ -116,7 +116,7 @@ xfs_rename(
trace_xfs_rename
(
src_dp
,
target_dp
,
src_name
,
target_name
);
new_parent
=
(
src_dp
!=
target_dp
);
src_is_directory
=
((
src_ip
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFDIR
);
src_is_directory
=
S_ISDIR
(
src_ip
->
i_d
.
di_mode
);
if
(
src_is_directory
)
{
/*
...
...
@@ -226,7 +226,7 @@ xfs_rename(
* target and source are directories and that target can be
* destroyed, or that neither is a directory.
*/
if
(
(
target_ip
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFDIR
)
{
if
(
S_ISDIR
(
target_ip
->
i_d
.
di_mode
)
)
{
/*
* Make sure target dir is empty.
*/
...
...
fs/xfs/xfs_vnodeops.c
浏览文件 @
abbede1b
...
...
@@ -121,7 +121,7 @@ xfs_readlink(
xfs_ilock
(
ip
,
XFS_ILOCK_SHARED
);
ASSERT
(
(
ip
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFLNK
);
ASSERT
(
S_ISLNK
(
ip
->
i_d
.
di_mode
)
);
ASSERT
(
ip
->
i_d
.
di_size
<=
MAXPATHLEN
);
pathlen
=
ip
->
i_d
.
di_size
;
...
...
@@ -529,7 +529,7 @@ xfs_release(
if
(
ip
->
i_d
.
di_nlink
==
0
)
return
0
;
if
((
((
ip
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFREG
)
&&
if
((
S_ISREG
(
ip
->
i_d
.
di_mode
)
&&
((
ip
->
i_size
>
0
)
||
(
VN_CACHED
(
VFS_I
(
ip
))
>
0
||
ip
->
i_delayed_blks
>
0
))
&&
(
ip
->
i_df
.
if_flags
&
XFS_IFEXTENTS
))
&&
...
...
@@ -610,7 +610,7 @@ xfs_inactive(
truncate
=
((
ip
->
i_d
.
di_nlink
==
0
)
&&
((
ip
->
i_d
.
di_size
!=
0
)
||
(
ip
->
i_size
!=
0
)
||
(
ip
->
i_d
.
di_nextents
>
0
)
||
(
ip
->
i_delayed_blks
>
0
))
&&
((
ip
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFREG
));
S_ISREG
(
ip
->
i_d
.
di_mode
));
mp
=
ip
->
i_mount
;
...
...
@@ -621,7 +621,7 @@ xfs_inactive(
goto
out
;
if
(
ip
->
i_d
.
di_nlink
!=
0
)
{
if
((
((
ip
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFREG
)
&&
if
((
S_ISREG
(
ip
->
i_d
.
di_mode
)
&&
((
ip
->
i_size
>
0
)
||
(
VN_CACHED
(
VFS_I
(
ip
))
>
0
||
ip
->
i_delayed_blks
>
0
))
&&
(
ip
->
i_df
.
if_flags
&
XFS_IFEXTENTS
)
&&
...
...
@@ -669,7 +669,7 @@ xfs_inactive(
xfs_iunlock
(
ip
,
XFS_IOLOCK_EXCL
|
XFS_ILOCK_EXCL
);
return
VN_INACTIVE_CACHE
;
}
}
else
if
(
(
ip
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFLNK
)
{
}
else
if
(
S_ISLNK
(
ip
->
i_d
.
di_mode
)
)
{
/*
* If we get an error while cleaning up a
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录