Whamcloud - gitweb
LU-3817 llite: Truncate to restore file
[fs/lustre-release.git] / lustre / llite / llite_internal.h
index 64055b4..4ee8ed3 100644 (file)
@@ -294,13 +294,6 @@ int ll_xattr_cache_get(struct inode *inode,
                        size_t size,
                        __u64 valid);
 
-int ll_xattr_cache_update(struct inode *inode,
-                       const char *name,
-                       const char *newval,
-                       size_t size,
-                       __u64 valid,
-                       int flags);
-
 /*
  * Locking to guarantee consistency of non-atomic updates to long long i_size,
  * consistency between file size and KMS.
@@ -541,7 +534,6 @@ struct ll_sb_info {
                                                  * clustred nfs */
         struct rmtacl_ctl_table   ll_rct;
         struct eacl_table         ll_et;
-       __kernel_fsid_t           ll_fsid;
 };
 
 #define LL_DEFAULT_MAX_RW_CHUNK      (32 * 1024 * 1024)
@@ -821,8 +813,8 @@ int ll_inode_permission(struct inode *inode, int mask);
 #endif
 
 int ll_lov_setstripe_ea_info(struct inode *inode, struct file *file,
-                             int flags, struct lov_user_md *lum,
-                             int lum_size);
+                            __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,
                              struct ptlrpc_request **request);
@@ -843,7 +835,7 @@ int ll_merge_lvb(const struct lu_env *env, struct inode *inode);
 int ll_get_grouplock(struct inode *inode, struct file *file, unsigned long arg);
 int ll_put_grouplock(struct inode *inode, struct file *file, unsigned long arg);
 int ll_fid2path(struct inode *inode, void *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);
 
 struct obd_client_handle *ll_lease_open(struct inode *inode, struct file *file,
@@ -918,7 +910,6 @@ char *ll_get_fsname(struct super_block *sb, char *buf, int buflen);
 /* llite/llite_nfs.c */
 extern struct export_operations lustre_export_operations;
 __u32 get_uuid2int(const char *name, int len);
-void get_uuid2fsid(const char *name, int len, __kernel_fsid_t *fsid);
 struct inode *search_inode_for_lustre(struct super_block *sb,
                                      const struct lu_fid *fid);
 
@@ -938,7 +929,7 @@ extern struct inode_operations ll_fast_symlink_inode_operations;
 struct ll_close_queue {
        spinlock_t              lcq_lock;
        cfs_list_t              lcq_head;
-       cfs_waitq_t             lcq_waitq;
+       wait_queue_head_t       lcq_waitq;
        struct completion       lcq_comp;
        cfs_atomic_t            lcq_stop;
 };
@@ -1298,13 +1289,13 @@ struct ll_statahead_info {
         unsigned int            sai_miss_hidden;/* "ls -al", but first dentry
                                                  * is not a hidden one */
         unsigned int            sai_skip_hidden;/* skipped hidden dentry count */
-        unsigned int            sai_ls_all:1,   /* "ls -al", do stat-ahead for
-                                                 * hidden entries */
-                                sai_in_readpage:1,/* statahead is in readdir()*/
-                                sai_agl_valid:1;/* AGL is valid for the dir */
-        cfs_waitq_t             sai_waitq;      /* stat-ahead wait queue */
-        struct ptlrpc_thread    sai_thread;     /* stat-ahead thread */
-        struct ptlrpc_thread    sai_agl_thread; /* AGL thread */
+       unsigned int            sai_ls_all:1,   /* "ls -al", do stat-ahead for
+                                                * hidden entries */
+                               sai_in_readpage:1,/* statahead is in readdir()*/
+                               sai_agl_valid:1;/* AGL is valid for the dir */
+       wait_queue_head_t       sai_waitq;      /* stat-ahead wait queue */
+       struct ptlrpc_thread    sai_thread;     /* stat-ahead thread */
+       struct ptlrpc_thread    sai_agl_thread; /* AGL thread */
        cfs_list_t              sai_entries;    /* entry list */
         cfs_list_t              sai_entries_received; /* entries returned */
         cfs_list_t              sai_entries_stated;   /* entries stated */
@@ -1333,13 +1324,13 @@ static inline int ll_glimpse_size(struct inode *inode)
 static inline void
 ll_statahead_mark(struct inode *dir, struct dentry *dentry)
 {
-        struct ll_inode_info     *lli = ll_i2info(dir);
-        struct ll_statahead_info *sai = lli->lli_sai;
-        struct ll_dentry_data    *ldd = ll_d2d(dentry);
+       struct ll_inode_info     *lli = ll_i2info(dir);
+       struct ll_statahead_info *sai = lli->lli_sai;
+       struct ll_dentry_data    *ldd = ll_d2d(dentry);
 
-        /* not the same process, don't mark */
-        if (lli->lli_opendir_pid != cfs_curproc_pid())
-                return;
+       /* not the same process, don't mark */
+       if (lli->lli_opendir_pid != current_pid())
+               return;
 
        LASSERT(ldd != NULL);
        if (sai != NULL)
@@ -1357,7 +1348,7 @@ ll_need_statahead(struct inode *dir, struct dentry *dentryp)
 
        lli = ll_i2info(dir);
        /* not the same process, don't statahead */
-       if (lli->lli_opendir_pid != cfs_curproc_pid())
+       if (lli->lli_opendir_pid != current_pid())
                return -EAGAIN;
 
        /* statahead has been stopped */
@@ -1471,8 +1462,8 @@ static inline void cl_isize_unlock(struct inode *inode)
 
 static inline void cl_isize_write_nolock(struct inode *inode, loff_t kms)
 {
-        LASSERT_SEM_LOCKED(&ll_i2info(inode)->lli_size_sem);
-        i_size_write(inode, kms);
+       LASSERT(down_trylock(&ll_i2info(inode)->lli_size_sem) != 0);
+       i_size_write(inode, kms);
 }
 
 static inline void cl_isize_write(struct inode *inode, loff_t kms)
@@ -1660,7 +1651,7 @@ 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);