Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
336fb3b9
cloud-kernel
项目概览
openanolis
/
cloud-kernel
接近 2 年 前同步成功
通知
169
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看板
提交
336fb3b9
编写于
6月 08, 2010
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update VFS documentation for method changes.
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
b70a3e07
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
39 addition
and
10 deletion
+39
-10
Documentation/filesystems/Locking
Documentation/filesystems/Locking
+12
-10
Documentation/filesystems/porting
Documentation/filesystems/porting
+27
-0
未找到文件。
Documentation/filesystems/Locking
浏览文件 @
336fb3b9
...
@@ -92,8 +92,8 @@ prototypes:
...
@@ -92,8 +92,8 @@ prototypes:
void (*destroy_inode)(struct inode *);
void (*destroy_inode)(struct inode *);
void (*dirty_inode) (struct inode *);
void (*dirty_inode) (struct inode *);
int (*write_inode) (struct inode *, int);
int (*write_inode) (struct inode *, int);
void
(*drop_inode) (struct inode *);
int
(*drop_inode) (struct inode *);
void (*
delete
_inode) (struct inode *);
void (*
evict
_inode) (struct inode *);
void (*put_super) (struct super_block *);
void (*put_super) (struct super_block *);
void (*write_super) (struct super_block *);
void (*write_super) (struct super_block *);
int (*sync_fs)(struct super_block *sb, int wait);
int (*sync_fs)(struct super_block *sb, int wait);
...
@@ -101,14 +101,13 @@ prototypes:
...
@@ -101,14 +101,13 @@ prototypes:
int (*unfreeze_fs) (struct super_block *);
int (*unfreeze_fs) (struct super_block *);
int (*statfs) (struct dentry *, struct kstatfs *);
int (*statfs) (struct dentry *, struct kstatfs *);
int (*remount_fs) (struct super_block *, int *, char *);
int (*remount_fs) (struct super_block *, int *, char *);
void (*clear_inode) (struct inode *);
void (*umount_begin) (struct super_block *);
void (*umount_begin) (struct super_block *);
int (*show_options)(struct seq_file *, struct vfsmount *);
int (*show_options)(struct seq_file *, struct vfsmount *);
ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t);
ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t);
ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
locking rules:
locking rules:
All may block
.
All may block
[not true, see below]
None have BKL
None have BKL
s_umount
s_umount
alloc_inode:
alloc_inode:
...
@@ -116,22 +115,25 @@ destroy_inode:
...
@@ -116,22 +115,25 @@ destroy_inode:
dirty_inode: (must not sleep)
dirty_inode: (must not sleep)
write_inode:
write_inode:
drop_inode: !!!inode_lock!!!
drop_inode: !!!inode_lock!!!
delete
_inode:
evict
_inode:
put_super: write
put_super: write
write_super: read
write_super: read
sync_fs: read
sync_fs: read
freeze_fs: read
freeze_fs: read
unfreeze_fs: read
unfreeze_fs: read
statfs: no
statfs: maybe(read) (see below)
remount_fs: maybe (see below)
remount_fs: write
clear_inode:
umount_begin: no
umount_begin: no
show_options: no (namespace_sem)
show_options: no (namespace_sem)
quota_read: no (see below)
quota_read: no (see below)
quota_write: no (see below)
quota_write: no (see below)
->remount_fs() will have the s_umount exclusive lock if it's already mounted.
->statfs() has s_umount (shared) when called by ustat(2) (native or
When called from get_sb_single, it does NOT have the s_umount lock.
compat), but that's an accident of bad API; s_umount is used to pin
the superblock down when we only have dev_t given us by userland to
identify the superblock. Everything else (statfs(), fstatfs(), etc.)
doesn't hold it when calling ->statfs() - superblock is pinned down
by resolving the pathname passed to syscall.
->quota_read() and ->quota_write() functions are both guaranteed to
->quota_read() and ->quota_write() functions are both guaranteed to
be the only ones operating on the quota file by the quota code (via
be the only ones operating on the quota file by the quota code (via
dqio_sem) (unless an admin really wants to screw up something and
dqio_sem) (unless an admin really wants to screw up something and
...
...
Documentation/filesystems/porting
浏览文件 @
336fb3b9
...
@@ -291,3 +291,30 @@ be in order of zeroing blocks using block_truncate_page or similar helpers,
...
@@ -291,3 +291,30 @@ be in order of zeroing blocks using block_truncate_page or similar helpers,
size update and on finally on-disk truncation which should not fail.
size update and on finally on-disk truncation which should not fail.
inode_change_ok now includes the size checks for ATTR_SIZE and must be called
inode_change_ok now includes the size checks for ATTR_SIZE and must be called
in the beginning of ->setattr unconditionally.
in the beginning of ->setattr unconditionally.
[mandatory]
->clear_inode() and ->delete_inode() are gone; ->evict_inode() should
be used instead. It gets called whenever the inode is evicted, whether it has
remaining links or not. Caller does *not* evict the pagecache or inode-associated
metadata buffers; getting rid of those is responsibility of method, as it had
been for ->delete_inode().
->drop_inode() returns int now; it's called on final iput() with inode_lock
held and it returns true if filesystems wants the inode to be dropped. As before,
generic_drop_inode() is still the default and it's been updated appropriately.
generic_delete_inode() is also alive and it consists simply of return 1. Note that
all actual eviction work is done by caller after ->drop_inode() returns.
clear_inode() is gone; use end_writeback() instead. As before, it must
be called exactly once on each call of ->evict_inode() (as it used to be for
each call of ->delete_inode()). Unlike before, if you are using inode-associated
metadata buffers (i.e. mark_buffer_dirty_inode()), it's your responsibility to
call invalidate_inode_buffers() before end_writeback().
No async writeback (and thus no calls of ->write_inode()) will happen
after end_writeback() returns, so actions that should not overlap with ->write_inode()
(e.g. freeing on-disk inode if i_nlink is 0) ought to be done after that call.
NOTE: checking i_nlink in the beginning of ->write_inode() and bailing out
if it's zero is not *and* *never* *had* *been* enough. Final unlink() and iput()
may happen while the inode is in the middle of ->write_inode(); e.g. if you blindly
free the on-disk inode, you may end up doing that while ->write_inode() is writing
to it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录