aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2009-05-22 05:54:50 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2009-05-22 05:54:50 -0400
commit87ec21741138bb42e7f943bb142b1d8567c10925 (patch)
treed173754b440f7b14b2b29334ac7addc4b9621286 /fs/gfs2/inode.c
parent536baf02f650f4547f105386878b4736fbc181e8 (diff)
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.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 676e750fc84c..2f94bd723698 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -1046,45 +1046,6 @@ fail:
1046 return ERR_PTR(error); 1046 return ERR_PTR(error);
1047} 1047}
1048 1048
1049
1050/*
1051 * gfs2_unlink_ok - check to see that a inode is still in a directory
1052 * @dip: the directory
1053 * @name: the name of the file
1054 * @ip: the inode
1055 *
1056 * Assumes that the lock on (at least) @dip is held.
1057 *
1058 * Returns: 0 if the parent/child relationship is correct, errno if it isn't
1059 */
1060
1061int gfs2_unlink_ok(struct gfs2_inode *dip, const struct qstr *name,
1062 const struct gfs2_inode *ip)
1063{
1064 int error;
1065
1066 if (IS_IMMUTABLE(&ip->i_inode) || IS_APPEND(&ip->i_inode))
1067 return -EPERM;
1068
1069 if ((dip->i_inode.i_mode & S_ISVTX) &&
1070 dip->i_inode.i_uid != current_fsuid() &&
1071 ip->i_inode.i_uid != current_fsuid() && !capable(CAP_FOWNER))
1072 return -EPERM;
1073
1074 if (IS_APPEND(&dip->i_inode))
1075 return -EPERM;
1076
1077 error = gfs2_permission(&dip->i_inode, MAY_WRITE | MAY_EXEC);
1078 if (error)
1079 return error;
1080
1081 error = gfs2_dir_check(&dip->i_inode, name, ip);
1082 if (error)
1083 return error;
1084
1085 return 0;
1086}
1087
1088static int __gfs2_setattr_simple(struct gfs2_inode *ip, struct iattr *attr) 1049static int __gfs2_setattr_simple(struct gfs2_inode *ip, struct iattr *attr)
1089{ 1050{
1090 struct buffer_head *dibh; 1051 struct buffer_head *dibh;