4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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.
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).
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
24 * Copyright (c) 2012 Intel, Inc.
25 * Use is subject to license terms.
27 * Author: Johann Lombardi <johann.lombardi@intel.com>
28 * Author: Niu Yawei <yawei.niu@intel.com>
32 # define EXPORT_SYMTAB
35 #define DEBUG_SUBSYSTEM S_LQUOTA
37 #include <lustre_dlm.h>
38 #include "qmt_internal.h"
40 /* intent policy function called from mdt_intent_opc() when the intent is of
42 int qmt_intent_policy(const struct lu_env *env, struct lu_device *ld,
43 struct ptlrpc_request *req, struct ldlm_lock **lockp,
48 req_capsule_extend(&req->rq_pill, &RQF_LDLM_INTENT_QUOTA);
49 RETURN(ELDLM_LOCK_ABORTED);
53 * Initialize quota LVB associated with quota indexes.
54 * Called with res->lr_lvb_sem held
56 int qmt_lvbo_init(struct lu_device *ld, struct ldlm_resource *res)
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
68 int qmt_lvbo_update(struct lu_device *ld, struct ldlm_resource *res,
69 struct ptlrpc_request *req, int increase_only)
75 * Report size of lvb to ldlm layer in order to allocate lvb buffer
77 int qmt_lvbo_size(struct lu_device *ld, struct ldlm_lock *lock)
83 * Fill request buffer with lvb
85 int qmt_lvbo_fill(struct lu_device *ld, struct ldlm_lock *lock, void *lvb,
92 * Free lvb associated with a given ldlm resource
94 int qmt_lvbo_free(struct lu_device *ld, struct ldlm_resource *res)