aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2009-05-22 05:45:09 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2009-05-22 05:45:09 -0400
commit2286dbfad1fb622ee2691537e5caaedee4618860 (patch)
treeda16646efb25515c3b6865b84bf3485a4714caee /fs/gfs2/inode.c
parent9e6e0a128bca0a151d8d3fbd9459b22fc21cfebb (diff)
GFS2: Move gfs2_rmdiri into ops_inode.c
Move gfs2_rmdiri() into ops_inode.c 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.c52
1 files changed, 0 insertions, 52 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index c03a1a384e72..9b17447a0f95 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -1046,58 +1046,6 @@ fail:
1046 return ERR_PTR(error); 1046 return ERR_PTR(error);
1047} 1047}
1048 1048
1049/**
1050 * gfs2_rmdiri - Remove a directory
1051 * @dip: The parent directory of the directory to be removed
1052 * @name: The name of the directory to be removed
1053 * @ip: The GFS2 inode of the directory to be removed
1054 *
1055 * Assumes Glocks on dip and ip are held
1056 *
1057 * Returns: errno
1058 */
1059
1060int gfs2_rmdiri(struct gfs2_inode *dip, const struct qstr *name,
1061 struct gfs2_inode *ip)
1062{
1063 struct qstr dotname;
1064 int error;
1065
1066 if (ip->i_entries != 2) {
1067 if (gfs2_consist_inode(ip))
1068 gfs2_dinode_print(ip);
1069 return -EIO;
1070 }
1071
1072 error = gfs2_dir_del(dip, name);
1073 if (error)
1074 return error;
1075
1076 error = gfs2_change_nlink(dip, -1);
1077 if (error)
1078 return error;
1079
1080 gfs2_str2qstr(&dotname, ".");
1081 error = gfs2_dir_del(ip, &dotname);
1082 if (error)
1083 return error;
1084
1085 gfs2_str2qstr(&dotname, "..");
1086 error = gfs2_dir_del(ip, &dotname);
1087 if (error)
1088 return error;
1089
1090 /* It looks odd, but it really should be done twice */
1091 error = gfs2_change_nlink(ip, -1);
1092 if (error)
1093 return error;
1094
1095 error = gfs2_change_nlink(ip, -1);
1096 if (error)
1097 return error;
1098
1099 return error;
1100}
1101 1049
1102/* 1050/*
1103 * gfs2_unlink_ok - check to see that a inode is still in a directory 1051 * gfs2_unlink_ok - check to see that a inode is still in a directory