summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/incore.h
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 /fs/gfs2/incore.h
parent22da645fd6675b7abc55cf937ddf6132f343e5b9 (diff)
downloadtalos-op-linux-feaa7bba026c181ce071d5a4884f7f9dd26207a1.tar.gz
talos-op-linux-feaa7bba026c181ce071d5a4884f7f9dd26207a1.zip
[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 'fs/gfs2/incore.h')
-rw-r--r--fs/gfs2/incore.h48
1 files changed, 12 insertions, 36 deletions
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 8caefec88854..9a67a5954126 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -33,7 +33,6 @@ struct gfs2_inode;
struct gfs2_file;
struct gfs2_revoke;
struct gfs2_revoke_replay;
-struct gfs2_unlinked;
struct gfs2_quota_data;
struct gfs2_log_buf;
struct gfs2_trans;
@@ -245,16 +244,12 @@ struct gfs2_inode {
struct inode i_inode;
struct gfs2_inum i_num;
- atomic_t i_count;
unsigned long i_flags; /* GIF_... */
uint64_t i_vn;
- struct gfs2_dinode i_di;
-
- struct gfs2_glock *i_gl;
- struct gfs2_sbd *i_sbd;
- struct inode *i_vnode;
+ struct gfs2_dinode i_di; /* To be replaced by ref to block */
+ struct gfs2_glock *i_gl; /* Move into i_gh? */
struct gfs2_holder i_iopen_gh;
struct gfs2_holder i_gh; /* for prepare/commit_write only */
struct gfs2_alloc i_alloc;
@@ -262,18 +257,27 @@ struct gfs2_inode {
spinlock_t i_spin;
struct rw_semaphore i_rw_mutex;
-
unsigned int i_greedy;
unsigned long i_last_pfault;
struct buffer_head *i_cache[GFS2_MAX_META_HEIGHT];
};
+/*
+ * Since i_inode is the first element of struct gfs2_inode,
+ * this is effectively a cast.
+ */
static inline struct gfs2_inode *GFS2_I(struct inode *inode)
{
return container_of(inode, struct gfs2_inode, i_inode);
}
+/* To be removed? */
+static inline struct gfs2_sbd *GFS2_SB(struct inode *inode)
+{
+ return inode->i_sb->s_fs_info;
+}
+
enum {
GFF_DID_DIRECT_ALLOC = 0,
};
@@ -296,18 +300,6 @@ struct gfs2_revoke_replay {
};
enum {
- ULF_LOCKED = 0,
-};
-
-struct gfs2_unlinked {
- struct list_head ul_list;
- unsigned int ul_count;
- struct gfs2_unlinked_tag ul_ut;
- unsigned long ul_flags; /* ULF_... */
- unsigned int ul_slot;
-};
-
-enum {
QDF_USER = 0,
QDF_CHANGE = 1,
QDF_LOCKED = 2,
@@ -436,7 +428,6 @@ struct gfs2_tune {
unsigned int gt_recoverd_secs;
unsigned int gt_logd_secs;
unsigned int gt_quotad_secs;
- unsigned int gt_inoded_secs;
unsigned int gt_quota_simul_sync; /* Max quotavals to sync at once */
unsigned int gt_quota_warn_period; /* Secs between quota warn msgs */
@@ -495,7 +486,6 @@ struct gfs2_sbd {
uint32_t sd_hash_bsize; /* sizeof(exhash block) */
uint32_t sd_hash_bsize_shift;
uint32_t sd_hash_ptrs; /* Number of pointers in a hash block */
- uint32_t sd_ut_per_block;
uint32_t sd_qc_per_block;
uint32_t sd_max_dirres; /* Max blocks needed to add a directory entry */
uint32_t sd_max_height; /* Max height of a file's metadata tree */
@@ -527,7 +517,6 @@ struct gfs2_sbd {
struct inode *sd_statfs_inode;
struct inode *sd_ir_inode;
struct inode *sd_sc_inode;
- struct inode *sd_ut_inode;
struct inode *sd_qc_inode;
struct inode *sd_rindex;
struct inode *sd_quota_inode;
@@ -569,7 +558,6 @@ struct gfs2_sbd {
struct gfs2_holder sd_ir_gh;
struct gfs2_holder sd_sc_gh;
- struct gfs2_holder sd_ut_gh;
struct gfs2_holder sd_qc_gh;
/* Daemon stuff */
@@ -578,21 +566,9 @@ struct gfs2_sbd {
struct task_struct *sd_recoverd_process;
struct task_struct *sd_logd_process;
struct task_struct *sd_quotad_process;
- struct task_struct *sd_inoded_process;
struct task_struct *sd_glockd_process[GFS2_GLOCKD_MAX];
unsigned int sd_glockd_num;
- /* Unlinked inode stuff */
-
- struct list_head sd_unlinked_list;
- atomic_t sd_unlinked_count;
- spinlock_t sd_unlinked_spin;
- struct mutex sd_unlinked_mutex;
-
- unsigned int sd_unlinked_slots;
- unsigned int sd_unlinked_chunks;
- unsigned char **sd_unlinked_bitmap;
-
/* Quota stuff */
struct list_head sd_quota_list;
OpenPOWER on IntegriCloud