Whamcloud - gitweb
LU-5971 llite: remove struct ll_ra_read
[fs/lustre-release.git] / lustre / llite / glimpse.c
index 0ebf4cd..7310b38 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2013, Intel Corporation.
+ * Copyright (c) 2011, 2014, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -51,7 +51,6 @@
 #include <linux/file.h>
 
 #include "cl_object.h"
-#include "lclient.h"
 #include "llite_internal.h"
 
 static const struct cl_lock_descr whole_file = {
@@ -69,23 +68,23 @@ static const struct cl_lock_descr whole_file = {
 blkcnt_t dirty_cnt(struct inode *inode)
 {
         blkcnt_t cnt = 0;
-        struct ccc_object *vob = cl_inode2ccc(inode);
+       struct vvp_object *vob = cl_inode2vvp(inode);
         void              *results[1];
 
         if (inode->i_mapping != NULL)
                 cnt += radix_tree_gang_lookup_tag(&inode->i_mapping->page_tree,
                                                   results, 0, 1,
                                                   PAGECACHE_TAG_DIRTY);
-       if (cnt == 0 && atomic_read(&vob->cob_mmap_cnt) > 0)
+       if (cnt == 0 && atomic_read(&vob->vob_mmap_cnt) > 0)
                cnt = 1;
 
         return (cnt > 0) ? 1 : 0;
 }
 
 int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
-                    struct inode *inode, struct cl_object *clob, int agl)
+                   struct inode *inode, struct cl_object *clob, int agl)
 {
-        struct cl_inode_info *lli   = cl_i2info(inode);
+       struct ll_inode_info *lli   = ll_i2info(inode);
         const struct lu_fid  *fid   = lu_object_fid(&clob->co_lu);
         int result;
 
@@ -130,7 +129,7 @@ int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
 
                        if (!agl) {
                                ll_merge_attr(env, inode);
-                               if (cl_isize_read(inode) > 0 &&
+                               if (i_size_read(inode) > 0 &&
                                    inode->i_blocks == 0) {
                                        /*
                                         * LU-417: Add dirty pages block count
@@ -152,15 +151,15 @@ int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
 }
 
 static int cl_io_get(struct inode *inode, struct lu_env **envout,
-                     struct cl_io **ioout, int *refcheck)
+                    struct cl_io **ioout, int *refcheck)
 {
-        struct lu_env          *env;
-        struct cl_io           *io;
-        struct cl_inode_info   *lli = cl_i2info(inode);
-        struct cl_object       *clob = lli->lli_clob;
-        int result;
+       struct lu_env           *env;
+       struct cl_io            *io;
+       struct ll_inode_info    *lli = ll_i2info(inode);
+       struct cl_object        *clob = lli->lli_clob;
+       int result;
 
-        if (S_ISREG(cl_inode_mode(inode))) {
+       if (S_ISREG(inode->i_mode)) {
                 env = cl_env_get(refcheck);
                 if (!IS_ERR(env)) {
                         io = ccc_env_thread_io(env);
@@ -228,7 +227,7 @@ int cl_local_size(struct inode *inode)
 
         ENTRY;
 
-       if (!cl_i2info(inode)->lli_has_smd)
+       if (!ll_i2info(inode)->lli_has_smd)
                 RETURN(0);
 
         result = cl_io_get(inode, &env, &io, &refcheck);