aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-06-14 15:32:57 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-06-14 15:32:57 -0400
commitfeaa7bba026c181ce071d5a4884f7f9dd26207a1 (patch)
treec858deb225917265cb07820730e9764674d133e8 /include
parent22da645fd6675b7abc55cf937ddf6132f343e5b9 (diff)
[GFS2] Fix unlinked file handling
This patch fixes the way we have been dealing with unlinked, but still open files. It removes all limits (other than memory for inodes, as per every other filesystem) on numbers of these which we can support on GFS2. It also means that (like other fs) its the responsibility of the last process to close the file to deallocate the storage, rather than the person who did the unlinking. Note that with GFS2, those two events might take place on different nodes. Also there are a number of other changes: o We use the Linux inode subsystem as it was intended to be used, wrt allocating GFS2 inodes o The Linux inode cache is now the point which we use for local enforcement of only holding one copy of the inode in core at once (previous to this we used the glock layer). o We no longer use the unlinked "special" file. We just ignore it completely. This makes unlinking more efficient. o We now use the 4th block allocation state. The previously unused state is used to track unlinked but still open inodes. o gfs2_inoded is no longer needed o Several fields are now no longer needed (and removed) from the in core struct gfs2_inode o Several fields are no longer needed (and removed) from the in core superblock There are a number of future possible optimisations and clean ups which have been made possible by this patch. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/gfs2_ondisk.h34
1 files changed, 8 insertions, 26 deletions
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
index 3893aac4e3ae..1181da831939 100644
--- a/include/linux/gfs2_ondisk.h
+++ b/include/linux/gfs2_ondisk.h
@@ -1,11 +1,11 @@
1/* 1/*
2* Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
3* Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. 3 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
4* 4 *
5* This copyrighted material is made available to anyone wishing to use, 5 * This copyrighted material is made available to anyone wishing to use,
6* modify, copy, or redistribute it subject to the terms and conditions 6 * modify, copy, or redistribute it subject to the terms and conditions
7* of the GNU General Public License v.2. 7 * of the GNU General Public License v.2.
8*/ 8 */
9 9
10#ifndef __GFS2_ONDISK_DOT_H__ 10#ifndef __GFS2_ONDISK_DOT_H__
11#define __GFS2_ONDISK_DOT_H__ 11#define __GFS2_ONDISK_DOT_H__
@@ -36,7 +36,6 @@
36#define GFS2_FORMAT_LB 1000 36#define GFS2_FORMAT_LB 1000
37#define GFS2_FORMAT_EA 1600 37#define GFS2_FORMAT_EA 1600
38#define GFS2_FORMAT_ED 1700 38#define GFS2_FORMAT_ED 1700
39#define GFS2_FORMAT_UT 1300
40#define GFS2_FORMAT_QC 1400 39#define GFS2_FORMAT_QC 1400
41/* These are format numbers for entities contained in files */ 40/* These are format numbers for entities contained in files */
42#define GFS2_FORMAT_RI 1100 41#define GFS2_FORMAT_RI 1100
@@ -80,7 +79,6 @@ static inline int gfs2_inum_equal(const struct gfs2_inum *ino1,
80#define GFS2_METATYPE_LB 12 79#define GFS2_METATYPE_LB 12
81#define GFS2_METATYPE_EA 10 80#define GFS2_METATYPE_EA 10
82#define GFS2_METATYPE_ED 11 81#define GFS2_METATYPE_ED 11
83#define GFS2_METATYPE_UT 13
84#define GFS2_METATYPE_QC 14 82#define GFS2_METATYPE_QC 14
85 83
86struct gfs2_meta_header { 84struct gfs2_meta_header {
@@ -158,7 +156,7 @@ struct gfs2_rindex {
158 156
159#define GFS2_BLKST_FREE 0 157#define GFS2_BLKST_FREE 0
160#define GFS2_BLKST_USED 1 158#define GFS2_BLKST_USED 1
161#define GFS2_BLKST_INVALID 2 159#define GFS2_BLKST_UNLINKED 2
162#define GFS2_BLKST_DINODE 3 160#define GFS2_BLKST_DINODE 3
163 161
164#define GFS2_RGF_JOURNAL 0x00000001 162#define GFS2_RGF_JOURNAL 0x00000001
@@ -397,20 +395,6 @@ struct gfs2_statfs_change {
397}; 395};
398 396
399/* 397/*
400 * Unlinked Tag
401 * Describes an allocated inode that isn't linked into
402 * the directory tree and might need to be deallocated.
403 */
404
405#define GFS2_UTF_UNINIT 0x00000001
406
407struct gfs2_unlinked_tag {
408 struct gfs2_inum ut_inum;
409 __be32 ut_flags; /* GFS2_UTF_... */
410 __u32 __pad;
411};
412
413/*
414 * Quota change 398 * Quota change
415 * Describes an allocation change for a particular 399 * Describes an allocation change for a particular
416 * user or group. 400 * user or group.
@@ -445,8 +429,6 @@ extern void gfs2_inum_range_in(struct gfs2_inum_range *ir, char *buf);
445extern void gfs2_inum_range_out(struct gfs2_inum_range *ir, char *buf); 429extern void gfs2_inum_range_out(struct gfs2_inum_range *ir, char *buf);
446extern void gfs2_statfs_change_in(struct gfs2_statfs_change *sc, char *buf); 430extern void gfs2_statfs_change_in(struct gfs2_statfs_change *sc, char *buf);
447extern void gfs2_statfs_change_out(struct gfs2_statfs_change *sc, char *buf); 431extern void gfs2_statfs_change_out(struct gfs2_statfs_change *sc, char *buf);
448extern void gfs2_unlinked_tag_in(struct gfs2_unlinked_tag *ut, char *buf);
449extern void gfs2_unlinked_tag_out(struct gfs2_unlinked_tag *ut, char *buf);
450extern void gfs2_quota_change_in(struct gfs2_quota_change *qc, char *buf); 432extern void gfs2_quota_change_in(struct gfs2_quota_change *qc, char *buf);
451 433
452/* Printing functions */ 434/* Printing functions */