Whamcloud - gitweb
LU-1842 quota: setup/shutdown qmt device
[fs/lustre-release.git] / lustre / quota / qmt_lock.c
1 /*
2  * GPL HEADER START
3  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 only,
8  * as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License version 2 for more details (a copy is included
14  * in the LICENSE file that accompanied this code).
15  *
16  * You should have received a copy of the GNU General Public License
17  * version 2 along with this program; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 021110-1307, USA
20  *
21  * GPL HEADER END
22  */
23 /*
24  * Copyright (c) 2012 Intel, Inc.
25  * Use is subject to license terms.
26  *
27  * Author: Johann Lombardi <johann.lombardi@intel.com>
28  * Author: Niu    Yawei    <yawei.niu@intel.com>
29  */
30
31 #ifndef EXPORT_SYMTAB
32 # define EXPORT_SYMTAB
33 #endif
34
35 #define DEBUG_SUBSYSTEM S_LQUOTA
36
37 #include <lustre_dlm.h>
38 #include "qmt_internal.h"
39
40 /* intent policy function called from mdt_intent_opc() when the intent is of
41  * quota type */
42 int qmt_intent_policy(const struct lu_env *env, struct lu_device *ld,
43                       struct ptlrpc_request *req, struct ldlm_lock **lockp,
44                       int flags)
45 {
46         ENTRY;
47
48         req_capsule_extend(&req->rq_pill, &RQF_LDLM_INTENT_QUOTA);
49         RETURN(ELDLM_LOCK_ABORTED);
50 }
51
52 /*
53  * Initialize quota LVB associated with quota indexes.
54  * Called with res->lr_lvb_sem held
55  */
56 int qmt_lvbo_init(struct lu_device *ld, struct ldlm_resource *res)
57 {
58         return 0;
59 }
60
61 /*
62  * Update LVB associated with the global quota index.
63  * This function is called from the DLM itself after a glimpse callback, in this
64  * case valid ptlrpc request is passed. It is also called directly from the
65  * quota master in order to refresh the global index version after a quota limit
66  * change.
67  */
68 int qmt_lvbo_update(struct lu_device *ld, struct ldlm_resource *res,
69                     struct ptlrpc_request *req, int increase_only)
70 {
71         return 0;
72 }
73
74 /*
75  * Report size of lvb to ldlm layer in order to allocate lvb buffer
76  */
77 int qmt_lvbo_size(struct lu_device *ld, struct ldlm_lock *lock)
78 {
79         return 0;
80 }
81
82 /*
83  * Fill request buffer with lvb
84  */
85 int qmt_lvbo_fill(struct lu_device *ld, struct ldlm_lock *lock, void *lvb,
86                   int lvblen)
87 {
88         return 0;
89 }
90
91 /*
92  * Free lvb associated with a given ldlm resource
93  */
94 int qmt_lvbo_free(struct lu_device *ld, struct ldlm_resource *res)
95 {
96         return 0;
97 }