]> git.neil.brown.name Git - LaFS.git/commitdiff
Discard filesys field from lafs_inode
authorNeilBrown <neilb@suse.de>
Wed, 11 Aug 2010 23:42:56 +0000 (09:42 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 11 Aug 2010 23:42:56 +0000 (09:42 +1000)
i_sb can be used just as well.

Signed-off-by: NeilBrown <neilb@suse.de>
clean.c
cluster.c
index.c
inode.c
orphan.c
state.h
summary.c

diff --git a/clean.c b/clean.c
index fefe18edefdf0d8277a59b8a39a247831e3e3b0a..b1407379c9ab3921afb466a6d3f5b4a76be40a29 100644 (file)
--- a/clean.c
+++ b/clean.c
@@ -417,7 +417,7 @@ static int try_clean(struct fs *fs, struct toclean *tc)
 
                if (ino == NULL ||
                    ino->i_ino != inum ||
-                   LAFSI(ino)->filesys->i_ino != fsnum) {
+                   ino_from_sb(ino->i_sb)->i_ino != fsnum) {
                        if (ino)
                                iput(ino);
                        ino = lafs_iget_fs(fs, fsnum, inum, ASYNC);
index 2cdc2a467165b35d37849f80a53afa9477374f29..2674628cfc95c4d04cd10037dd06709be32ee24e 100644 (file)
--- a/cluster.c
+++ b/cluster.c
@@ -68,11 +68,13 @@ static int cmp_blk(struct block *a, struct block *b)
         */
 
        if (a->inode != b->inode) {
-               if (LAFSI(a->inode)->filesys->i_ino <
-                   LAFSI(b->inode)->filesys->i_ino)
+               struct inode *fsinoa = ino_from_sb(a->inode->i_sb);
+               struct inode *fsinob = ino_from_sb(b->inode->i_sb);
+               if (fsinoa->i_ino <
+                   fsinob->i_ino)
                        return -3;
-               if (LAFSI(a->inode)->filesys->i_ino >
-                   LAFSI(b->inode)->filesys->i_ino)
+               if (fsinoa->i_ino >
+                   fsinob->i_ino)
                        return 3;
                /* same filesystem */
                if (a->inode->i_ino <
@@ -856,7 +858,7 @@ static inline void cluster_addhead(struct wc *wc, struct inode *ino,
        *headstart = gh;
 
        gh->inum = cpu_to_le32(ino->i_ino);
-       gh->fsnum = cpu_to_le32(LAFSI(ino)->filesys->i_ino);
+       gh->fsnum = cpu_to_le32(ino_from_sb(ino->i_sb)->i_ino);
        tnf = ((ino->i_generation<<8) | (LAFSI(ino)->trunc_gen & 0xff))
                & 0x7fff;
        if (wc->cnum)
diff --git a/index.c b/index.c
index 60583af9c6b5487300d12a9931529f50e2d7b766..79bca851c574f57fac25c46acfea5d311eed699c 100644 (file)
--- a/index.c
+++ b/index.c
@@ -612,7 +612,7 @@ void lafs_phase_flip(struct fs *fs, struct indexblock *ib)
                lai->pblocks = 0;
                lai->ciblocks += lai->piblocks;
                lai->piblocks = 0;
-               if (lai->filesys == ib->b.inode) {
+               if (lai->type == TypeInodeFile) {
                        /* Root of filesystem */
                        lai->md.fs.cblocks_used +=
                                lai->md.fs.pblocks_used;
@@ -1538,7 +1538,7 @@ restart:
 
 #ifdef FIXME
                if (!(ib2->b.flags & B_Linked)) {
-                       struct block *b2 = peer_find(fs, inode->filesys,
+                       struct block *b2 = peer_find(fs,
                                                     inode, iaddr,
                                                     depth, iphys);
                        if (b2)
diff --git a/inode.c b/inode.c
index 6cf9b61f0d570641e69b20a26161b6b7dff9f012..162735fdc333e8270948b580b20fa0d5e36a76eb 100644 (file)
--- a/inode.c
+++ b/inode.c
@@ -237,7 +237,6 @@ lafs_import_inode(struct inode *ino, struct datablock *b)
        err = -EINVAL;
 
        LAFS_BUG(ino->i_ino != b->b.fileaddr, &b->b);
-       li->filesys = b->b.inode;
        li->cblocks = le32_to_cpu(lai->data_blocks);
        li->pblocks = li->ablocks = 0;
        li->vfs_inode.i_blocks = ((blkcnt_t)li->cblocks
@@ -456,7 +455,7 @@ struct datablock *lafs_inode_dblock(struct inode *ino, int async, REFARG)
                db = getdref_locked(LAFSI(ino)->dblock, REF);
        spin_unlock(&ino->i_data.private_lock);
        if (!db)
-               db = lafs_get_block(LAFSI(ino)->filesys, ino->i_ino, NULL,
+               db = lafs_get_block(ino_from_sb(ino->i_sb), ino->i_ino, NULL,
                                    GFP_KERNEL, REF);
        if (IS_ERR(db))
                return db;
index 8877a55ae9feb9626e7b496665afd5c1bad43f82..9eada1455809227940323ef058d6540112b380fd 100644 (file)
--- a/orphan.c
+++ b/orphan.c
@@ -169,7 +169,7 @@ static void orphan_commit(struct fs *fs, struct datablock *b, struct datablock *
        lafs_add_orphan(fs, b);
 
        dprintk("%p->orphan_slot=%d (%lu,%lu,%lu) %s\n", b, b->orphan_slot,
-               LAFSI(b->b.inode)->filesys->i_ino,
+               ino_from_sb(b->b.inode->i_sb)->i_ino,
                b->b.inode->i_ino, b->b.fileaddr, strblk(&b->b));
 
        om->reserved--;
@@ -179,7 +179,7 @@ static void orphan_commit(struct fs *fs, struct datablock *b, struct datablock *
        ent = b->orphan_slot - (ob->b.fileaddr
                                << (fs->blocksize_bits-4));
        or[ent].type = cpu_to_le32(1);
-       or[ent].filesys = cpu_to_le32(LAFSI(b->b.inode)->filesys->i_ino);
+       or[ent].filesys = cpu_to_le32(ino_from_sb(b->b.inode->i_sb)->i_ino);
        or[ent].inum = cpu_to_le32(b->b.inode->i_ino);
        or[ent].addr = cpu_to_le32(b->b.fileaddr);
        unmap_dblock(ob, or);
diff --git a/state.h b/state.h
index fc74870e2f759ee46218a7c6393ad21d9ac6e361..6750c2bd1c90ea7857c9e8645fad4f09e6f287b5 100644 (file)
--- a/state.h
+++ b/state.h
@@ -515,7 +515,6 @@ struct lafs_inode {
        struct inode    vfs_inode;
        struct indexblock       *iblock;
        struct datablock        *dblock;
-       struct inode    *filesys;
        long    cblocks, /* data blocks which are commited to this file */
                pblocks, /* extra data blocks that are commited in next phase */
                ablocks, /* data blocks that are allocated */
index fe6665f04cdef4bd5ed17f99d8be2533ffe09dc3..105593039909d72196cf297fddb704edc1780f30 100644 (file)
--- a/summary.c
+++ b/summary.c
@@ -60,7 +60,7 @@ void lafs_summary_update(struct fs *fs, struct inode *ino,
        spin_unlock(&ino->i_lock);
 
        /* per-filesystem */
-       lai = LAFSI(lai->filesys);
+       lai = LAFSI(ino_from_sb(lai->vfs_inode.i_sb));
        spin_lock(&lai->vfs_inode.i_lock);
        if (future)
                lai->md.fs.pblocks_used += diff;
@@ -87,7 +87,7 @@ int lafs_summary_allocate(struct fs *fs, struct inode *ino, int diff)
        /* this is where quota checks happen */
        int err = 0;
        struct lafs_inode *lai = LAFSI(ino);
-       lai = LAFSI(lai->filesys);
+       lai = LAFSI(ino_from_sb(ino->i_sb));
        spin_lock(&lai->vfs_inode.i_lock);
        if (lai->md.fs.blocks_allowed &&
            diff > 0 &&