Whamcloud - gitweb
Branch: b_new_cmd
[fs/lustre-release.git] / lustre / include / obd.h
index d9750d7..65cd41a 100644 (file)
@@ -266,6 +266,25 @@ struct obd_device_target {
         struct lustre_quota_ctxt  obt_qctxt;
 };
 
+/* llog contexts */
+enum llog_ctxt_id {
+        LLOG_CONFIG_ORIG_CTXT  =  0,
+        LLOG_CONFIG_REPL_CTXT  =  1,
+        LLOG_MDS_OST_ORIG_CTXT =  2,
+        LLOG_MDS_OST_REPL_CTXT =  3,
+        LLOG_SIZE_ORIG_CTXT    =  4,
+        LLOG_SIZE_REPL_CTXT    =  5,
+        LLOG_MD_ORIG_CTXT      =  6,
+        LLOG_MD_REPL_CTXT      =  7,
+        LLOG_RD1_ORIG_CTXT     =  8,
+        LLOG_RD1_REPL_CTXT     =  9,
+        LLOG_TEST_ORIG_CTXT    = 10,
+        LLOG_TEST_REPL_CTXT    = 11,
+        LLOG_LOVEA_ORIG_CTXT   = 12,
+        LLOG_LOVEA_REPL_CTXT   = 13,
+        LLOG_MAX_CTXTS
+};
+
 #define FILTER_SUBDIR_COUNT      32            /* set to zero for no subdirs */
 
 #define FILTER_GROUP_LLOG 1
@@ -282,6 +301,17 @@ struct filter_ext {
         __u64                fe_end;
 };
 
+struct obd_llogs {
+        struct llog_ctxt        *llog_ctxt[LLOG_MAX_CTXTS];
+};
+
+struct filter_group_llog {
+        struct list_head list;
+        int group;
+        struct obd_llogs *llogs;
+        struct obd_export *exp;
+};
+
 struct filter_obd {
         /* NB this field MUST be first */
         struct obd_device_target fo_obt;
@@ -358,6 +388,9 @@ struct filter_obd {
         struct obd_histogram     fo_r_dio_frags;
         struct obd_histogram     fo_w_dio_frags;
 
+        struct list_head         fo_llog_list;
+        spinlock_t               fo_llog_list_lock;
+
         struct lustre_quota_ctxt fo_quota_ctxt;
         spinlock_t               fo_quotacheck_lock;
         atomic_t                 fo_quotachecking;
@@ -474,6 +507,15 @@ struct mgs_obd {
         struct semaphore                 mgs_sem;
 };
 
+/* hah, upper limit 64 should be enough */
+#define N_NOSQUASH_NIDS 64
+struct rootsquash_info {
+        uid_t           rsi_uid;
+        gid_t           rsi_gid;
+        int             rsi_n_nosquash_nids;
+        lnet_nid_t      rsi_nosquash_nids[N_NOSQUASH_NIDS];
+};
+
 struct mds_obd {
         /* NB this field MUST be first */
         struct obd_device_target         mds_obt;
@@ -512,7 +554,7 @@ struct mds_obd {
         struct file                     *mds_lov_objid_filp;
         struct file                     *mds_health_check_filp;
         unsigned long                   *mds_client_bitmap;
-        struct upcall_cache             *mds_group_hash;
+//        struct upcall_cache             *mds_group_hash;
 
         struct lustre_quota_info         mds_quota_info;
         struct semaphore                 mds_qonoff_sem;
@@ -520,6 +562,15 @@ struct mds_obd {
         unsigned long                    mds_lov_objids_valid:1,
                                          mds_fl_user_xattr:1,
                                          mds_fl_acl:1;
+
+        /* For CMD add mds_num */
+        int                              mds_num;
+
+        struct upcall_cache             *mds_identity_cache;
+        struct upcall_cache             *mds_rmtacl_cache;
+
+        /* root squash */
+        struct rootsquash_info          *mds_rootsquash_info;
 };
 
 struct echo_obd {
@@ -756,25 +807,6 @@ static inline void oti_free_cookies(struct obd_trans_info *oti)
         oti->oti_numcookies = 0;
 }
 
-/* llog contexts */
-enum llog_ctxt_id {
-        LLOG_CONFIG_ORIG_CTXT  =  0,
-        LLOG_CONFIG_REPL_CTXT  =  1,
-        LLOG_MDS_OST_ORIG_CTXT =  2,
-        LLOG_MDS_OST_REPL_CTXT =  3,
-        LLOG_SIZE_ORIG_CTXT    =  4,
-        LLOG_SIZE_REPL_CTXT    =  5,
-        LLOG_MD_ORIG_CTXT      =  6,
-        LLOG_MD_REPL_CTXT      =  7,
-        LLOG_RD1_ORIG_CTXT     =  8,
-        LLOG_RD1_REPL_CTXT     =  9,
-        LLOG_TEST_ORIG_CTXT    = 10,
-        LLOG_TEST_REPL_CTXT    = 11,
-        LLOG_LOVEA_ORIG_CTXT   = 12,
-        LLOG_LOVEA_REPL_CTXT   = 13,
-        LLOG_MAX_CTXTS
-};
-
 /*
  * Events signalled through obd_notify() upcall-chain.
  */
@@ -791,6 +823,7 @@ enum obd_notify_event {
 };
 
 #include <lu_object.h>
+
 /*
  * Data structure used to pass obd_notify()-event to non-obd listeners (llite
  * and liblustre being main examples).
@@ -1070,11 +1103,12 @@ struct obd_ops {
                              int cmd, obd_off *);
 
         /* llog related obd_methods */
-        int (*o_llog_init)(struct obd_device *obd, struct obd_device *disk_obd,
-                           int count, struct llog_catid *logid
-                           struct obd_uuid *uuid);
+        int (*o_llog_init)(struct obd_device *obd, struct obd_llogs *llog, 
+                           struct obd_device *disk_obd, int count
+                           struct llog_catid *logid, struct obd_uuid *uuid);
         int (*o_llog_finish)(struct obd_device *obd, int count);
-
+        int (*o_llog_connect)(struct obd_export *, struct llogd_conn_body *);
+        
         /* metadata-only methods */
         int (*o_pin)(struct obd_export *, const struct lu_fid *fid,
                      struct obd_client_handle *, int flag);
@@ -1108,7 +1142,8 @@ struct md_ops {
         int (*m_create)(struct obd_export *, struct md_op_data *,
                         const void *, int, int, __u32, __u32, __u32,
                         __u64, struct ptlrpc_request **);
-        int (*m_done_writing)(struct obd_export *, struct md_op_data *);
+        int (*m_done_writing)(struct obd_export *, struct md_op_data  *,
+                              struct obd_client_handle *);
         int (*m_enqueue)(struct obd_export *, int, struct lookup_intent *,
                          int, struct md_op_data *, struct lustre_handle *,
                          void *, int, ldlm_completion_callback,
@@ -1127,9 +1162,10 @@ struct md_ops {
         int (*m_rename)(struct obd_export *, struct md_op_data *,
                         const char *, int, const char *, int,
                         struct ptlrpc_request **);
-        int (*m_setattr)(struct obd_export *, struct md_op_data *,
-                         struct iattr *, void *, int , void *, int,
-                         struct ptlrpc_request **);
+        int (*m_is_subdir)(struct obd_export *, const struct lu_fid *,
+                           const struct lu_fid *, struct ptlrpc_request **);
+        int (*m_setattr)(struct obd_export *, struct md_op_data *, void *,
+                         int , void *, int, struct ptlrpc_request **);
         int (*m_sync)(struct obd_export *, const struct lu_fid *,
                       struct ptlrpc_request **);
         int (*m_readpage)(struct obd_export *, const struct lu_fid *,
@@ -1168,6 +1204,9 @@ struct md_ops {
         int (*m_cancel_unused)(struct obd_export *, const struct lu_fid *,
                                int flags, void *opaque);
 
+        int (*m_get_remote_perm)(struct obd_export *, const struct lu_fid *,
+                                 struct ptlrpc_request **);
+
         /*
          * NOTE: If adding ops, add another LPROCFS_MD_OP_INIT() line to
          * lprocfs_alloc_md_stats() in obdclass/lprocfs_status.c. Also, add a
@@ -1203,7 +1242,7 @@ static inline struct lsm_operations *lsm_op_find(int magic)
         case LOV_MAGIC_JOIN:
                return &lsm_join_ops;
         default:
-               CERROR("Cannot recognize lsm_magic %d", magic);
+               CERROR("Cannot recognize lsm_magic %d\n", magic);
                return NULL;
         }
 }