summaryrefslogtreecommitdiffstats
path: root/fs
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | VFS: Make chown() and lchown() call fchownat()David Howells2012-07-141-34/+7Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the chown() and lchown() syscalls jump to the fchownat() syscall with the appropriate extra arguments. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | do_dentry_open(): close the race with mark_files_ro() in failure exitAl Viro2012-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | we want to take it out of mark_files_ro() reach *before* we start checking if we ought to drop write access. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | mark_files_ro(): don't bother with mntget/mntputAl Viro2012-07-141-8/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | mnt_drop_write_file() is safe under any lock Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | notify_change(): check that i_mutex is heldAndrew Morton2012-07-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Cc: Djalal Harouni <tixxdz@opendz.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | fs: add nd_jump_linkChristoph Hellwig2012-07-142-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a helper that abstracts out the jump to an already parsed struct path from ->follow_link operation from procfs. Not only does this clean up the code by moving the two sides of this game into a single helper, but it also prepares for making struct nameidata private to namei.c Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | fs: move path_put on failure out of ->follow_linkChristoph Hellwig2012-07-142-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the non-nd_set_link based versions of ->follow_link are expected to do a path_put(&nd->path) on failure. This calling convention is unexpected, undocumented and doesn't match what the nd_set_link-based instances do. Move the path_put out of the only non-nd_set_link based ->follow_link instance into the caller. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | debugfs: get rid of useless arguments to debugfs_{mkdir,symlink}Al Viro2012-07-141-11/+9Star
| | | | | | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | debugfs: fold debugfs_create_by_name() into the only callerAl Viro2012-07-141-33/+20Star
| | | | | | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | debugfs: make sure that debugfs_create_file() gets used only for regularsAl Viro2012-07-141-22/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It, debugfs_create_dir() and debugfs_create_link() use the common helper now. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | __d_unalias() should refuse to move mountpointsAl Viro2012-07-141-4/+5
| | | | | | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | sysfs: just use d_materialise_unique()Al Viro2012-07-141-8/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | same as for nfs et.al. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | sysfs: switch to ->s_d_op and ->d_release()Al Viro2012-07-143-10/+8Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a) ->d_iput() is wrong here - what we do to inode is completely usual, it's dentry->d_fsdata that we want to drop. Just use ->d_release(). b) switch to ->s_d_op - no need to play with d_set_d_op() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | get rid of kern_path_parent()Al Viro2012-07-141-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | all callers want the same thing, actually - a kinda-sorta analog of kern_path_create(). I.e. they want parent vfsmount/dentry (with ->i_mutex held, to make sure the child dentry is still their child) + the child dentry. Signed-off-by Al Viro <viro@zeniv.linux.org.uk>
| * | | VFS: Fix the banner comment on lookup_open()David Howells2012-07-141-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 197e37d9, the banner comment on lookup_open() no longer matches what the function returns. It used to return a struct file pointer or NULL and now it returns an integer and is passed the struct file pointer it is to use amongst its arguments. Update the comment to reflect this. Also add a banner comment to atomic_open(). Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | don't pass nameidata * to vfs_create()Al Viro2012-07-144-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | all we want is a boolean flag, same as the method gets now Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | don't pass nameidata to ->create()Al Viro2012-07-1445-59/+51Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | boolean "does it have to be exclusive?" flag is passed instead; Local filesystem should just ignore it - the object is guaranteed not to be there yet. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | fs/namei.c: don't pass nameidata to __lookup_hash() and lookup_real()Al Viro2012-07-141-10/+10
| | | | | | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | stop passing nameidata to ->lookup()Al Viro2012-07-1474-105/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just the flags; only NFS cares even about that, but there are legitimate uses for such argument. And getting rid of that completely would require splitting ->lookup() into a couple of methods (at least), so let's leave that alone for now... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | fs/namei.c: don't pass namedata to lookup_dcache()Al Viro2012-07-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | just the flags... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | fs/namei.c: don't pass nameidata to d_revalidate()Al Viro2012-07-141-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | since the method wrapped by it doesn't need that anymore... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | stop passing nameidata * to ->d_revalidate()Al Viro2012-07-1421-78/+63Star
| | | | | | | | | | | | | | | | | | | | | | | | Just the lookup flags. Die, bastard, die... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | fs/nfs/dir.c: switch to passing nd->flags instead of nd wherever possibleAl Viro2012-07-141-32/+19Star
| | | | | | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | nfs_lookup_verify_inode() - nd is *always* non-NULL hereAl Viro2012-07-141-13/+10Star
| | | | | | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | switch nfs_lookup_check_intent() away from nameidataAl Viro2012-07-141-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | just pass the flags Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | do_dentry_open(): take initialization of file->f_path to callerAl Viro2012-07-141-14/+12Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and get rid of a couple of arguments and a pointless reassignment in finish_open() case. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | fold __dentry_open() into its sole callerAl Viro2012-07-141-21/+12Star
| | | | | | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | switch do_dentry_open() to returning intAl Viro2012-07-141-20/+20
| | | | | | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | make finish_no_open() return intAl Viro2012-07-147-19/+11Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | namely, 1 ;-) That's what we want to return from ->atomic_open() instances after finish_no_open(). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | fs/namei.c: get do_last() and friends return intAl Viro2012-07-141-80/+70Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Same conventions as for ->atomic_open(). Trimmed the forest of labels a bit, while we are at it... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | kill struct opendataAl Viro2012-07-1412-90/+74Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just pass struct file *. Methods are happier that way... There's no need to return struct file * from finish_open() now, so let it return int. Next: saner prototypes for parts in namei.c Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | kill opendata->{mnt,dentry}Al Viro2012-07-143-14/+9Star
| | | | | | | | | | | | | | | | | | | | | | | | ->filp->f_path is there for purpose... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | make ->atomic_open() return intAl Viro2012-07-1410-98/+90Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change of calling conventions: old new NULL 1 file 0 ERR_PTR(-ve) -ve Caller *knows* that struct file *; no need to return it. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | don't modify od->filp at allAl Viro2012-07-142-6/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | make put_filp() conditional on flag set by finish_open() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | ->atomic_open() prototype change - pass int * instead of bool *Al Viro2012-07-1411-48/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and let finish_open() report having opened the file via that sucker. Next step: don't modify od->filp at all. [AV: FILE_CREATE was already used by cifs; Miklos' fix folded] Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | vfs: move O_DIRECT check to common codeMiklos Szeredi2012-07-141-12/+5Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Perform open_check_o_direct() in a common place in do_last after opening the file. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | vfs: do_last(): clean up retryMiklos Szeredi2012-07-141-15/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the lookup retry logic to the bottom of the function to make the normal case simpler to read. Reported-by: David Howells <dhowells@redhat.com> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | vfs: do_last(): clean up boolMiklos Szeredi2012-07-141-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consistently use bool for boolean values in do_last(). Reported-by: David Howells <dhowells@redhat.com> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | vfs: do_last(): clean up labelsMiklos Szeredi2012-07-141-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Reported-by: David Howells <dhowells@redhat.com> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | vfs: do_last(): clean up error handlingMiklos Szeredi2012-07-141-15/+8Star
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | vfs: remove open intents from nameidataMiklos Szeredi2012-07-143-139/+48Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All users of open intents have been converted to use ->atomic_{open,create}. This patch gets rid of nd->intent.open and related infrastructure. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | 9p: implement i_op->atomic_open()Miklos Szeredi2012-07-142-84/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an ->atomic_open implementation which replaces the atomic open+create operation implemented via ->create. No functionality is changed. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> CC: Eric Van Hensbergen <ericvh@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | ceph: implement i_op->atomic_open()Miklos Szeredi2012-07-143-38/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an ->atomic_open implementation which replaces the atomic lookup+open+create operation implemented via ->lookup and ->create operations. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> CC: Sage Weil <sage@newdream.net> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | ceph: remove unused arg from ceph_lookup_open()Miklos Szeredi2012-07-143-6/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | What was the purpose of this? Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> CC: Sage Weil <sage@newdream.net> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | cifs: implement i_op->atomic_open()Miklos Szeredi2012-07-143-198/+247
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an ->atomic_open implementation which replaces the atomic lookup+open+create operation implemented via ->lookup and ->create operations. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> CC: Steve French <sfrench@samba.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | fuse: implement i_op->atomic_open()Miklos Szeredi2012-07-141-27/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an ->atomic_open implementation which replaces the atomic open+create operation implemented via ->create. No functionality is changed. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | nfs: don't use intents for checking atomic openMiklos Szeredi2012-07-141-20/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is_atomic_open() is now only used by nfs4_lookup_revalidate() to check whether it's okay to skip normal revalidation. It does a racy check for mount read-onlyness and falls back to normal revalidation if the open would fail. This makes little sense now that this function isn't used for determining whether to actually open the file or not. The d_mountpoint() check still makes sense since it is an indication that we might be following a mount and so open may not revalidate the dentry. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> CC: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | nfs: don't use nd->intent.open.flagsMiklos Szeredi2012-07-141-5/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead check LOOKUP_EXCL in nd->flags, which is basically what the open intent flags were used for. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> CC: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | nfs: clean up ->create in nfs_rpc_opsMiklos Szeredi2012-07-144-69/+14Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't pass nfs_open_context() to ->create(). Only the NFS4 implementation needed that and only because it wanted to return an open file using open intents. That task has been replaced by ->atomic_open so it is not necessary anymore to pass the context to the create rpc operation. Despite nfs4_proc_create apparently being okay with a NULL context it Oopses somewhere down the call chain. So allocate a context here. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> CC: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | nfs: implement i_op->atomic_open()Miklos Szeredi2012-07-141-86/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace NFS4 specific ->lookup implementation with ->atomic_open impelementation and use the generic nfs_lookup for other lookups. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> CC: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | | vfs: add i_op->atomic_open()Miklos Szeredi2012-07-143-2/+248
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new inode operation which is called on the last component of an open. Using this the filesystem can look up, possibly create and open the file in one atomic operation. If it cannot perform this (e.g. the file type turned out to be wrong) it may signal this by returning NULL instead of an open struct file pointer. i_op->atomic_open() is only called if the last component is negative or needs lookup. Handling cached positive dentries here doesn't add much value: these can be opened using f_op->open(). If the cached file turns out to be invalid, the open can be retried, this time using ->atomic_open() with a fresh dentry. For now leave the old way of using open intents in lookup and revalidate in place. This will be removed once all the users are converted. David Howells noticed that if ->atomic_open() opens the file but does not create it, handle_truncate() will be called on it even if it is not a regular file. Fix this by checking the file type in this case too. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>