ceph: support getting ceph.dir.pin vxattr
[linux-2.6-microblaze.git] / fs / ceph / mds_client.h
index 729da15..af3b25e 100644 (file)
 #define CEPHFS_FEATURE_REPLY_ENCODING  9
 #define CEPHFS_FEATURE_RECLAIM_CLIENT  10
 #define CEPHFS_FEATURE_LAZY_CAP_WANTED 11
+#define CEPHFS_FEATURE_MULTI_RECONNECT  12
 
 #define CEPHFS_FEATURES_CLIENT_SUPPORTED {     \
        0, 1, 2, 3, 4, 5, 6, 7,                 \
        CEPHFS_FEATURE_MIMIC,                   \
+       CEPHFS_FEATURE_REPLY_ENCODING,          \
        CEPHFS_FEATURE_LAZY_CAP_WANTED,         \
+       CEPHFS_FEATURE_MULTI_RECONNECT,         \
 }
 #define CEPHFS_FEATURES_CLIENT_REQUIRED {}
 
@@ -65,6 +68,7 @@ struct ceph_mds_reply_info_in {
        char *pool_ns_data;
        u64 max_bytes;
        u64 max_files;
+       s32 dir_pin;
 };
 
 struct ceph_mds_reply_dir_entry {
@@ -152,6 +156,7 @@ struct ceph_mds_session {
        int               s_mds;
        int               s_state;
        unsigned long     s_ttl;      /* time until mds kills us */
+       unsigned long     s_features;
        u64               s_seq;      /* incoming msg seq # */
        struct mutex      s_mutex;    /* serialize session messages */
 
@@ -179,7 +184,7 @@ struct ceph_mds_session {
        unsigned long     s_renew_requested; /* last time we sent a renew req */
        u64               s_renew_seq;
 
-       refcount_t          s_ref;
+       refcount_t        s_ref;
        struct list_head  s_waiting;  /* waiting requests */
        struct list_head  s_unsafe;   /* unsafe requests */
 };
@@ -310,6 +315,15 @@ struct ceph_pool_perm {
        char pool_ns[];
 };
 
+struct ceph_snapid_map {
+       struct rb_node node;
+       struct list_head lru;
+       atomic_t ref;
+       u64 snap;
+       dev_t dev;
+       unsigned long last_used;
+};
+
 /*
  * mds client state
  */
@@ -341,6 +355,7 @@ struct ceph_mds_client {
        struct rw_semaphore     snap_rwsem;
        struct rb_root          snap_realms;
        struct list_head        snap_empty;
+       int                     num_snap_realms;
        spinlock_t              snap_empty_lock;  /* protect snap_empty */
 
        u64                    last_tid;      /* most recent mds request */
@@ -386,6 +401,10 @@ struct ceph_mds_client {
        struct list_head  dentry_lru;
        int               num_dentry;
 
+       spinlock_t              snapid_map_lock;
+       struct rb_root          snapid_map_tree;
+       struct list_head        snapid_map_lru;
+
        struct rw_semaphore     pool_perm_rwsem;
        struct rb_root          pool_perm_tree;