]> git.neil.brown.name Git - LaFS.git/commitdiff
Replace lots of ino_from_sb uses.
authorNeilBrown <neilb@suse.de>
Mon, 7 Mar 2011 05:58:53 +0000 (16:58 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 7 Mar 2011 05:58:53 +0000 (16:58 +1100)
Most of these can now simply dereference ->filesys.

Signed-off-by: NeilBrown <neilb@suse.de>
clean.c
cluster.c
file.c
inode.c
orphan.c
summary.c
super.c

diff --git a/clean.c b/clean.c
index 8a608be5432de7750d721c609758d2084673eddb..b5b026faf2167d5b3fec1f5abb5c4edcd21e5559 100644 (file)
--- a/clean.c
+++ b/clean.c
@@ -299,7 +299,7 @@ static void cleaner_parse(struct fs *fs, struct toclean *tc)
 
                if (ino == NULL ||
                    ino->i_ino != inum ||
-                   ino_from_sb(ino->i_sb)->i_ino != fsnum) {
+                   LAFSI(ino)->filesys->i_ino != fsnum) {
                        if (ino)
                                lafs_iput_fs(ino);
                        if (fsnum) {
index 39dd9286fd56e799ecb311e1f886314385e0e482..7ab404311cd6adb9161f829ee9e7ce33b68fd97c 100644 (file)
--- a/cluster.c
+++ b/cluster.c
@@ -68,8 +68,8 @@ static int cmp_blk(struct block *a, struct block *b)
         */
 
        if (a->inode != b->inode) {
-               struct inode *fsinoa = ino_from_sb(a->inode->i_sb);
-               struct inode *fsinob = ino_from_sb(b->inode->i_sb);
+               struct inode *fsinoa = LAFSI(a->inode)->filesys;
+               struct inode *fsinob = LAFSI(b->inode)->filesys;
                if (fsinoa->i_ino <
                    fsinob->i_ino)
                        return -3;
@@ -874,7 +874,7 @@ static void cluster_addhead(struct wc *wc, struct inode *ino,
        *headstart = gh;
 
        gh->inum = cpu_to_le32(ino->i_ino);
-       gh->fsnum = cpu_to_le32(ino_from_sb(ino->i_sb)->i_ino);
+       gh->fsnum = cpu_to_le32(LAFSI(ino)->filesys->i_ino);
        tnf = ((ino->i_generation<<8) | (LAFSI(ino)->trunc_gen & 0xff))
                & 0x7fff;
        if (wc->cnum)
diff --git a/file.c b/file.c
index a92f559afb29eb5e1e3ecc8b00d9a8be8aaa3dc2..ee07bd9648e5d1b487e5113257613bfab29b2598 100644 (file)
--- a/file.c
+++ b/file.c
@@ -302,7 +302,7 @@ lafs_writepage(struct page *page, struct writeback_control *wbc)
        int blocks = PAGE_SIZE >> ino->i_blkbits;
        int i;
        int redirty = 0;
-       dprintk("WRITEPAGE %lu/%lu/%lu\n", ino_from_sb(ino->i_sb)->i_ino, ino->i_ino, page->index * blocks);
+       dprintk("WRITEPAGE %lu/%lu/%lu\n", LAFSI(ino)->filesys->i_ino, ino->i_ino, page->index * blocks);
        for (i = 0 ; i < blocks; i++) {
                struct datablock *b = lafs_get_block(ino, i, page, GFP_KERNEL,
                                                     MKREF(writepage));
diff --git a/inode.c b/inode.c
index e385afe425e1a8df5913a6d6591975beed6f1434..4e10c2272a2f2313164243ace76ac6d4a052d42e 100644 (file)
--- a/inode.c
+++ b/inode.c
@@ -497,7 +497,7 @@ static void check_atime_ref(struct inode *ino, int async)
                return;
        if (test_bit(I_AccessTime, &LAFSI(ino)->iflags))
                return;
-       root = ino_from_sb(ino->i_sb);
+       root = LAFSI(ino)->filesys;
        at = LAFSI(root)->md.fs.accesstime;
        if (at == NULL)
                return;
@@ -625,7 +625,7 @@ static void store_atime_delta(struct inode *ino)
                return;
 
        /* We own a reference, so this lookup must succeed */
-       at = LAFSI(ino_from_sb(ino->i_sb))->md.fs.accesstime;
+       at = LAFSI(LAFSI(ino)->filesys)->md.fs.accesstime;
        bnum = ino->i_ino >> (at->i_blkbits-1);
        b = lafs_get_block(at, bnum, NULL, GFP_NOFS, MKREF(store_atime));
        BUG_ON(!b);
@@ -713,7 +713,7 @@ struct datablock *lafs_inode_dblock(struct inode *ino, int async, REFARG)
        db = lafs_inode_get_dblock(ino, REF);
 
        if (!db)
-               db = lafs_get_block(ino_from_sb(ino->i_sb), ino->i_ino, NULL,
+               db = lafs_get_block(LAFSI(ino)->filesys, ino->i_ino, NULL,
                                    GFP_KERNEL, REF);
        if (!db)
                return ERR_PTR(-ENOMEM);
@@ -1313,7 +1313,7 @@ void lafs_dirty_inode(struct inode *ino)
        }
 
        now = current_fs_time(ino->i_sb);
-       filesys = ino_from_sb(ino->i_sb);
+       filesys = LAFSI(ino)->filesys;
        if (!timespec_equal(&filesys->i_mtime, &now)) {
                filesys->i_mtime = now;
                set_bit(I_Dirty, &LAFSI(filesys)->iflags);
index 8a09b090db8a525ea40410f45a358085f78ea058..f9805d054e44cf0f7c8e19234e35ae75beb50fd0 100644 (file)
--- a/orphan.c
+++ b/orphan.c
@@ -174,7 +174,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,
-               ino_from_sb(b->b.inode->i_sb)->i_ino,
+               LAFSI(b->b.inode)->filesys->i_ino,
                b->b.inode->i_ino, b->b.fileaddr, strblk(&b->b));
 
        om->reserved--;
@@ -184,7 +184,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(ino_from_sb(b->b.inode->i_sb)->i_ino);
+       or[ent].filesys = cpu_to_le32(LAFSI(b->b.inode)->filesys->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);
index 105593039909d72196cf297fddb704edc1780f30..ac811c5f2da9c726721ab2760d8390f2c0e44959 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(ino_from_sb(lai->vfs_inode.i_sb));
+       lai = LAFSI(lai->filesys);
        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(ino_from_sb(ino->i_sb));
+       lai = LAFSI(LAFSI(ino)->filesys);
        spin_lock(&lai->vfs_inode.i_lock);
        if (lai->md.fs.blocks_allowed &&
            diff > 0 &&
diff --git a/super.c b/super.c
index 3137913258c8641b3932aa67da09019a79047150..e473565fb2302c893df2a0c6a08284d05f5db4ce 100644 (file)
--- a/super.c
+++ b/super.c
@@ -1385,7 +1385,7 @@ static int lafs_statfs(struct dentry *de, struct kstatfs *buf)
        u32 fsid;
        u32 *fsuuid;
        struct fs *fs = fs_from_inode(de->d_inode);
-       struct lafs_inode *fsroot = LAFSI(ino_from_sb(de->d_inode->i_sb));
+       struct lafs_inode *fsroot = LAFSI(LAFSI(de->d_inode)->filesys);
        struct lafs_inode *laroot = LAFSI(fs->ss[0].root);
 
        fsid = 0;