Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
2489dbab
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
2489dbab
编写于
12月 11, 2017
作者:
J
Jeff Layton
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fat: convert to new i_version API
Signed-off-by:
N
Jeff Layton
<
jlayton@redhat.com
>
上级
7594c461
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
19 deletion
+22
-19
fs/fat/dir.c
fs/fat/dir.c
+2
-1
fs/fat/inode.c
fs/fat/inode.c
+5
-4
fs/fat/namei_msdos.c
fs/fat/namei_msdos.c
+4
-3
fs/fat/namei_vfat.c
fs/fat/namei_vfat.c
+11
-11
未找到文件。
fs/fat/dir.c
浏览文件 @
2489dbab
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/compat.h>
#include <linux/compat.h>
#include <linux/uaccess.h>
#include <linux/uaccess.h>
#include <linux/iversion.h>
#include "fat.h"
#include "fat.h"
/*
/*
...
@@ -1055,7 +1056,7 @@ int fat_remove_entries(struct inode *dir, struct fat_slot_info *sinfo)
...
@@ -1055,7 +1056,7 @@ int fat_remove_entries(struct inode *dir, struct fat_slot_info *sinfo)
brelse
(
bh
);
brelse
(
bh
);
if
(
err
)
if
(
err
)
return
err
;
return
err
;
dir
->
i_version
++
;
inode_inc_iversion
(
dir
)
;
if
(
nr_slots
)
{
if
(
nr_slots
)
{
/*
/*
...
...
fs/fat/inode.c
浏览文件 @
2489dbab
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include <linux/blkdev.h>
#include <linux/blkdev.h>
#include <linux/backing-dev.h>
#include <linux/backing-dev.h>
#include <asm/unaligned.h>
#include <asm/unaligned.h>
#include <linux/iversion.h>
#include "fat.h"
#include "fat.h"
#ifndef CONFIG_FAT_DEFAULT_IOCHARSET
#ifndef CONFIG_FAT_DEFAULT_IOCHARSET
...
@@ -507,7 +508,7 @@ int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de)
...
@@ -507,7 +508,7 @@ int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de)
MSDOS_I
(
inode
)
->
i_pos
=
0
;
MSDOS_I
(
inode
)
->
i_pos
=
0
;
inode
->
i_uid
=
sbi
->
options
.
fs_uid
;
inode
->
i_uid
=
sbi
->
options
.
fs_uid
;
inode
->
i_gid
=
sbi
->
options
.
fs_gid
;
inode
->
i_gid
=
sbi
->
options
.
fs_gid
;
inode
->
i_version
++
;
inode
_inc_iversion
(
inode
)
;
inode
->
i_generation
=
get_seconds
();
inode
->
i_generation
=
get_seconds
();
if
((
de
->
attr
&
ATTR_DIR
)
&&
!
IS_FREE
(
de
->
name
))
{
if
((
de
->
attr
&
ATTR_DIR
)
&&
!
IS_FREE
(
de
->
name
))
{
...
@@ -590,7 +591,7 @@ struct inode *fat_build_inode(struct super_block *sb,
...
@@ -590,7 +591,7 @@ struct inode *fat_build_inode(struct super_block *sb,
goto
out
;
goto
out
;
}
}
inode
->
i_ino
=
iunique
(
sb
,
MSDOS_ROOT_INO
);
inode
->
i_ino
=
iunique
(
sb
,
MSDOS_ROOT_INO
);
inode
->
i_version
=
1
;
inode
_set_iversion
(
inode
,
1
)
;
err
=
fat_fill_inode
(
inode
,
de
);
err
=
fat_fill_inode
(
inode
,
de
);
if
(
err
)
{
if
(
err
)
{
iput
(
inode
);
iput
(
inode
);
...
@@ -1377,7 +1378,7 @@ static int fat_read_root(struct inode *inode)
...
@@ -1377,7 +1378,7 @@ static int fat_read_root(struct inode *inode)
MSDOS_I
(
inode
)
->
i_pos
=
MSDOS_ROOT_INO
;
MSDOS_I
(
inode
)
->
i_pos
=
MSDOS_ROOT_INO
;
inode
->
i_uid
=
sbi
->
options
.
fs_uid
;
inode
->
i_uid
=
sbi
->
options
.
fs_uid
;
inode
->
i_gid
=
sbi
->
options
.
fs_gid
;
inode
->
i_gid
=
sbi
->
options
.
fs_gid
;
inode
->
i_version
++
;
inode
_inc_iversion
(
inode
)
;
inode
->
i_generation
=
0
;
inode
->
i_generation
=
0
;
inode
->
i_mode
=
fat_make_mode
(
sbi
,
ATTR_DIR
,
S_IRWXUGO
);
inode
->
i_mode
=
fat_make_mode
(
sbi
,
ATTR_DIR
,
S_IRWXUGO
);
inode
->
i_op
=
sbi
->
dir_ops
;
inode
->
i_op
=
sbi
->
dir_ops
;
...
@@ -1828,7 +1829,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat,
...
@@ -1828,7 +1829,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat,
if
(
!
root_inode
)
if
(
!
root_inode
)
goto
out_fail
;
goto
out_fail
;
root_inode
->
i_ino
=
MSDOS_ROOT_INO
;
root_inode
->
i_ino
=
MSDOS_ROOT_INO
;
root_inode
->
i_version
=
1
;
inode_set_iversion
(
root_inode
,
1
)
;
error
=
fat_read_root
(
root_inode
);
error
=
fat_read_root
(
root_inode
);
if
(
error
<
0
)
{
if
(
error
<
0
)
{
iput
(
root_inode
);
iput
(
root_inode
);
...
...
fs/fat/namei_msdos.c
浏览文件 @
2489dbab
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
*/
*/
#include <linux/module.h>
#include <linux/module.h>
#include <linux/iversion.h>
#include "fat.h"
#include "fat.h"
/* Characters that are undesirable in an MS-DOS file name */
/* Characters that are undesirable in an MS-DOS file name */
...
@@ -480,7 +481,7 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name,
...
@@ -480,7 +481,7 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name,
}
else
}
else
mark_inode_dirty
(
old_inode
);
mark_inode_dirty
(
old_inode
);
old_dir
->
i_version
++
;
inode_inc_iversion
(
old_dir
)
;
old_dir
->
i_ctime
=
old_dir
->
i_mtime
=
current_time
(
old_dir
);
old_dir
->
i_ctime
=
old_dir
->
i_mtime
=
current_time
(
old_dir
);
if
(
IS_DIRSYNC
(
old_dir
))
if
(
IS_DIRSYNC
(
old_dir
))
(
void
)
fat_sync_inode
(
old_dir
);
(
void
)
fat_sync_inode
(
old_dir
);
...
@@ -508,7 +509,7 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name,
...
@@ -508,7 +509,7 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name,
goto
out
;
goto
out
;
new_i_pos
=
sinfo
.
i_pos
;
new_i_pos
=
sinfo
.
i_pos
;
}
}
new_dir
->
i_version
++
;
inode_inc_iversion
(
new_dir
)
;
fat_detach
(
old_inode
);
fat_detach
(
old_inode
);
fat_attach
(
old_inode
,
new_i_pos
);
fat_attach
(
old_inode
,
new_i_pos
);
...
@@ -540,7 +541,7 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name,
...
@@ -540,7 +541,7 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name,
old_sinfo
.
bh
=
NULL
;
old_sinfo
.
bh
=
NULL
;
if
(
err
)
if
(
err
)
goto
error_dotdot
;
goto
error_dotdot
;
old_dir
->
i_version
++
;
inode_inc_iversion
(
old_dir
)
;
old_dir
->
i_ctime
=
old_dir
->
i_mtime
=
ts
;
old_dir
->
i_ctime
=
old_dir
->
i_mtime
=
ts
;
if
(
IS_DIRSYNC
(
old_dir
))
if
(
IS_DIRSYNC
(
old_dir
))
(
void
)
fat_sync_inode
(
old_dir
);
(
void
)
fat_sync_inode
(
old_dir
);
...
...
fs/fat/namei_vfat.c
浏览文件 @
2489dbab
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/namei.h>
#include <linux/namei.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/iversion.h>
#include "fat.h"
#include "fat.h"
static
inline
unsigned
long
vfat_d_version
(
struct
dentry
*
dentry
)
static
inline
unsigned
long
vfat_d_version
(
struct
dentry
*
dentry
)
...
@@ -46,7 +46,7 @@ static int vfat_revalidate_shortname(struct dentry *dentry)
...
@@ -46,7 +46,7 @@ static int vfat_revalidate_shortname(struct dentry *dentry)
{
{
int
ret
=
1
;
int
ret
=
1
;
spin_lock
(
&
dentry
->
d_lock
);
spin_lock
(
&
dentry
->
d_lock
);
if
(
vfat_d_version
(
dentry
)
!=
d_inode
(
dentry
->
d_parent
)
->
i_version
)
if
(
inode_cmp_iversion
(
d_inode
(
dentry
->
d_parent
),
vfat_d_version
(
dentry
))
)
ret
=
0
;
ret
=
0
;
spin_unlock
(
&
dentry
->
d_lock
);
spin_unlock
(
&
dentry
->
d_lock
);
return
ret
;
return
ret
;
...
@@ -759,7 +759,7 @@ static struct dentry *vfat_lookup(struct inode *dir, struct dentry *dentry,
...
@@ -759,7 +759,7 @@ static struct dentry *vfat_lookup(struct inode *dir, struct dentry *dentry,
out:
out:
mutex_unlock
(
&
MSDOS_SB
(
sb
)
->
s_lock
);
mutex_unlock
(
&
MSDOS_SB
(
sb
)
->
s_lock
);
if
(
!
inode
)
if
(
!
inode
)
vfat_d_version_set
(
dentry
,
dir
->
i_version
);
vfat_d_version_set
(
dentry
,
inode_query_iversion
(
dir
)
);
return
d_splice_alias
(
inode
,
dentry
);
return
d_splice_alias
(
inode
,
dentry
);
error:
error:
mutex_unlock
(
&
MSDOS_SB
(
sb
)
->
s_lock
);
mutex_unlock
(
&
MSDOS_SB
(
sb
)
->
s_lock
);
...
@@ -781,7 +781,7 @@ static int vfat_create(struct inode *dir, struct dentry *dentry, umode_t mode,
...
@@ -781,7 +781,7 @@ static int vfat_create(struct inode *dir, struct dentry *dentry, umode_t mode,
err
=
vfat_add_entry
(
dir
,
&
dentry
->
d_name
,
0
,
0
,
&
ts
,
&
sinfo
);
err
=
vfat_add_entry
(
dir
,
&
dentry
->
d_name
,
0
,
0
,
&
ts
,
&
sinfo
);
if
(
err
)
if
(
err
)
goto
out
;
goto
out
;
dir
->
i_version
++
;
inode_inc_iversion
(
dir
)
;
inode
=
fat_build_inode
(
sb
,
sinfo
.
de
,
sinfo
.
i_pos
);
inode
=
fat_build_inode
(
sb
,
sinfo
.
de
,
sinfo
.
i_pos
);
brelse
(
sinfo
.
bh
);
brelse
(
sinfo
.
bh
);
...
@@ -789,7 +789,7 @@ static int vfat_create(struct inode *dir, struct dentry *dentry, umode_t mode,
...
@@ -789,7 +789,7 @@ static int vfat_create(struct inode *dir, struct dentry *dentry, umode_t mode,
err
=
PTR_ERR
(
inode
);
err
=
PTR_ERR
(
inode
);
goto
out
;
goto
out
;
}
}
inode
->
i_version
++
;
inode
_inc_iversion
(
inode
)
;
inode
->
i_mtime
=
inode
->
i_atime
=
inode
->
i_ctime
=
ts
;
inode
->
i_mtime
=
inode
->
i_atime
=
inode
->
i_ctime
=
ts
;
/* timestamp is already written, so mark_inode_dirty() is unneeded. */
/* timestamp is already written, so mark_inode_dirty() is unneeded. */
...
@@ -823,7 +823,7 @@ static int vfat_rmdir(struct inode *dir, struct dentry *dentry)
...
@@ -823,7 +823,7 @@ static int vfat_rmdir(struct inode *dir, struct dentry *dentry)
clear_nlink
(
inode
);
clear_nlink
(
inode
);
inode
->
i_mtime
=
inode
->
i_atime
=
current_time
(
inode
);
inode
->
i_mtime
=
inode
->
i_atime
=
current_time
(
inode
);
fat_detach
(
inode
);
fat_detach
(
inode
);
vfat_d_version_set
(
dentry
,
dir
->
i_version
);
vfat_d_version_set
(
dentry
,
inode_query_iversion
(
dir
)
);
out:
out:
mutex_unlock
(
&
MSDOS_SB
(
sb
)
->
s_lock
);
mutex_unlock
(
&
MSDOS_SB
(
sb
)
->
s_lock
);
...
@@ -849,7 +849,7 @@ static int vfat_unlink(struct inode *dir, struct dentry *dentry)
...
@@ -849,7 +849,7 @@ static int vfat_unlink(struct inode *dir, struct dentry *dentry)
clear_nlink
(
inode
);
clear_nlink
(
inode
);
inode
->
i_mtime
=
inode
->
i_atime
=
current_time
(
inode
);
inode
->
i_mtime
=
inode
->
i_atime
=
current_time
(
inode
);
fat_detach
(
inode
);
fat_detach
(
inode
);
vfat_d_version_set
(
dentry
,
dir
->
i_version
);
vfat_d_version_set
(
dentry
,
inode_query_iversion
(
dir
)
);
out:
out:
mutex_unlock
(
&
MSDOS_SB
(
sb
)
->
s_lock
);
mutex_unlock
(
&
MSDOS_SB
(
sb
)
->
s_lock
);
...
@@ -875,7 +875,7 @@ static int vfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
...
@@ -875,7 +875,7 @@ static int vfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
err
=
vfat_add_entry
(
dir
,
&
dentry
->
d_name
,
1
,
cluster
,
&
ts
,
&
sinfo
);
err
=
vfat_add_entry
(
dir
,
&
dentry
->
d_name
,
1
,
cluster
,
&
ts
,
&
sinfo
);
if
(
err
)
if
(
err
)
goto
out_free
;
goto
out_free
;
dir
->
i_version
++
;
inode_inc_iversion
(
dir
)
;
inc_nlink
(
dir
);
inc_nlink
(
dir
);
inode
=
fat_build_inode
(
sb
,
sinfo
.
de
,
sinfo
.
i_pos
);
inode
=
fat_build_inode
(
sb
,
sinfo
.
de
,
sinfo
.
i_pos
);
...
@@ -885,7 +885,7 @@ static int vfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
...
@@ -885,7 +885,7 @@ static int vfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
/* the directory was completed, just return a error */
/* the directory was completed, just return a error */
goto
out
;
goto
out
;
}
}
inode
->
i_version
++
;
inode
_inc_iversion
(
inode
)
;
set_nlink
(
inode
,
2
);
set_nlink
(
inode
,
2
);
inode
->
i_mtime
=
inode
->
i_atime
=
inode
->
i_ctime
=
ts
;
inode
->
i_mtime
=
inode
->
i_atime
=
inode
->
i_ctime
=
ts
;
/* timestamp is already written, so mark_inode_dirty() is unneeded. */
/* timestamp is already written, so mark_inode_dirty() is unneeded. */
...
@@ -951,7 +951,7 @@ static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry,
...
@@ -951,7 +951,7 @@ static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry,
goto
out
;
goto
out
;
new_i_pos
=
sinfo
.
i_pos
;
new_i_pos
=
sinfo
.
i_pos
;
}
}
new_dir
->
i_version
++
;
inode_inc_iversion
(
new_dir
)
;
fat_detach
(
old_inode
);
fat_detach
(
old_inode
);
fat_attach
(
old_inode
,
new_i_pos
);
fat_attach
(
old_inode
,
new_i_pos
);
...
@@ -979,7 +979,7 @@ static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry,
...
@@ -979,7 +979,7 @@ static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry,
old_sinfo
.
bh
=
NULL
;
old_sinfo
.
bh
=
NULL
;
if
(
err
)
if
(
err
)
goto
error_dotdot
;
goto
error_dotdot
;
old_dir
->
i_version
++
;
inode_inc_iversion
(
old_dir
)
;
old_dir
->
i_ctime
=
old_dir
->
i_mtime
=
ts
;
old_dir
->
i_ctime
=
old_dir
->
i_mtime
=
ts
;
if
(
IS_DIRSYNC
(
old_dir
))
if
(
IS_DIRSYNC
(
old_dir
))
(
void
)
fat_sync_inode
(
old_dir
);
(
void
)
fat_sync_inode
(
old_dir
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录