super.c (018cbffe6819f6f8db20a0a3acd9bab9bfd667e4) super.c (009d851837ab26cab18adda6169a813f70b0b21b)
1/*
2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
3 * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
4 *
5 * This copyrighted material is made available to anyone wishing to use,
6 * modify, copy, or redistribute it subject to the terms and conditions
7 * of the GNU General Public License version 2.
8 */

--- 708 unchanged lines hidden (view full) ---

717 struct gfs2_sbd *sdp = GFS2_SB(inode);
718 struct gfs2_holder gh;
719 struct buffer_head *bh;
720 struct timespec atime;
721 struct gfs2_dinode *di;
722 int ret = 0;
723
724 /* Check this is a "normal" inode, etc */
1/*
2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
3 * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
4 *
5 * This copyrighted material is made available to anyone wishing to use,
6 * modify, copy, or redistribute it subject to the terms and conditions
7 * of the GNU General Public License version 2.
8 */

--- 708 unchanged lines hidden (view full) ---

717 struct gfs2_sbd *sdp = GFS2_SB(inode);
718 struct gfs2_holder gh;
719 struct buffer_head *bh;
720 struct timespec atime;
721 struct gfs2_dinode *di;
722 int ret = 0;
723
724 /* Check this is a "normal" inode, etc */
725 if (!test_bit(GIF_USER, &ip->i_flags) ||
726 (current->flags & PF_MEMALLOC))
725 if (current->flags & PF_MEMALLOC)
727 return 0;
728 ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
729 if (ret)
730 goto do_flush;
731 ret = gfs2_trans_begin(sdp, RES_DINODE, 0);
732 if (ret)
733 goto do_unlock;
734 ret = gfs2_meta_inode_buffer(ip, &bh);

--- 454 unchanged lines hidden (view full) ---

1189 * inode's blocks, or alternatively pass the baton on to another
1190 * node for later deallocation.
1191 */
1192
1193static void gfs2_drop_inode(struct inode *inode)
1194{
1195 struct gfs2_inode *ip = GFS2_I(inode);
1196
726 return 0;
727 ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
728 if (ret)
729 goto do_flush;
730 ret = gfs2_trans_begin(sdp, RES_DINODE, 0);
731 if (ret)
732 goto do_unlock;
733 ret = gfs2_meta_inode_buffer(ip, &bh);

--- 454 unchanged lines hidden (view full) ---

1188 * inode's blocks, or alternatively pass the baton on to another
1189 * node for later deallocation.
1190 */
1191
1192static void gfs2_drop_inode(struct inode *inode)
1193{
1194 struct gfs2_inode *ip = GFS2_I(inode);
1195
1197 if (test_bit(GIF_USER, &ip->i_flags) && inode->i_nlink) {
1196 if (inode->i_nlink) {
1198 struct gfs2_glock *gl = ip->i_iopen_gh.gh_gl;
1199 if (gl && test_bit(GLF_DEMOTE, &gl->gl_flags))
1200 clear_nlink(inode);
1201 }
1202 generic_drop_inode(inode);
1203}
1204
1205/**
1206 * gfs2_clear_inode - Deallocate an inode when VFS is done with it
1207 * @inode: The VFS inode
1208 *
1209 */
1210
1211static void gfs2_clear_inode(struct inode *inode)
1212{
1213 struct gfs2_inode *ip = GFS2_I(inode);
1214
1197 struct gfs2_glock *gl = ip->i_iopen_gh.gh_gl;
1198 if (gl && test_bit(GLF_DEMOTE, &gl->gl_flags))
1199 clear_nlink(inode);
1200 }
1201 generic_drop_inode(inode);
1202}
1203
1204/**
1205 * gfs2_clear_inode - Deallocate an inode when VFS is done with it
1206 * @inode: The VFS inode
1207 *
1208 */
1209
1210static void gfs2_clear_inode(struct inode *inode)
1211{
1212 struct gfs2_inode *ip = GFS2_I(inode);
1213
1215 /* This tells us its a "real" inode and not one which only
1216 * serves to contain an address space (see rgrp.c, meta_io.c)
1217 * which therefore doesn't have its own glocks.
1218 */
1219 if (test_bit(GIF_USER, &ip->i_flags)) {
1220 ip->i_gl->gl_object = NULL;
1221 gfs2_glock_put(ip->i_gl);
1222 ip->i_gl = NULL;
1223 if (ip->i_iopen_gh.gh_gl) {
1224 ip->i_iopen_gh.gh_gl->gl_object = NULL;
1225 gfs2_glock_dq_uninit(&ip->i_iopen_gh);
1226 }
1214 ip->i_gl->gl_object = NULL;
1215 gfs2_glock_put(ip->i_gl);
1216 ip->i_gl = NULL;
1217 if (ip->i_iopen_gh.gh_gl) {
1218 ip->i_iopen_gh.gh_gl->gl_object = NULL;
1219 gfs2_glock_dq_uninit(&ip->i_iopen_gh);
1227 }
1228}
1229
1230static int is_ancestor(const struct dentry *d1, const struct dentry *d2)
1231{
1232 do {
1233 if (d1 == d2)
1234 return 1;

--- 118 unchanged lines hidden (view full) ---

1353
1354static void gfs2_delete_inode(struct inode *inode)
1355{
1356 struct gfs2_sbd *sdp = inode->i_sb->s_fs_info;
1357 struct gfs2_inode *ip = GFS2_I(inode);
1358 struct gfs2_holder gh;
1359 int error;
1360
1220 }
1221}
1222
1223static int is_ancestor(const struct dentry *d1, const struct dentry *d2)
1224{
1225 do {
1226 if (d1 == d2)
1227 return 1;

--- 118 unchanged lines hidden (view full) ---

1346
1347static void gfs2_delete_inode(struct inode *inode)
1348{
1349 struct gfs2_sbd *sdp = inode->i_sb->s_fs_info;
1350 struct gfs2_inode *ip = GFS2_I(inode);
1351 struct gfs2_holder gh;
1352 int error;
1353
1361 if (!test_bit(GIF_USER, &ip->i_flags))
1362 goto out;
1363
1364 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
1365 if (unlikely(error)) {
1366 gfs2_glock_dq_uninit(&ip->i_iopen_gh);
1367 goto out;
1368 }
1369
1370 error = gfs2_check_blk_type(sdp, ip->i_no_addr, GFS2_BLKST_UNLINKED);
1371 if (error)

--- 84 unchanged lines hidden ---
1354 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
1355 if (unlikely(error)) {
1356 gfs2_glock_dq_uninit(&ip->i_iopen_gh);
1357 goto out;
1358 }
1359
1360 error = gfs2_check_blk_type(sdp, ip->i_no_addr, GFS2_BLKST_UNLINKED);
1361 if (error)

--- 84 unchanged lines hidden ---