Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
KED Linux Kernel Fork
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KED Software Projects
Miscellaneous
KED Linux Kernel Fork
Commits
336fb3b9
Commit
336fb3b9
authored
14 years ago
by
Al Viro
Browse files
Options
Downloads
Patches
Plain Diff
update VFS documentation for method changes.
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
b70a3e07
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Documentation/filesystems/Locking
+12
-10
12 additions, 10 deletions
Documentation/filesystems/Locking
Documentation/filesystems/porting
+27
-0
27 additions, 0 deletions
Documentation/filesystems/porting
with
39 additions
and
10 deletions
Documentation/filesystems/Locking
+
12
−
10
View file @
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
...
...
This diff is collapsed.
Click to expand it.
Documentation/filesystems/porting
+
27
−
0
View file @
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.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment