Whamcloud - gitweb
LU-2800 build: fix compilation issue with is_compat_task
[fs/lustre-release.git] / lustre / llite / llite_internal.h
index 05100c2..912b04d 100644 (file)
@@ -46,6 +46,7 @@
 #include <lclient.h>
 #include <lustre_mdc.h>
 #include <linux/lustre_intent.h>
+#include <linux/compat.h>
 
 #ifndef FMODE_EXEC
 #define FMODE_EXEC 0
@@ -123,6 +124,8 @@ enum lli_flags {
         LLIF_SRVLOCK            = (1 << 5),
        /* File data is modified. */
        LLIF_DATA_MODIFIED      = (1 << 6),
+       /* File is being restored */
+       LLIF_FILE_RESTORING     = (1 << 7),
 };
 
 struct ll_inode_info {
@@ -512,6 +515,7 @@ 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)
@@ -612,12 +616,16 @@ struct ll_readahead_state {
 extern struct kmem_cache *ll_file_data_slab;
 struct lustre_handle;
 struct ll_file_data {
-        struct ll_readahead_state fd_ras;
-        int fd_omode;
-        struct ccc_grouplock fd_grouplock;
+       struct ll_readahead_state fd_ras;
+       struct ccc_grouplock fd_grouplock;
        __u64 lfd_pos;
-        __u32 fd_flags;
-        struct file *fd_file;
+       __u32 fd_flags;
+       fmode_t fd_omode;
+       /* openhandle if lease exists for this file.
+        * Borrow lli->lli_och_mutex to protect assignment */
+       struct obd_client_handle *fd_lease_och;
+       struct obd_client_handle *fd_och;
+       struct file *fd_file;
        /* Indicate whether need to report failure when close.
         * true: failure is known, not report again.
         * false: unknown failure, should report. */
@@ -649,7 +657,12 @@ static inline int ll_need_32bit_api(struct ll_sb_info *sbi)
 #if BITS_PER_LONG == 32
         return 1;
 #else
-        return unlikely(cfs_curproc_is_32bit() || (sbi->ll_flags & LL_SBI_32BIT_API));
+       return unlikely(
+#ifdef CONFIG_COMPAT
+               is_compat_task() ||
+#endif
+               (sbi->ll_flags & LL_SBI_32BIT_API)
+       );
 #endif
 }
 
@@ -805,6 +818,11 @@ 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);
 
+struct obd_client_handle *ll_lease_open(struct inode *inode, struct file *file,
+                                       fmode_t mode);
+int ll_lease_close(struct obd_client_handle *och, struct inode *inode,
+                  bool *lease_broken);
+
 /* llite/dcache.c */
 
 int ll_dops_init(struct dentry *de, int block, int init_sa);
@@ -846,11 +864,7 @@ void ll_delete_inode(struct inode *inode);
 int ll_iocontrol(struct inode *inode, struct file *file,
                  unsigned int cmd, unsigned long arg);
 int ll_flush_ctx(struct inode *inode);
-#ifdef HAVE_UMOUNTBEGIN_VFSMOUNT
-void ll_umount_begin(struct vfsmount *vfsmnt, int flags);
-#else
 void ll_umount_begin(struct super_block *sb);
-#endif
 int ll_remount_fs(struct super_block *sb, int *flags, char *data);
 #ifdef HAVE_SUPEROPS_USE_DENTRY
 int ll_show_options(struct seq_file *seq, struct dentry *dentry);
@@ -876,6 +890,7 @@ 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);
 
@@ -941,19 +956,6 @@ struct vvp_io {
                          *  locked page returned from vvp_io
                          */
                        struct page            *ft_vmpage;
-#ifndef HAVE_VM_OP_FAULT
-                        struct vm_nopage_api {
-                                /**
-                                 * Virtual address at which fault occurred.
-                                 */
-                                unsigned long   ft_address;
-                                /**
-                                 * Fault type, as to be supplied to
-                                 * filemap_nopage().
-                                 */
-                                int             *ft_type;
-                        } nopage;
-#else
                         struct vm_fault_api {
                                 /**
                                  * kernel fault info
@@ -964,7 +966,6 @@ struct vvp_io {
                                  */
                                 unsigned int    ft_flags;
                         } fault;
-#endif
                 } fault;
         } u;
         /**
@@ -991,9 +992,7 @@ struct vvp_io_args {
 
         union {
                 struct {
-#ifndef HAVE_FILE_WRITEV
                         struct kiocb      *via_iocb;
-#endif
                         struct iovec      *via_iov;
                         unsigned long      via_nrsegs;
                 } normal;
@@ -1632,5 +1631,6 @@ 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);
 
 #endif /* LLITE_INTERNAL_H */