Whamcloud - gitweb
b=15908
[fs/lustre-release.git] / lustre / llite / llite_lib.c
index 7b63ce3..0c32ba0 100644 (file)
@@ -106,6 +106,9 @@ static struct ll_sb_info *ll_init_sbi(void)
                 spin_lock_init(&sbi->ll_rw_extents_info.pp_extents[i].pp_w_hist.oh_lock);
         }
 
+        /* metadata statahead is enabled by default */
+        sbi->ll_sa_max = LL_SA_RPC_DEF;
+
         RETURN(sbi);
 }
 
@@ -194,7 +197,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt)
                 err = lprocfs_register_mountpoint(proc_lustre_fs_root, sb,
                                                   dt, md);
                 if (err < 0)
-                        CERROR("could not register mount in /proc/lustre");
+                        CERROR("could not register mount in /proc/fs/lustre\n");
         }
 
         /* indicate the features supported by this client */
@@ -1105,6 +1108,13 @@ void ll_clear_inode(struct inode *inode)
         CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p)\n", inode->i_ino,
                inode->i_generation, inode);
 
+        if (S_ISDIR(inode->i_mode)) {
+                /* these should have been cleared in ll_file_release */
+                LASSERT(lli->lli_sai == NULL);
+                LASSERT(lli->lli_opendir_key == NULL);
+                LASSERT(lli->lli_opendir_pid == 0);
+        }
+
         ll_i2info(inode)->lli_flags &= ~LLIF_MDS_SIZE_LOCK;
         md_change_cbdata(sbi->ll_md_exp, ll_inode2fid(inode),
                          null_if_equal, inode);
@@ -1403,7 +1413,7 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr)
         if (attr->ia_valid & (ATTR_MTIME | ATTR_CTIME))
                 CDEBUG(D_INODE, "setting mtime %lu, ctime %lu, now = %lu\n",
                        LTIME_S(attr->ia_mtime), LTIME_S(attr->ia_ctime),
-                       CURRENT_SECONDS);
+                       cfs_time_current_sec());
 
         /* NB: ATTR_SIZE will only be set after this point if the size
          * resides on the MDS, ie, this file has no objects. */
@@ -1697,6 +1707,8 @@ void ll_update_inode(struct inode *inode, struct lustre_md *md)
                 spin_unlock(&lli->lli_lock);
         }
 #endif
+        inode->i_ino = ll_fid_build_ino(sbi, &body->fid1);
+
         if (body->valid & OBD_MD_FLATIME &&
             body->atime > LTIME_S(inode->i_atime))
                 LTIME_S(inode->i_atime) = body->atime;
@@ -2237,12 +2249,13 @@ struct md_op_data * ll_prep_md_op_data(struct md_op_data *op_data,
                 op_data->op_capa2 = ll_mdscapa_get(i2);
         } else {
                 fid_zero(&op_data->op_fid2);
+                op_data->op_capa2 = NULL;
         }
 
         op_data->op_name = name;
         op_data->op_namelen = namelen;
         op_data->op_mode = mode;
-        op_data->op_mod_time = CURRENT_SECONDS;
+        op_data->op_mod_time = cfs_time_current_sec();
         op_data->op_fsuid = current->fsuid;
         op_data->op_fsgid = current->fsgid;
         op_data->op_cap = current->cap_effective;