Whamcloud - gitweb
LU-3270 statahead: use dcache-like interface for sa entry
[fs/lustre-release.git] / lustre / llite / llite_internal.h
index 33c7a5c..204c42e 100644 (file)
@@ -40,6 +40,7 @@
 #include <lustre_ver.h>
 #include <lustre_disk.h>  /* for s2sbi */
 #include <lustre_eacl.h>
+#include <lustre_linkea.h>
 
 /* for struct cl_lock_descr and struct cl_io */
 #include <cl_object.h>
@@ -69,6 +70,9 @@
 #define LL_DIR_END_OFF          0x7fffffffffffffffULL
 #define LL_DIR_END_OFF_32BIT    0x7fffffffUL
 
+/* 4UL * 1024 * 1024 */
+#define LL_MAX_BLKSIZE_BITS 22
+
 #define LL_IT2STR(it) ((it) ? ldlm_it2str((it)->it_op) : "0")
 #define LUSTRE_FPRIVATE(file) ((file)->private_data)
 
@@ -247,7 +251,7 @@ struct ll_inode_info {
                         * so the read/write statistics for jobid will not be
                         * accurate if the file is shared by different jobs.
                         */
-                       char                     f_jobid[JOBSTATS_JOBID_SIZE];
+                       char                     f_jobid[LUSTRE_JOBID_SIZE];
                } f;
 
 #define lli_size_mutex          u.f.f_size_mutex
@@ -491,6 +495,20 @@ struct eacl_table {
        struct list_head        et_entries[EE_HASHES];
 };
 
+
+/* This is embedded into llite super-blocks to keep track of connect
+ * flags (capabilities) supported by all imports given mount is
+ * connected to. */
+struct lustre_client_ocd {
+       /* This is conjunction of connect_flags across all imports
+        * (LOVs) this mount is connected to. This field is updated by
+        * cl_ocd_update() under ->lco_lock. */
+       __u64                    lco_flags;
+       struct mutex             lco_lock;
+       struct obd_export       *lco_md_exp;
+       struct obd_export       *lco_dt_exp;
+};
+
 struct ll_sb_info {
        struct list_head                  ll_list;
        /* this protects pglist and ra_info.  It isn't safe to
@@ -725,8 +743,57 @@ static inline void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi) {}
 static void ll_stats_ops_tally(struct ll_sb_info *sbi, int op, int count) {}
 #endif
 
+enum {
+       LPROC_LL_DIRTY_HITS,
+       LPROC_LL_DIRTY_MISSES,
+       LPROC_LL_READ_BYTES,
+       LPROC_LL_WRITE_BYTES,
+       LPROC_LL_BRW_READ,
+       LPROC_LL_BRW_WRITE,
+       LPROC_LL_OSC_READ,
+       LPROC_LL_OSC_WRITE,
+       LPROC_LL_IOCTL,
+       LPROC_LL_OPEN,
+       LPROC_LL_RELEASE,
+       LPROC_LL_MAP,
+       LPROC_LL_LLSEEK,
+       LPROC_LL_FSYNC,
+       LPROC_LL_READDIR,
+       LPROC_LL_SETATTR,
+       LPROC_LL_TRUNC,
+       LPROC_LL_FLOCK,
+       LPROC_LL_GETATTR,
+       LPROC_LL_CREATE,
+       LPROC_LL_LINK,
+       LPROC_LL_UNLINK,
+       LPROC_LL_SYMLINK,
+       LPROC_LL_MKDIR,
+       LPROC_LL_RMDIR,
+       LPROC_LL_MKNOD,
+       LPROC_LL_RENAME,
+       LPROC_LL_STAFS,
+       LPROC_LL_ALLOC_INODE,
+       LPROC_LL_SETXATTR,
+       LPROC_LL_GETXATTR,
+       LPROC_LL_GETXATTR_HITS,
+       LPROC_LL_LISTXATTR,
+       LPROC_LL_REMOVEXATTR,
+       LPROC_LL_INODE_PERM,
+       LPROC_LL_FILE_OPCODES
+};
 
 /* llite/dir.c */
+struct ll_dir_chain {
+};
+
+static inline void ll_dir_chain_init(struct ll_dir_chain *chain)
+{
+}
+
+static inline void ll_dir_chain_fini(struct ll_dir_chain *chain)
+{
+}
+
 extern const struct file_operations ll_dir_operations;
 extern const struct inode_operations ll_dir_inode_operations;
 #ifdef HAVE_DIR_CONTEXT
@@ -899,6 +966,27 @@ void ll_finish_md_op_data(struct md_op_data *op_data);
 int ll_get_obd_name(struct inode *inode, unsigned int cmd, unsigned long arg);
 char *ll_get_fsname(struct super_block *sb, char *buf, int buflen);
 void ll_compute_rootsquash_state(struct ll_sb_info *sbi);
+ssize_t ll_copy_user_md(const struct lov_user_md __user *md,
+                       struct lov_user_md **kbuf);
+
+/* Compute expected user md size when passing in a md from user space */
+static inline ssize_t ll_lov_user_md_size(const struct lov_user_md *lum)
+{
+       switch (lum->lmm_magic) {
+       case LOV_USER_MAGIC_V1:
+               return sizeof(struct lov_user_md_v1);
+       case LOV_USER_MAGIC_V3:
+               return sizeof(struct lov_user_md_v3);
+       case LOV_USER_MAGIC_SPECIFIC:
+               if (lum->lmm_stripe_count > LOV_MAX_STRIPE_COUNT)
+                       return -EINVAL;
+
+               return lov_user_md_size(lum->lmm_stripe_count,
+                                       LOV_USER_MAGIC_SPECIFIC);
+       }
+
+       return -EINVAL;
+}
 
 /* llite/llite_nfs.c */
 extern struct export_operations lustre_export_operations;
@@ -1253,10 +1341,11 @@ struct ll_statahead_info {
        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 */
-       struct list_head        sai_entries;    /* entry list */
-       struct list_head        sai_entries_received;   /* entries returned */
-       struct list_head        sai_entries_stated;     /* entries stated */
-       struct list_head        sai_entries_agl;  /* AGL entries to be sent */
+       struct list_head        sai_interim_entries; /* entries which got async
+                                                     * stat reply, but not
+                                                     * instantiated */
+       struct list_head        sai_entries;    /* completed entries */
+       struct list_head        sai_agls;       /* AGLs to be sent */
        struct list_head        sai_cache[LL_SA_CACHE_SIZE];
        spinlock_t              sai_cache_lock[LL_SA_CACHE_SIZE];
        atomic_t                sai_cache_count; /* entry count in cache */
@@ -1611,4 +1700,6 @@ 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);
 
+int ll_getparent(struct file *file, struct getparent __user *arg);
+
 #endif /* LLITE_INTERNAL_H */