]> Pileus Git - ~andy/linux/blobdiff - drivers/staging/lustre/lustre/llite/llite_internal.h
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
[~andy/linux] / drivers / staging / lustre / lustre / llite / llite_internal.h
index 1aeadc13c7eceb52dd6170bbfcb7052be7e556df..7ee5c02783f96fa8f9962b88949d476e55b4ed2a 100644 (file)
@@ -128,6 +128,8 @@ enum lli_flags {
        LLIF_DATA_MODIFIED      = (1 << 6),
        /* File is being restored */
        LLIF_FILE_RESTORING     = (1 << 7),
+       /* Xattr cache is attached to the file */
+       LLIF_XATTR_CACHE        = (1 << 8),
 };
 
 struct ll_inode_info {
@@ -280,8 +282,27 @@ struct ll_inode_info {
        struct mutex                    lli_layout_mutex;
        /* valid only inside LAYOUT ibits lock, protected by lli_layout_mutex */
        __u32                           lli_layout_gen;
+
+       struct rw_semaphore             lli_xattrs_list_rwsem;
+       struct mutex                    lli_xattrs_enq_lock;
+       struct list_head                lli_xattrs;/* ll_xattr_entry->xe_list */
 };
 
+int ll_xattr_cache_destroy(struct inode *inode);
+
+int ll_xattr_cache_get(struct inode *inode,
+                       const char *name,
+                       char *buffer,
+                       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.
@@ -403,6 +424,7 @@ enum stats_track_type {
 #define LL_SBI_VERBOSE 0x10000 /* verbose mount/umount */
 #define LL_SBI_LAYOUT_LOCK    0x20000 /* layout lock support */
 #define LL_SBI_USER_FID2PATH  0x40000 /* allow fid2path by unprivileged users */
+#define LL_SBI_XATTR_CACHE    0x80000 /* support for xattr cache */
 
 #define LL_SBI_FLAGS { \
        "nolck",        \
@@ -410,6 +432,7 @@ enum stats_track_type {
        "flock",        \
        "xattr",        \
        "acl",          \
+       "???",          \
        "rmt_client",   \
        "mds_capa",     \
        "oss_capa",     \
@@ -422,7 +445,9 @@ enum stats_track_type {
        "agl",          \
        "verbose",      \
        "layout",       \
-       "user_fid2path" }
+       "user_fid2path",\
+       "xattr",        \
+}
 
 /* default value for ll_sb_info->contention_time */
 #define SBI_DEFAULT_CONTENTION_SECONDS     60
@@ -462,7 +487,8 @@ struct ll_sb_info {
        struct lu_fid        ll_root_fid; /* root object fid */
 
        int                    ll_flags;
-       unsigned int                      ll_umounting:1;
+       unsigned int              ll_umounting:1,
+                                 ll_xattr_cache_enabled:1;
        struct list_head                ll_conn_chain; /* per-conn chain of SBs */
        struct lustre_client_ocd  ll_lco;
 
@@ -676,15 +702,22 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
 void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi);
 void ll_stats_ops_tally(struct ll_sb_info *sbi, int op, int count);
 void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars);
+void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid,
+                      struct ll_file_data *file, loff_t pos,
+                      size_t count, int rw);
 #else
 static inline int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
                        struct super_block *sb, char *osc, char *mdc){return 0;}
 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) {}
-static void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars)
+static inline
+void ll_stats_ops_tally(struct ll_sb_info *sbi, int op, int count) {}
+static inline void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars)
 {
        memset(lvars, 0, sizeof(*lvars));
 }
+static inline void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid,
+                                    struct ll_file_data *file, loff_t pos,
+                                    size_t count, int rw) {}
 #endif
 
 
@@ -733,7 +766,8 @@ extern int ll_inode_revalidate_it(struct dentry *, struct lookup_intent *,
 extern int ll_have_md_lock(struct inode *inode, __u64 *bits,
                           ldlm_mode_t l_req_mode);
 extern ldlm_mode_t ll_take_md_lock(struct inode *inode, __u64 bits,
-                                  struct lustre_handle *lockh, __u64 flags);
+                                  struct lustre_handle *lockh, __u64 flags,
+                                  ldlm_mode_t mode);
 int __ll_inode_revalidate_it(struct dentry *, struct lookup_intent *,
                             __u64 bits);
 int ll_revalidate_nd(struct dentry *dentry, unsigned int flags);
@@ -759,9 +793,6 @@ int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data,
                  struct md_open_data **mod);
 void ll_pack_inode2opdata(struct inode *inode, struct md_op_data *op_data,
                          struct lustre_handle *fh);
-extern void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid,
-                             struct ll_file_data *file, loff_t pos,
-                             size_t count, int rw);
 int ll_getattr_it(struct vfsmount *mnt, struct dentry *de,
               struct lookup_intent *it, struct kstat *stat);
 int ll_getattr(struct vfsmount *mnt, struct dentry *de, struct kstat *stat);
@@ -788,9 +819,10 @@ 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_hsm_release(struct inode *inode);
 
 struct obd_client_handle *ll_lease_open(struct inode *inode, struct file *file,
-                                       fmode_t mode);
+                                       fmode_t mode, __u64 flags);
 int ll_lease_close(struct obd_client_handle *och, struct inode *inode,
                   bool *lease_broken);
 
@@ -819,7 +851,7 @@ void ll_kill_super(struct super_block *sb);
 struct inode *ll_inode_from_resource_lock(struct ldlm_lock *lock);
 struct inode *ll_inode_from_lock(struct ldlm_lock *lock);
 void ll_clear_inode(struct inode *inode);
-int ll_setattr_raw(struct dentry *dentry, struct iattr *attr);
+int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import);
 int ll_setattr(struct dentry *de, struct iattr *attr);
 int ll_statfs(struct dentry *de, struct kstatfs *sfs);
 int ll_statfs_internal(struct super_block *sb, struct obd_statfs *osfs,
@@ -1598,4 +1630,7 @@ 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_xattr_init(void);
+void ll_xattr_fini(void);
+
 #endif /* LLITE_INTERNAL_H */