Whamcloud - gitweb
LU-7045 osd: enough credits for single indirect block write
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_oi.c
index b4bfb9a..a6fed15 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2012, 2013, Intel Corporation.
+ * Copyright (c) 2012, 2014, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -40,7 +40,7 @@
  * Author: Nikita Danilov <nikita@clusterfs.com>
  */
 
-#define DEBUG_SUBSYSTEM S_MDS
+#define DEBUG_SUBSYSTEM S_OSD
 
 #include <linux/module.h>
 
@@ -139,6 +139,9 @@ static int osd_oi_index_create_one(struct osd_thread_info *info,
                return PTR_ERR(inode);
        }
 
+       ldiskfs_set_inode_state(inode, LDISKFS_STATE_LUSTRE_NOSCRUB);
+       unlock_new_inode(inode);
+
        if (feat->dif_flags & DT_IND_VARKEY)
                rc = iam_lvar_create(inode, feat->dif_keysize_max,
                                     feat->dif_ptrsize, feat->dif_recsize_max,
@@ -228,7 +231,6 @@ static int osd_oi_open(struct osd_thread_info *info, struct osd_device *osd,
         if (IS_ERR(inode))
                 RETURN(PTR_ERR(inode));
 
-       ldiskfs_set_inode_state(inode, LDISKFS_STATE_LUSTRE_NO_OI);
        /* 'What the @fid is' is not imporatant, because these objects
         * have no OI mappings, and only are visible inside the OSD.*/
        lu_igif_build(&info->oti_fid, inode->i_ino, inode->i_generation);
@@ -512,6 +514,9 @@ int fid_is_on_ost(struct osd_thread_info *info, struct osd_device *osd,
        if (!(flags & OI_CHECK_FLD))
                RETURN(0);
 
+       if (osd_seq_site(osd)->ss_server_fld == NULL)
+               RETURN(0);
+
        rc = osd_fld_lookup(info->oti_env, osd, fid_seq(fid), range);
        if (rc != 0) {
                if (rc != -ENOENT)