ceph: unify dentry_operations instances
[linux-2.6-block.git] / fs / ceph / dir.c
index 78180d1517307ee7b88dd000d162d7e197b19267..80f5339d097bdaa5af28719534f5db172b179ded 100644 (file)
@@ -50,13 +50,6 @@ int ceph_init_dentry(struct dentry *dentry)
                goto out_unlock;
        }
 
-       if (ceph_snap(d_inode(dentry->d_parent)) == CEPH_NOSNAP)
-               d_set_d_op(dentry, &ceph_dentry_ops);
-       else if (ceph_snap(d_inode(dentry->d_parent)) == CEPH_SNAPDIR)
-               d_set_d_op(dentry, &ceph_snapdir_dentry_ops);
-       else
-               d_set_d_op(dentry, &ceph_snap_dentry_ops);
-
        di->dentry = dentry;
        di->lease_session = NULL;
        di->time = jiffies;
@@ -1319,16 +1312,6 @@ static void ceph_d_release(struct dentry *dentry)
        kmem_cache_free(ceph_dentry_cachep, di);
 }
 
-static int ceph_snapdir_d_revalidate(struct dentry *dentry,
-                                         unsigned int flags)
-{
-       /*
-        * Eventually, we'll want to revalidate snapped metadata
-        * too... probably...
-        */
-       return 1;
-}
-
 /*
  * When the VFS prunes a dentry from the cache, we need to clear the
  * complete flag on the parent directory.
@@ -1347,6 +1330,9 @@ static void ceph_d_prune(struct dentry *dentry)
        if (d_unhashed(dentry))
                return;
 
+       if (ceph_snap(d_inode(dentry->d_parent)) == CEPH_SNAPDIR)
+               return;
+
        /*
         * we hold d_lock, so d_parent is stable, and d_fsdata is never
         * cleared until d_release
@@ -1518,13 +1504,3 @@ const struct dentry_operations ceph_dentry_ops = {
        .d_release = ceph_d_release,
        .d_prune = ceph_d_prune,
 };
-
-const struct dentry_operations ceph_snapdir_dentry_ops = {
-       .d_revalidate = ceph_snapdir_d_revalidate,
-       .d_release = ceph_d_release,
-};
-
-const struct dentry_operations ceph_snap_dentry_ops = {
-       .d_release = ceph_d_release,
-       .d_prune = ceph_d_prune,
-};