]> err.no Git - linux-2.6/blobdiff - fs/gfs2/ops_export.c
[GFS2] Macros removal in gfs2.h
[linux-2.6] / fs / gfs2 / ops_export.c
index 0ae3a0af192d7085f1484542f6f07d28e0fd1915..d149584cff301e304b23b045a7e90e28a74d356d 100644 (file)
 #include <linux/spinlock.h>
 #include <linux/completion.h>
 #include <linux/buffer_head.h>
+#include <linux/gfs2_ondisk.h>
 #include <asm/semaphore.h>
 
 #include "gfs2.h"
+#include "lm_interface.h"
+#include "incore.h"
 #include "dir.h"
 #include "glock.h"
 #include "glops.h"
@@ -32,8 +35,6 @@ static struct dentry *gfs2_decode_fh(struct super_block *sb,
 {
        struct gfs2_inum this, parent;
 
-       atomic_inc(&get_v2sdp(sb)->sd_ops_export);
-
        if (fh_type != fh_len)
                return NULL;
 
@@ -63,11 +64,9 @@ static int gfs2_encode_fh(struct dentry *dentry, __u32 *fh, int *len,
                          int connectable)
 {
        struct inode *inode = dentry->d_inode;
-       struct gfs2_inode *ip = get_v2ip(inode);
+       struct gfs2_inode *ip = inode->u.generic_ip;
        struct gfs2_sbd *sdp = ip->i_sbd;
 
-       atomic_inc(&sdp->sd_ops_export);
-
        if (*len < 4 || (connectable && *len < 8))
                return 255;
 
@@ -81,12 +80,12 @@ static int gfs2_encode_fh(struct dentry *dentry, __u32 *fh, int *len,
        fh[3] = cpu_to_be32(fh[3]);
        *len = 4;
 
-       if (!connectable || ip == sdp->sd_root_dir)
+       if (!connectable || ip == sdp->sd_root_dir->u.generic_ip)
                return *len;
 
        spin_lock(&dentry->d_lock);
        inode = dentry->d_parent->d_inode;
-       ip = get_v2ip(inode);
+       ip = inode->u.generic_ip;
        gfs2_inode_hold(ip);
        spin_unlock(&dentry->d_lock);
 
@@ -139,13 +138,11 @@ static int gfs2_get_name(struct dentry *parent, char *name,
        if (!dir)
                return -EINVAL;
 
-       atomic_inc(&get_v2sdp(dir->i_sb)->sd_ops_export);
-
        if (!S_ISDIR(dir->i_mode) || !inode)
                return -EINVAL;
 
-       dip = get_v2ip(dir);
-       ip = get_v2ip(inode);
+       dip = dir->u.generic_ip;
+       ip = inode->u.generic_ip;
 
        *name = 0;
        gnfd.inum = ip->i_num;
@@ -167,25 +164,15 @@ static int gfs2_get_name(struct dentry *parent, char *name,
 
 static struct dentry *gfs2_get_parent(struct dentry *child)
 {
-       struct gfs2_inode *dip = get_v2ip(child->d_inode);
        struct qstr dotdot = { .name = "..", .len = 2 };
-       struct gfs2_inode *ip;
        struct inode *inode;
        struct dentry *dentry;
        int error;
 
-       atomic_inc(&dip->i_sbd->sd_ops_export);
-
-       error = gfs2_lookupi(dip, &dotdot, 1, &ip);
+       error = gfs2_lookupi(child->d_inode, &dotdot, 1, &inode);
        if (error)
                return ERR_PTR(error);
 
-       inode = gfs2_ip2v(ip);
-       gfs2_inode_put(ip);
-
-       if (!inode)
-               return ERR_PTR(-ENOMEM);
-
        dentry = d_alloc_anon(inode);
        if (!dentry) {
                iput(inode);
@@ -197,7 +184,7 @@ static struct dentry *gfs2_get_parent(struct dentry *child)
 
 static struct dentry *gfs2_get_dentry(struct super_block *sb, void *inum_p)
 {
-       struct gfs2_sbd *sdp = get_v2sdp(sb);
+       struct gfs2_sbd *sdp = sb->s_fs_info;
        struct gfs2_inum *inum = (struct gfs2_inum *)inum_p;
        struct gfs2_holder i_gh, ri_gh, rgd_gh;
        struct gfs2_rgrpd *rgd;
@@ -206,13 +193,11 @@ static struct dentry *gfs2_get_dentry(struct super_block *sb, void *inum_p)
        struct dentry *dentry;
        int error;
 
-       atomic_inc(&sdp->sd_ops_export);
-
        /* System files? */
 
        inode = gfs2_iget(sb, inum);
        if (inode) {
-               ip = get_v2ip(inode);
+               ip = inode->u.generic_ip;
                if (ip->i_num.no_formal_ino != inum->no_formal_ino) {
                        iput(inode);
                        return ERR_PTR(-ESTALE);
@@ -263,8 +248,6 @@ static struct dentry *gfs2_get_dentry(struct super_block *sb, void *inum_p)
                goto fail;
        }
 
-       atomic_inc(&sdp->sd_fh2dentry_misses);
-
  out_ip:
        error = -EIO;
        if (ip->i_di.di_flags & GFS2_DIF_SYSTEM) {