aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2009-05-22 05:48:59 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2009-05-22 05:48:59 -0400
commit536baf02f650f4547f105386878b4736fbc181e8 (patch)
treeeeb326e76515c074f6eb0ae63deb598605632523 /fs/gfs2/inode.c
parent2286dbfad1fb622ee2691537e5caaedee4618860 (diff)
GFS2: Move gfs2_readlinki into ops_inode.c
Move gfs2_readlinki 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.c58
1 files changed, 1 insertions, 57 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 9b17447a0f95..676e750fc84c 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -1085,63 +1085,7 @@ int gfs2_unlink_ok(struct gfs2_inode *dip, const struct qstr *name,
1085 return 0; 1085 return 0;
1086} 1086}
1087 1087
1088/** 1088static int __gfs2_setattr_simple(struct gfs2_inode *ip, struct iattr *attr)
1089 * gfs2_readlinki - return the contents of a symlink
1090 * @ip: the symlink's inode
1091 * @buf: a pointer to the buffer to be filled
1092 * @len: a pointer to the length of @buf
1093 *
1094 * If @buf is too small, a piece of memory is kmalloc()ed and needs
1095 * to be freed by the caller.
1096 *
1097 * Returns: errno
1098 */
1099
1100int gfs2_readlinki(struct gfs2_inode *ip, char **buf, unsigned int *len)
1101{
1102 struct gfs2_holder i_gh;
1103 struct buffer_head *dibh;
1104 unsigned int x;
1105 int error;
1106
1107 gfs2_holder_init(ip->i_gl, LM_ST_SHARED, 0, &i_gh);
1108 error = gfs2_glock_nq(&i_gh);
1109 if (error) {
1110 gfs2_holder_uninit(&i_gh);
1111 return error;
1112 }
1113
1114 if (!ip->i_disksize) {
1115 gfs2_consist_inode(ip);
1116 error = -EIO;
1117 goto out;
1118 }
1119
1120 error = gfs2_meta_inode_buffer(ip, &dibh);
1121 if (error)
1122 goto out;
1123
1124 x = ip->i_disksize + 1;
1125 if (x > *len) {
1126 *buf = kmalloc(x, GFP_NOFS);
1127 if (!*buf) {
1128 error = -ENOMEM;
1129 goto out_brelse;
1130 }
1131 }
1132
1133 memcpy(*buf, dibh->b_data + sizeof(struct gfs2_dinode), x);
1134 *len = x;
1135
1136out_brelse:
1137 brelse(dibh);
1138out:
1139 gfs2_glock_dq_uninit(&i_gh);
1140 return error;
1141}
1142
1143static int
1144__gfs2_setattr_simple(struct gfs2_inode *ip, struct iattr *attr)
1145{ 1089{
1146 struct buffer_head *dibh; 1090 struct buffer_head *dibh;
1147 int error; 1091 int error;