Whamcloud - gitweb
LU-4423 lustre: don't declare extern variables in C files.
[fs/lustre-release.git] / lustre / quota / qsd_internal.h
index 488602c..18fc0c6 100644 (file)
@@ -33,6 +33,8 @@
 struct qsd_type_info;
 struct qsd_fsinfo;
 
+extern struct kmem_cache *upd_kmem;
+
 /*
  * A QSD instance implements quota enforcement support for a given OSD.
  * The instance can be created via qsd_init() and then freed with qsd_fini().
@@ -45,9 +47,6 @@ struct qsd_instance {
        /* name of service which created this qsd instance */
        char                     qsd_svname[MAX_OBD_NAME];
 
-       /* pool ID is always 0 for now */
-       int                      qsd_pool_id;
-
        /* dt_device associated with this qsd instance */
        struct dt_device        *qsd_dev;
 
@@ -176,7 +175,12 @@ struct qsd_qtype_info {
                                qqi_acct_failed:1; /* failed to setup acct */
 
        /* A list of references to this instance, for debugging */
-       struct lu_ref            qqi_reference;
+       struct lu_ref           qqi_reference;
+
+       /* default quota setting*/
+       __u64                   qqi_default_hardlimit;
+       __u64                   qqi_default_softlimit;
+       __u64                   qqi_default_gracetime;
 };
 
 /*
@@ -260,15 +264,7 @@ extern struct lu_context_key qsd_thread_key;
 static inline
 struct qsd_thread_info *qsd_info(const struct lu_env *env)
 {
-       struct qsd_thread_info *info;
-
-       info = lu_context_key_get(&env->le_ctx, &qsd_thread_key);
-       if (info == NULL) {
-               lu_env_refill((struct lu_env *)env);
-               info = lu_context_key_get(&env->le_ctx, &qsd_thread_key);
-       }
-       LASSERT(info);
-       return info;
+       return lu_env_info(env, &qsd_thread_key);
 }
 
 /* helper function to check whether a given quota type is enabled */
@@ -322,7 +318,7 @@ static inline void qsd_set_edquot(struct lquota_entry *lqe, bool edquot)
 {
        lqe->lqe_edquot = edquot;
        if (edquot)
-               lqe->lqe_edquot_time = cfs_time_current_64();
+               lqe->lqe_edquot_time = ktime_get_seconds();
 }
 
 #define QSD_WB_INTERVAL        60 /* 60 seconds */
@@ -349,6 +345,8 @@ int qsd_write_version(const struct lu_env *, struct qsd_qtype_info *,
 /* qsd_lock.c */
 extern struct ldlm_enqueue_info qsd_glb_einfo;
 extern struct ldlm_enqueue_info qsd_id_einfo;
+void qsd_update_default_quota(struct qsd_qtype_info *qqi, __u64 hardlimit,
+                             __u64 softlimit, __u64 gracetime);
 int qsd_id_lock_match(struct lustre_handle *, struct lustre_handle *);
 int qsd_id_lock_cancel(const struct lu_env *, struct lquota_entry *);
 
@@ -379,6 +377,7 @@ void qsd_upd_schedule(struct qsd_qtype_info *, struct lquota_entry *,
 /* qsd_config.c */
 struct qsd_fsinfo *qsd_get_fsinfo(char *, bool);
 void qsd_put_fsinfo(struct qsd_fsinfo *);
+int qsd_config(char *valstr, char *fsname, int pool);
 int qsd_process_config(struct lustre_cfg *);
 
 /* qsd_handler.c */