Whamcloud - gitweb
LU-12275 sec: ioctls to handle encryption policies
[fs/lustre-release.git] / lustre / llite / super25.c
index dce25a7..5c5b9db 100644 (file)
@@ -61,6 +61,7 @@ static void ll_inode_destroy_callback(struct rcu_head *head)
 {
        struct inode *inode = container_of(head, struct inode, i_rcu);
        struct ll_inode_info *ptr = ll_i2info(inode);
+       llcrypt_free_inode(inode);
        OBD_SLAB_FREE_PTR(ptr, ll_inode_cachep);
 }
 
@@ -69,17 +70,28 @@ static void ll_destroy_inode(struct inode *inode)
        call_rcu(&inode->i_rcu, ll_inode_destroy_callback);
 }
 
+static int ll_drop_inode(struct inode *inode)
+{
+       int drop = generic_drop_inode(inode);
+
+       if (!drop)
+               drop = llcrypt_drop_inode(inode);
+
+       return drop;
+}
+
 /* exported operations */
 struct super_operations lustre_super_operations =
 {
-        .alloc_inode   = ll_alloc_inode,
-        .destroy_inode = ll_destroy_inode,
-        .evict_inode   = ll_delete_inode,
-        .put_super     = ll_put_super,
-        .statfs        = ll_statfs,
-        .umount_begin  = ll_umount_begin,
-        .remount_fs    = ll_remount_fs,
-        .show_options  = ll_show_options,
+       .alloc_inode   = ll_alloc_inode,
+       .destroy_inode = ll_destroy_inode,
+       .drop_inode    = ll_drop_inode,
+       .evict_inode   = ll_delete_inode,
+       .put_super     = ll_put_super,
+       .statfs        = ll_statfs,
+       .umount_begin  = ll_umount_begin,
+       .remount_fs    = ll_remount_fs,
+       .show_options  = ll_show_options,
 };
 
 static int __init lustre_init(void)
@@ -88,7 +100,8 @@ static int __init lustre_init(void)
        int i, rc;
        unsigned long lustre_inode_cache_flags;
 
-       CLASSERT(sizeof(LUSTRE_VOLATILE_HDR) == LUSTRE_VOLATILE_HDR_LEN + 1);
+       BUILD_BUG_ON(sizeof(LUSTRE_VOLATILE_HDR) !=
+                    LUSTRE_VOLATILE_HDR_LEN + 1);
 
        /* print an address of _any_ initialized kernel symbol from this
         * module, to allow debugging with gdb that doesn't support data
@@ -148,8 +161,7 @@ static int __init lustre_init(void)
        if (rc != 0)
                GOTO(out_inode_fini_env, rc);
 
-       lustre_register_client_fill_super(ll_fill_super);
-       lustre_register_kill_super_cb(ll_kill_super);
+       lustre_register_super_ops(THIS_MODULE, ll_fill_super, ll_kill_super);
 
        RETURN(0);
 
@@ -168,8 +180,7 @@ out_cache:
 
 static void __exit lustre_exit(void)
 {
-       lustre_register_client_fill_super(NULL);
-       lustre_register_kill_super_cb(NULL);
+       lustre_register_super_ops(NULL, NULL, NULL);
 
        llite_tunables_unregister();