diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2009-05-22 10:54:50 +0100 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2009-05-22 10:54:50 +0100 |
commit | 87ec21741138bb42e7f943bb142b1d8567c10925 (patch) | |
tree | d173754b440f7b14b2b29334ac7addc4b9621286 /fs/gfs2/inode.c | |
parent | 536baf02f650f4547f105386878b4736fbc181e8 (diff) | |
download | linux-3.10-87ec21741138bb42e7f943bb142b1d8567c10925.tar.gz linux-3.10-87ec21741138bb42e7f943bb142b1d8567c10925.tar.bz2 linux-3.10-87ec21741138bb42e7f943bb142b1d8567c10925.zip |
GFS2: Move gfs2_unlink_ok into ops_inode.c
Another function which is only called from one ops_inode.c so
we move it and make it static.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r-- | fs/gfs2/inode.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 676e750fc84..2f94bd72369 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -1046,45 +1046,6 @@ fail: return ERR_PTR(error); } - -/* - * gfs2_unlink_ok - check to see that a inode is still in a directory - * @dip: the directory - * @name: the name of the file - * @ip: the inode - * - * Assumes that the lock on (at least) @dip is held. - * - * Returns: 0 if the parent/child relationship is correct, errno if it isn't - */ - -int gfs2_unlink_ok(struct gfs2_inode *dip, const struct qstr *name, - const struct gfs2_inode *ip) -{ - int error; - - if (IS_IMMUTABLE(&ip->i_inode) || IS_APPEND(&ip->i_inode)) - return -EPERM; - - if ((dip->i_inode.i_mode & S_ISVTX) && - dip->i_inode.i_uid != current_fsuid() && - ip->i_inode.i_uid != current_fsuid() && !capable(CAP_FOWNER)) - return -EPERM; - - if (IS_APPEND(&dip->i_inode)) - return -EPERM; - - error = gfs2_permission(&dip->i_inode, MAY_WRITE | MAY_EXEC); - if (error) - return error; - - error = gfs2_dir_check(&dip->i_inode, name, ip); - if (error) - return error; - - return 0; -} - static int __gfs2_setattr_simple(struct gfs2_inode *ip, struct iattr *attr) { struct buffer_head *dibh; |