Commit Graph

201859 Commits

Author SHA1 Message Date
Al Viro
45321ac543 Make ->drop_inode() just return whether inode needs to be dropped
... and let iput_final() do the actual eviction or retention

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:35 -04:00
Al Viro
30140837f2 fs/inode.c:clear_inode() is gone
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:34 -04:00
Al Viro
644da5960d fs/inode.c:evict() doesn't care about delete vs. non-delete paths now
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:33 -04:00
Al Viro
07958f9f5b ->delete_inode() is gone
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:31 -04:00
Al Viro
0930fcc1ee convert ext4 to ->evict_inode()
pretty much brute-force...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:30 -04:00
Al Viro
7da08fd17a convert logfs to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:28 -04:00
Al Viro
8e22c1a4e4 logfs: get rid of magical inodes
ordering problems at ->kill_sb() time are solved by doing iput()
of these suckers in ->put_super()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:26 -04:00
Al Viro
6fd1e5c994 convert nilfs2 to ->evict_inode()
[folded build fix from sfr]

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:25 -04:00
Al Viro
4ec70c9b46 convert exofs to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:24 -04:00
Al Viro
845a2cc050 convert reiserfs to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:23 -04:00
Al Viro
bd55597520 convert btrfs to ->evict_inode()
NB: do we want btrfs_wait_ordered_range() on eviction of
inodes with positive i_nlink on subvolume with zero root_refs?
If not, btrfs_evict_inode() can be simplified by unconditionally
bailing out in case of i_nlink > 0 in the very beginning...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:22 -04:00
Al Viro
d5c1515cf3 switch gfs2 to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:21 -04:00
Al Viro
066d92dcbf convert ocfs2 to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:21 -04:00
Al Viro
94ee8494ac switch ncpfs to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:20 -04:00
Al Viro
3aac2b62e0 switch udf to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:19 -04:00
Al Viro
d640e1b508 switch ubifs to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:18 -04:00
Al Viro
62aff86fdf switch jfs to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:17 -04:00
Al Viro
ea54400920 switch hpfs to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:17 -04:00
Al Viro
33b0daaa55 switch hppfs to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:16 -04:00
Al Viro
f8ad850f11 try to get rid of races in hostfs open()
In case of mode mismatch, do *not* blindly close the descriptor
another openers might be using right now.  Open the underlying
file with currently sufficient mode, then
	* if current mode has grown so that it's sufficient for
us now, just close our new fd
	* if current mode has grown and our fd is *not* enough
to cover it, close and repeat.
	* otherwise, install our fd if the file hadn't been
opened at all or dup2() our fd over the current one (and close
our fd).
Critical section is protected by mutex; yes, system-wide.  All
we do under it is a bunch of comparison and maybe an overwriting
dup2() on host.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:15 -04:00
Al Viro
f8d7e1877e leak in hostfs_unlink()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:14 -04:00
Al Viro
e9193059b1 hostfs: fix races in dentry_name() and inode_name()
calculating size, then doing allocation, then filling the
path is a Bad Idea(tm), since the ancestors can be renamed,
leading to buffer overrun.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:14 -04:00
Al Viro
c103135c14 new helper: __dentry_path()
builds path relative to fs root, called under dcache_lock,
doesn't append any nonsense to unlinked ones.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:13 -04:00
Al Viro
d0352d3ed7 hostfs: sanitize symlinks
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:12 -04:00
Al Viro
c5322220eb hostfs: get rid of inode_dentry_name()
it's equivalent to dentry_name() anyway

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:11 -04:00
Al Viro
4754b82557 hostfs: get rid of file_type(), fold init_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:10 -04:00
Al Viro
39b743c619 switch stat_file() to passing a single struct rather than fsckloads of pointers
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:10 -04:00
Al Viro
5e2df28cc6 hostfs: pass pathname to init_inode()
We will calculate it in all callers anyway, so there's no
need to duplicate that inside.  Moreover, that way we lose
all failure exits in init_inode(), so it doesn't need to
return anything.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:09 -04:00
Al Viro
52b209f7b8 get rid of hostfs_read_inode()
There are only two call sites; in one (hostfs_iget()) it's actually
a no-op and in another (fill_super()) it's easier to expand the
damn thing and use what we know about its arguments to simplify
it.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:08 -04:00
Al Viro
601d2c38b9 hostfs: don't keep a field in each inode when we are using it only in root
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:07 -04:00
Al Viro
e971a6d7b9 stop icache pollution in hostfs, switch to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:06 -04:00
Al Viro
f053ddde75 switch affs to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:06 -04:00
Al Viro
69c9e75017 switch omfs to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:05 -04:00
Al Viro
9df2f85128 switch bfs to ->evict_inode(), clean up
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:04 -04:00
Al Viro
ac14a95b52 convert ext3 to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:03 -04:00
Al Viro
0f3f63a470 spufs conversion to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:02 -04:00
Al Viro
58e8268c7b switch ufs to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:02 -04:00
Al Viro
deee3ce466 covert fatfs to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:01 -04:00
Al Viro
d3b4f9ae18 switch smbfs to evict_inode()
NB: treatment of inode hash is completely braindead there

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:48:00 -04:00
Al Viro
d299eadc09 switch sysv to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:47:59 -04:00
Al Viro
1f895f75dc switch shmem.c to ->evice_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:47:59 -04:00
Al Viro
6d8af64c1c switch mqueue to ->evict_inode()
... and since the inodes are never hashed, we can use default ->drop_inode()
just fine.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:47:58 -04:00
Al Viro
72edc4d087 merge ext2 delete_inode and clear_inode, switch to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:47:57 -04:00
Al Viro
3937871d91 Don't dirty the victim in ext2_xattr_delete_inode()
... it's beyond fs-writeback reach already - writeback won't
be started at that point.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:47:56 -04:00
Al Viro
addacc7d6f Take dirtying the inode to callers of ext2_free_blocks()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:47:55 -04:00
Al Viro
3889717d28 ext2: switch to dquot_free_block_nodirty()
brute-force conversion

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:47:54 -04:00
Al Viro
5ccb4a78d8 switch minix to ->evict_inode(), fix write_inode/delete_inode race
We need to wait for completion of possible writeback in progress
before we clear on-disk inode during deletion.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:47:53 -04:00
Al Viro
01cd9fef6e switch sysfs to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:47:53 -04:00
Al Viro
8267952b36 switch procfs to ->evict_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:47:52 -04:00
Al Viro
77b8a75f5b simplify get_cramfs_inode()
simply don't hash the inodes that don't have real inumber instead of
skipping them during iget5_locked(); as the result, simple iget_locked()
would do and we can get rid of cramfs ->drop_inode() as well.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09 16:47:51 -04:00