]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/staging/lustre/lustre/llite/llite_internal.h
staging: lustre: remove remote client support
[karo-tx-linux.git] / drivers / staging / lustre / lustre / llite / llite_internal.h
index e3c0f1dd4d3130471cddea4a547f3e3773ae755f..8fe63bd8ec009df13d4eec0f63f3d5e00199e515 100644 (file)
  *
  * You should have received a copy of the GNU General Public License
  * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
  *
  * GPL HEADER END
  */
 
 /* for struct cl_lock_descr and struct cl_io */
 #include "../include/cl_object.h"
-#include "../include/lclient.h"
 #include "../include/lustre_mdc.h"
 #include "../include/lustre_intent.h"
 #include <linux/compat.h>
 #include <linux/posix_acl_xattr.h>
+#include "vvp_internal.h"
 
 #ifndef FMODE_EXEC
 #define FMODE_EXEC 0
@@ -76,9 +72,6 @@ struct ll_dentry_data {
 #define LLI_INODE_MAGIC                 0x111d0de5
 #define LLI_INODE_DEAD           0xdeadd00d
 
-/* remote client permission cache */
-#define REMOTE_PERM_HASHSIZE 16
-
 struct ll_getname_data {
        struct dir_context ctx;
        char        *lgd_name;      /* points to a buffer with NAME_MAX+1 size */
@@ -86,17 +79,11 @@ struct ll_getname_data {
        int           lgd_found;     /* inode matched? */
 };
 
-/* llite setxid/access permission for user on remote client */
-struct ll_remote_perm {
-       struct hlist_node       lrp_list;
-       uid_t              lrp_uid;
-       gid_t              lrp_gid;
-       uid_t              lrp_fsuid;
-       gid_t              lrp_fsgid;
-       int                lrp_access_perm; /* MAY_READ/WRITE/EXEC, this
-                                            * is access permission with
-                                            * lrp_fsuid/lrp_fsgid.
-                                            */
+struct ll_grouplock {
+       struct lu_env   *lg_env;
+       struct cl_io    *lg_io;
+       struct cl_lock  *lg_lock;
+       unsigned long    lg_gid;
 };
 
 enum lli_flags {
@@ -126,9 +113,6 @@ struct ll_inode_info {
        spinlock_t                      lli_lock;
        struct posix_acl                *lli_posix_acl;
 
-       struct hlist_head               *lli_remote_perms;
-       struct mutex                            lli_rmtperm_mutex;
-
        /* identifying fields for both metadata and data stacks. */
        struct lu_fid              lli_fid;
        /* Parent fid for accessing default stripe data on parent directory
@@ -138,8 +122,6 @@ struct ll_inode_info {
 
        struct list_head              lli_close_list;
 
-       unsigned long                 lli_rmtperm_time;
-
        /* handle is to be sent to MDS later on done_writing and setattr.
         * Open handle data are needed for the recovery to reconstruct
         * the inode state on the MDS. XXX: recovery is not ready yet.
@@ -161,7 +143,9 @@ struct ll_inode_info {
        struct inode                    lli_vfs_inode;
 
        /* the most recent timestamps obtained from mds */
-       struct ost_lvb                  lli_lvb;
+       s64                             lli_atime;
+       s64                             lli_mtime;
+       s64                             lli_ctime;
        spinlock_t                      lli_agl_lock;
 
        /* Try to make the d::member and f::member are aligned. Before using
@@ -328,6 +312,7 @@ enum ra_stat {
        RA_STAT_EOF,
        RA_STAT_MAX_IN_FLIGHT,
        RA_STAT_WRONG_GRAB_PAGE,
+       RA_STAT_FAILED_REACH_END,
        _NR_RA_STAT,
 };
 
@@ -401,7 +386,7 @@ enum stats_track_type {
 #define LL_SBI_FLOCK        0x04
 #define LL_SBI_USER_XATTR      0x08 /* support user xattr */
 #define LL_SBI_ACL            0x10 /* support ACL */
-#define LL_SBI_RMT_CLIENT      0x40 /* remote client */
+/* LL_SBI_RMT_CLIENT            0x40    remote client */
 #define LL_SBI_MDS_CAPA                 0x80 /* support mds capa, obsolete */
 #define LL_SBI_OSS_CAPA                0x100 /* support oss capa, obsolete */
 #define LL_SBI_LOCALFLOCK       0x200 /* Local flocks support by kernel */
@@ -423,7 +408,7 @@ enum stats_track_type {
        "xattr",        \
        "acl",          \
        "???",          \
-       "rmt_client",   \
+       "???",          \
        "mds_capa",     \
        "oss_capa",     \
        "flock",        \
@@ -439,26 +424,6 @@ enum stats_track_type {
        "xattr",        \
 }
 
-#define RCE_HASHES      32
-
-struct rmtacl_ctl_entry {
-       struct list_head       rce_list;
-       pid_t       rce_key; /* hash key */
-       int           rce_ops; /* acl operation type */
-};
-
-struct rmtacl_ctl_table {
-       spinlock_t      rct_lock;
-       struct list_head        rct_entries[RCE_HASHES];
-};
-
-#define EE_HASHES       32
-
-struct eacl_table {
-       spinlock_t      et_lock;
-       struct list_head        et_entries[EE_HASHES];
-};
-
 struct ll_sb_info {
        /* this protects pglist and ra_info.  It isn't safe to
         * grab from interrupt contexts
@@ -481,6 +446,12 @@ struct ll_sb_info {
 
        struct lprocfs_stats     *ll_stats; /* lprocfs stats counter */
 
+       /*
+        * Used to track "unstable" pages on a client, and maintain a
+        * LRU list of clean pages. An "unstable" page is defined as
+        * any page which is sent to a server as part of a bulk request,
+        * but is uncommitted to stable storage.
+        */
        struct cl_client_cache    ll_cache;
 
        struct lprocfs_stats     *ll_ra_stats;
@@ -517,21 +488,12 @@ struct ll_sb_info {
        dev_t                     ll_sdev_orig; /* save s_dev before assign for
                                                 * clustered nfs
                                                 */
-       struct rmtacl_ctl_table   ll_rct;
-       struct eacl_table        ll_et;
        __kernel_fsid_t           ll_fsid;
        struct kobject           ll_kobj; /* sysfs object */
        struct super_block      *ll_sb; /* struct super_block (for sysfs code)*/
        struct completion        ll_kobj_unregister;
 };
 
-struct ll_ra_read {
-       pgoff_t      lrr_start;
-       pgoff_t      lrr_count;
-       struct task_struct *lrr_reader;
-       struct list_head          lrr_linkage;
-};
-
 /*
  * per file-descriptor read-ahead data.
  */
@@ -589,12 +551,6 @@ struct ll_readahead_state {
         * will not be accurate when dealing with reads issued via mmap.
         */
        unsigned long   ras_request_index;
-       /*
-        * list of struct ll_ra_read's one per read(2) call current in
-        * progress against this file descriptor. Used by read-ahead code,
-        * protected by ->ras_lock.
-        */
-       struct list_head      ras_read_beads;
        /*
         * The following 3 items are used for detecting the stride I/O
         * mode.
@@ -622,7 +578,7 @@ extern struct kmem_cache *ll_file_data_slab;
 struct lustre_handle;
 struct ll_file_data {
        struct ll_readahead_state fd_ras;
-       struct ccc_grouplock fd_grouplock;
+       struct ll_grouplock fd_grouplock;
        __u64 lfd_pos;
        __u32 fd_flags;
        fmode_t fd_omode;
@@ -637,6 +593,8 @@ struct ll_file_data {
         * false: unknown failure, should report.
         */
        bool fd_write_failed;
+       rwlock_t fd_lock; /* protect lcc list */
+       struct list_head fd_lccs; /* list of ll_cl_context */
 };
 
 struct lov_stripe_md;
@@ -663,8 +621,16 @@ static inline int ll_need_32bit_api(struct ll_sb_info *sbi)
 #endif
 }
 
-void ll_ra_read_in(struct file *f, struct ll_ra_read *rar);
-void ll_ra_read_ex(struct file *f, struct ll_ra_read *rar);
+void ll_ras_enter(struct file *f);
+
+/* llite/lcommon_misc.c */
+int cl_init_ea_size(struct obd_export *md_exp, struct obd_export *dt_exp);
+int cl_ocd_update(struct obd_device *host,
+                 struct obd_device *watched,
+                 enum obd_notify_event ev, void *owner, void *data);
+int cl_get_grouplock(struct cl_object *obj, unsigned long gid, int nonblock,
+                    struct ll_grouplock *cg);
+void cl_put_grouplock(struct ll_grouplock *cg);
 
 /* llite/lproc_llite.c */
 int ldebugfs_register_mountpoint(struct dentry *parent,
@@ -697,15 +663,16 @@ int ll_md_blocking_ast(struct ldlm_lock *, struct ldlm_lock_desc *,
 struct dentry *ll_splice_alias(struct inode *inode, struct dentry *de);
 
 /* llite/rw.c */
-int ll_prepare_write(struct file *, struct page *, unsigned from, unsigned to);
-int ll_commit_write(struct file *, struct page *, unsigned from, unsigned to);
 int ll_writepage(struct page *page, struct writeback_control *wbc);
 int ll_writepages(struct address_space *, struct writeback_control *wbc);
 int ll_readpage(struct file *file, struct page *page);
 void ll_readahead_init(struct inode *inode, struct ll_readahead_state *ras);
 int ll_readahead(const struct lu_env *env, struct cl_io *io,
-                struct ll_readahead_state *ras, struct address_space *mapping,
-                struct cl_page_list *queue, int flags);
+                struct cl_page_list *queue, struct ll_readahead_state *ras,
+                bool hit);
+struct ll_cl_context *ll_cl_find(struct file *file);
+void ll_cl_add(struct file *file, const struct lu_env *env, struct cl_io *io);
+void ll_cl_remove(struct file *file, const struct lu_env *env);
 
 extern const struct address_space_operations ll_aops;
 
@@ -740,7 +707,7 @@ struct posix_acl *ll_get_acl(struct inode *inode, int type);
 int ll_inode_permission(struct inode *inode, int mask);
 
 int ll_lov_setstripe_ea_info(struct inode *inode, struct dentry *dentry,
-                            int flags, struct lov_user_md *lum,
+                            __u64 flags, struct lov_user_md *lum,
                             int lum_size);
 int ll_lov_getstripe_ea_info(struct inode *inode, const char *filename,
                             struct lov_mds_md **lmm, int *lmm_size,
@@ -750,9 +717,9 @@ int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump,
 int ll_dir_getstripe(struct inode *inode, struct lov_mds_md **lmmp,
                     int *lmm_size, struct ptlrpc_request **request);
 int ll_fsync(struct file *file, loff_t start, loff_t end, int data);
-int ll_merge_lvb(const struct lu_env *env, struct inode *inode);
+int ll_merge_attr(const struct lu_env *env, struct inode *inode);
 int ll_fid2path(struct inode *inode, void __user *arg);
-int ll_data_version(struct inode *inode, __u64 *data_version, int extent_lock);
+int ll_data_version(struct inode *inode, __u64 *data_version, int flags);
 int ll_hsm_release(struct inode *inode);
 
 /* llite/dcache.c */
@@ -824,65 +791,8 @@ struct ll_close_queue {
        atomic_t                lcq_stop;
 };
 
-struct ccc_object *cl_inode2ccc(struct inode *inode);
-
-void vvp_write_pending (struct ccc_object *club, struct ccc_page *page);
-void vvp_write_complete(struct ccc_object *club, struct ccc_page *page);
-
-/* specific architecture can implement only part of this list */
-enum vvp_io_subtype {
-       /** normal IO */
-       IO_NORMAL,
-       /** io started from splice_{read|write} */
-       IO_SPLICE
-};
-
-/* IO subtypes */
-struct vvp_io {
-       /** io subtype */
-       enum vvp_io_subtype    cui_io_subtype;
-
-       union {
-               struct {
-                       struct pipe_inode_info *cui_pipe;
-                       unsigned int        cui_flags;
-               } splice;
-               struct vvp_fault_io {
-                       /**
-                        * Inode modification time that is checked across DLM
-                        * lock request.
-                        */
-                       time64_t            ft_mtime;
-                       struct vm_area_struct *ft_vma;
-                       /**
-                        *  locked page returned from vvp_io
-                        */
-                       struct page         *ft_vmpage;
-                       struct vm_fault_api {
-                               /**
-                                * kernel fault info
-                                */
-                               struct vm_fault *ft_vmf;
-                               /**
-                                * fault API used bitflags for return code.
-                                */
-                               unsigned int    ft_flags;
-                               /**
-                                * check that flags are from filemap_fault
-                                */
-                               bool            ft_flags_valid;
-                       } fault;
-               } fault;
-       } u;
-       /**
-        * Read-ahead state used by read and page-fault IO contexts.
-        */
-       struct ll_ra_read    cui_bead;
-       /**
-        * Set when cui_bead has been initialized.
-        */
-       int               cui_ra_window_set;
-};
+void vvp_write_pending(struct vvp_object *club, struct vvp_page *page);
+void vvp_write_complete(struct vvp_object *club, struct vvp_page *page);
 
 /**
  * IO arguments for various VFS I/O interfaces.
@@ -904,61 +814,39 @@ struct vvp_io_args {
 };
 
 struct ll_cl_context {
+       struct list_head         lcc_list;
        void       *lcc_cookie;
+       const struct lu_env     *lcc_env;
        struct cl_io   *lcc_io;
        struct cl_page *lcc_page;
-       struct lu_env  *lcc_env;
-       int          lcc_refcheck;
 };
 
-struct vvp_thread_info {
-       struct vvp_io_args   vti_args;
-       struct ra_io_arg     vti_ria;
-       struct ll_cl_context vti_io_ctx;
+struct ll_thread_info {
+       struct vvp_io_args   lti_args;
+       struct ra_io_arg     lti_ria;
+       struct ll_cl_context lti_io_ctx;
 };
 
-static inline struct vvp_thread_info *vvp_env_info(const struct lu_env *env)
+extern struct lu_context_key ll_thread_key;
+static inline struct ll_thread_info *ll_env_info(const struct lu_env *env)
 {
-       extern struct lu_context_key vvp_key;
-       struct vvp_thread_info      *info;
+       struct ll_thread_info *lti;
 
-       info = lu_context_key_get(&env->le_ctx, &vvp_key);
-       LASSERT(info);
-       return info;
+       lti = lu_context_key_get(&env->le_ctx, &ll_thread_key);
+       LASSERT(lti);
+       return lti;
 }
 
-static inline struct vvp_io_args *vvp_env_args(const struct lu_env *env,
-                                              enum vvp_io_subtype type)
+static inline struct vvp_io_args *ll_env_args(const struct lu_env *env,
+                                             enum vvp_io_subtype type)
 {
-       struct vvp_io_args *ret = &vvp_env_info(env)->vti_args;
-
-       ret->via_io_subtype = type;
-
-       return ret;
-}
+       struct vvp_io_args *via = &ll_env_info(env)->lti_args;
 
-struct vvp_session {
-       struct vvp_io    vs_ios;
-};
-
-static inline struct vvp_session *vvp_env_session(const struct lu_env *env)
-{
-       extern struct lu_context_key vvp_session_key;
-       struct vvp_session *ses;
+       via->via_io_subtype = type;
 
-       ses = lu_context_key_get(env->le_ses, &vvp_session_key);
-       LASSERT(ses);
-       return ses;
+       return via;
 }
 
-static inline struct vvp_io *vvp_env_io(const struct lu_env *env)
-{
-       return &vvp_env_session(env)->vs_ios;
-}
-
-int vvp_global_init(void);
-void vvp_global_fini(void);
-
 void ll_queue_done_writing(struct inode *inode, unsigned long flags);
 void ll_close_thread_shutdown(struct ll_close_queue *lcq);
 int ll_close_thread_start(struct ll_close_queue **lcq_ret);
@@ -981,6 +869,10 @@ static inline void ll_invalidate_page(struct page *vmpage)
        if (!mapping)
                return;
 
+       /*
+        * truncate_complete_page() calls
+        * a_ops->invalidatepage()->cl_page_delete()->vvp_page_delete().
+        */
        ll_teardown_mmaps(mapping, offset, offset + PAGE_SIZE);
        truncate_complete_page(mapping, vmpage);
 }
@@ -1040,24 +932,13 @@ static inline __u64 ll_file_maxbytes(struct inode *inode)
 }
 
 /* llite/xattr.c */
-int ll_setxattr(struct dentry *dentry, const char *name,
-               const void *value, size_t size, int flags);
-ssize_t ll_getxattr(struct dentry *dentry, const char *name,
-                   void *buffer, size_t size);
+int ll_setxattr(struct dentry *dentry, struct inode *inode,
+               const char *name, const void *value, size_t size, int flags);
+ssize_t ll_getxattr(struct dentry *dentry, struct inode *inode,
+                   const char *name, void *buffer, size_t size);
 ssize_t ll_listxattr(struct dentry *dentry, char *buffer, size_t size);
 int ll_removexattr(struct dentry *dentry, const char *name);
 
-/* llite/remote_perm.c */
-extern struct kmem_cache *ll_remote_perm_cachep;
-extern struct kmem_cache *ll_rmtperm_hash_cachep;
-
-void free_rmtperm_hash(struct hlist_head *hash);
-int ll_update_remote_perm(struct inode *inode, struct mdt_remote_perm *perm);
-int lustre_check_remote_perm(struct inode *inode, int mask);
-
-/* llite/llite_cl.c */
-extern struct lu_device_type vvp_device_type;
-
 /**
  * Common IO arguments for various VFS I/O interfaces.
  */
@@ -1069,42 +950,9 @@ void ras_update(struct ll_sb_info *sbi, struct inode *inode,
                struct ll_readahead_state *ras, unsigned long index,
                unsigned hit);
 void ll_ra_count_put(struct ll_sb_info *sbi, unsigned long len);
-void ll_ra_stats_inc(struct address_space *mapping, enum ra_stat which);
-
-/* llite/llite_rmtacl.c */
-#ifdef CONFIG_FS_POSIX_ACL
-struct eacl_entry {
-       struct list_head            ee_list;
-       pid_t            ee_key; /* hash key */
-       struct lu_fid    ee_fid;
-       int                ee_type; /* ACL type for ACCESS or DEFAULT */
-       ext_acl_xattr_header *ee_acl;
-};
-
-u64 rce_ops2valid(int ops);
-struct rmtacl_ctl_entry *rct_search(struct rmtacl_ctl_table *rct, pid_t key);
-int rct_add(struct rmtacl_ctl_table *rct, pid_t key, int ops);
-int rct_del(struct rmtacl_ctl_table *rct, pid_t key);
-void rct_init(struct rmtacl_ctl_table *rct);
-void rct_fini(struct rmtacl_ctl_table *rct);
-
-void ee_free(struct eacl_entry *ee);
-int ee_add(struct eacl_table *et, pid_t key, struct lu_fid *fid, int type,
-          ext_acl_xattr_header *header);
-struct eacl_entry *et_search_del(struct eacl_table *et, pid_t key,
-                                struct lu_fid *fid, int type);
-void et_search_free(struct eacl_table *et, pid_t key);
-void et_init(struct eacl_table *et);
-void et_fini(struct eacl_table *et);
-#else
-static inline u64 rce_ops2valid(int ops)
-{
-       return 0;
-}
-#endif
+void ll_ra_stats_inc(struct inode *inode, enum ra_stat which);
 
 /* statahead.c */
-
 #define LL_SA_RPC_MIN     2
 #define LL_SA_RPC_DEF     32
 #define LL_SA_RPC_MAX     8192
@@ -1163,6 +1011,22 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentry,
                       int only_unplug);
 void ll_stop_statahead(struct inode *dir, void *key);
 
+blkcnt_t dirty_cnt(struct inode *inode);
+
+int cl_glimpse_size0(struct inode *inode, int agl);
+int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
+                   struct inode *inode, struct cl_object *clob, int agl);
+
+static inline int cl_glimpse_size(struct inode *inode)
+{
+       return cl_glimpse_size0(inode, 0);
+}
+
+static inline int cl_agl(struct inode *inode)
+{
+       return cl_glimpse_size0(inode, 1);
+}
+
 static inline int ll_glimpse_size(struct inode *inode)
 {
        struct ll_inode_info *lli = ll_i2info(inode);
@@ -1285,43 +1149,6 @@ typedef enum llioc_iter (*llioc_callback_t)(struct inode *inode,
 void *ll_iocontrol_register(llioc_callback_t cb, int count, unsigned int *cmd);
 void ll_iocontrol_unregister(void *magic);
 
-/* lclient compat stuff */
-#define cl_inode_info ll_inode_info
-#define cl_i2info(info) ll_i2info(info)
-#define cl_inode_mode(inode) ((inode)->i_mode)
-#define cl_i2sbi ll_i2sbi
-
-static inline struct ll_file_data *cl_iattr2fd(struct inode *inode,
-                                              const struct iattr *attr)
-{
-       LASSERT(attr->ia_valid & ATTR_FILE);
-       return LUSTRE_FPRIVATE(attr->ia_file);
-}
-
-static inline void cl_isize_write_nolock(struct inode *inode, loff_t kms)
-{
-       LASSERT(mutex_is_locked(&ll_i2info(inode)->lli_size_mutex));
-       i_size_write(inode, kms);
-}
-
-static inline void cl_isize_write(struct inode *inode, loff_t kms)
-{
-       ll_inode_size_lock(inode);
-       i_size_write(inode, kms);
-       ll_inode_size_unlock(inode);
-}
-
-#define cl_isize_read(inode)        i_size_read(inode)
-
-static inline int cl_merge_lvb(const struct lu_env *env, struct inode *inode)
-{
-       return ll_merge_lvb(env, inode);
-}
-
-#define cl_inode_atime(inode) LTIME_S((inode)->i_atime)
-#define cl_inode_ctime(inode) LTIME_S((inode)->i_ctime)
-#define cl_inode_mtime(inode) LTIME_S((inode)->i_mtime)
-
 int cl_sync_file_range(struct inode *inode, loff_t start, loff_t end,
                       enum cl_fsync_mode mode, int ignore_layout);
 
@@ -1350,7 +1177,7 @@ static inline void cl_stats_tally(struct cl_device *dev, enum cl_req_type crt,
        int opc = (crt == CRT_READ) ? LPROC_LL_OSC_READ :
                                      LPROC_LL_OSC_WRITE;
 
-       ll_stats_ops_tally(ll_s2sbi(cl2ccc_dev(dev)->cdv_sb), opc, rc);
+       ll_stats_ops_tally(ll_s2sbi(cl2vvp_dev(dev)->vdv_sb), opc, rc);
 }
 
 ssize_t ll_direct_rw_pages(const struct lu_env *env, struct cl_io *io,
@@ -1382,18 +1209,16 @@ static inline void ll_set_lock_data(struct obd_export *exp, struct inode *inode,
                 */
                if (it->d.lustre.it_remote_lock_mode) {
                        handle.cookie = it->d.lustre.it_remote_lock_handle;
-                       CDEBUG(D_DLMTRACE, "setting l_data to inode %p(%lu/%u) for remote lock %#llx\n",
-                              inode,
-                              inode->i_ino, inode->i_generation,
+                       CDEBUG(D_DLMTRACE, "setting l_data to inode "DFID"%p for remote lock %#llx\n",
+                              PFID(ll_inode2fid(inode)), inode,
                               handle.cookie);
                        md_set_lock_data(exp, &handle.cookie, inode, NULL);
                }
 
                handle.cookie = it->d.lustre.it_lock_handle;
 
-               CDEBUG(D_DLMTRACE, "setting l_data to inode %p (%lu/%u) for lock %#llx\n",
-                      inode, inode->i_ino,
-                      inode->i_generation, handle.cookie);
+               CDEBUG(D_DLMTRACE, "setting l_data to inode "DFID"%p for lock %#llx\n",
+                      PFID(ll_inode2fid(inode)), inode, handle.cookie);
 
                md_set_lock_data(exp, &handle.cookie, inode,
                                 &it->d.lustre.it_lock_bits);
@@ -1471,9 +1296,25 @@ enum {
 
 int ll_layout_conf(struct inode *inode, const struct cl_object_conf *conf);
 int ll_layout_refresh(struct inode *inode, __u32 *gen);
-int ll_layout_restore(struct inode *inode);
+int ll_layout_restore(struct inode *inode, loff_t start, __u64 length);
 
 int ll_xattr_init(void);
 void ll_xattr_fini(void);
 
+int ll_page_sync_io(const struct lu_env *env, struct cl_io *io,
+                   struct cl_page *page, enum cl_req_type crt);
+
+/* lcommon_cl.c */
+int cl_setattr_ost(struct inode *inode, const struct iattr *attr);
+
+extern struct lu_env *cl_inode_fini_env;
+extern int cl_inode_fini_refcheck;
+
+int cl_file_inode_init(struct inode *inode, struct lustre_md *md);
+void cl_inode_fini(struct inode *inode);
+int cl_local_size(struct inode *inode);
+
+__u64 cl_fid_build_ino(const struct lu_fid *fid, int api32);
+__u32 cl_fid_build_gen(const struct lu_fid *fid);
+
 #endif /* LLITE_INTERNAL_H */