Whamcloud - gitweb
Commit OST AMD support to HEAD so we can being running with a common code base.
[fs/lustre-release.git] / lustre / llite / llite_lib.c
index d8ae8e8..906e978 100644 (file)
@@ -106,74 +106,6 @@ int lustre_init_ea_size(struct ll_sb_info *sbi)
 
         RETURN(rc);
 }
-#if CONFIG_SNAPFS
-int lustre_set_clone_info(struct super_block *sb, int clone_index)
-{
-        struct ll_sb_info *sbi = ll_s2sbi(sb);
-        
-        ENTRY;
-
-        CDEBUG(D_INFO, "set clone index %d\n", clone_index);
-        if (!clone_index)
-                RETURN(0); 
-        
-        if (sbi->ll_mdc_exp) {
-                struct obd_device *obd = class_exp2obd(sbi->ll_mdc_exp);
-                struct client_obd *cl_obd = &obd->u.cli;
-
-                OBD_ALLOC(cl_obd->cl_clone_info, sizeof(struct clonefs_info));
-                if (!cl_obd->cl_clone_info) 
-                        RETURN(-ENOMEM);
-                SET_CLONE_INDEX(cl_obd->cl_clone_info, clone_index);
-                SET_CLONE_FLAGS(cl_obd->cl_clone_info, SM_CLONE_FS);
-                cl_obd->cl_clone_info->cl_clone_info->clone_magic = 
-                                                  cpu_to_le32(CLONE_INFO_MAGI);
-        }
-        
-        if (sbi->ll_osc_exp) {
-                struct obd_device *obd = class_exp2obd(sbi->ll_osc_exp);
-                struct client_obd *cl_obd = &obd->u.cli;
-
-                OBD_ALLOC(cl_obd->cl_clone_info, sizeof(struct clonefs_info));
-                if (!cl_obd->cl_clone_info) 
-                        RETURN(-ENOMEM);
-                SET_CLONE_INDEX(cl_obd->cl_clone_info, clone_index);
-                SET_CLONE_FLAGS(cl_obd->cl_clone_info, SM_CLONE_FS);
-                cl_obd->cl_clone_info->cl_clone_info->clone_magic = 
-                                                  cpu_to_le32(CLONE_INFO_MAGI);
-        }
-        RETURN(0); 
-}
-
-int lustre_cleanup_clone_info(struct super_block *sb)
-{
-        struct ll_sb_info *sbi = ll_s2sbi(sb);
-       
-        ENTRY; 
-
-        if (sbi->ll_mdc_exp) {
-                struct obd_device *obd = class_exp2obd(sbi->ll_mdc_exp);
-                struct client_obd *cl_obd = &obd->u.cli;
-
-                if (!cl_obd->cl_clone_info) 
-                        RETURN(0); 
-                CDEBUG(D_INFO, "clean clone info %p\n", cl_obd->cl_clone_info);
-                OBD_FREE(cl_obd->cl_clone_info, sizeof(struct clonefs_info));
-        }
-        
-        if (sbi->ll_osc_exp) {
-                struct obd_device *obd = class_exp2obd(sbi->ll_osc_exp);
-                struct client_obd *cl_obd = &obd->u.cli;
-
-                if (!cl_obd->cl_clone_info) 
-                        RETURN(0); 
-                CDEBUG(D_INFO, "clean clone info %p\n", cl_obd->cl_clone_info);
-                OBD_FREE(cl_obd->cl_clone_info, sizeof(struct clonefs_info));
-        }
-        RETURN(0); 
-}
-#endif
-
 
 int lustre_common_fill_super(struct super_block *sb, char *mdc, char *osc)
 {
@@ -471,16 +403,6 @@ int ll_fill_super(struct super_block *sb, void *data, int silent)
         }
 
         err = lustre_common_fill_super(sb, mdc, osc);
-#if CONFIG_SNAPFS        
-        if (clone_opts) {
-                int clone_index = 0;
-                char *endp;
-
-                /*set clone info to the super block*/
-                clone_index = simple_strtoul(clone_opts, &endp, 0);
-                err = lustre_set_clone_info(sb, clone_index);                
-        }
-#endif         
 out:
         if (err)
                 lustre_free_sbi(sb);
@@ -712,15 +634,6 @@ int lustre_fill_super(struct super_block *sb, void *data, int silent)
 
         if (err)
                 GOTO(out_free, err);
-
-#if CONFIG_SNAPFS
-        if (lmd->lmd_clone_index) {
-                err = lustre_set_clone_info(sb, lmd->lmd_clone_index);                
-        }
-        
-        if (err)
-                GOTO(out_free, err);
-#endif
         
 out_dev:
         if (mdc)
@@ -754,9 +667,6 @@ out_free:
                 }
                 OBD_FREE(sbi->ll_lmd, sizeof(*sbi->ll_lmd));
         }
-#if CONFIG_SNAPFS
-        lustre_cleanup_clone_info(sb);
-#endif
         lustre_free_sbi(sb);
 
         goto out_dev;
@@ -804,10 +714,6 @@ void lustre_put_super(struct super_block *sb)
                 force_umount = obd->obd_no_recov;
         obd = NULL;
 
-#if CONFIG_SNAPFS
-        lustre_cleanup_clone_info(sb);
-#endif
-
         lustre_common_put_super(sb);
         if (sbi->ll_lmd != NULL) {
                 char * cln_prof;
@@ -934,11 +840,12 @@ struct inode *ll_inode_from_lock(struct ldlm_lock *lock)
 
 int null_if_equal(struct ldlm_lock *lock, void *data)
 {
-        if (data == lock->l_ast_data)
+        if (data == lock->l_ast_data) {
                 lock->l_ast_data = NULL;
 
-        if (lock->l_req_mode != lock->l_granted_mode)
-                return LDLM_ITER_STOP;
+                if (lock->l_req_mode != lock->l_granted_mode)
+                        LDLM_ERROR(lock,"clearing inode with ungranted lock\n");
+        }
 
         return LDLM_ITER_CONTINUE;
 }
@@ -1245,14 +1152,6 @@ int ll_statfs(struct super_block *sb, struct kstatfs *sfs)
         return 0;
 }
 
-void dump_lsm(int level, struct lov_stripe_md *lsm)
-{
-        CDEBUG(level, "objid "LPX64", maxbytes "LPX64", magic 0x%08X, "
-               "stripe_size %u, stripe_count %u\n",
-               lsm->lsm_object_id, lsm->lsm_maxbytes, lsm->lsm_magic,
-               lsm->lsm_stripe_size, lsm->lsm_stripe_count);
-}
-
 void ll_update_inode(struct inode *inode, struct lustre_md *md)
 {
         struct ll_inode_info *lli = ll_i2info(inode);