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, see
18 * http://www.gnu.org/licenses/gpl-2.0.html
23 * Copyright (c) 2020, 2022, DDN Storage Corporation.
26 * This file is part of Lustre, http://www.lustre.org/
29 * lustre/mdc/mdc_batch.c
31 * Batch Metadata Updating on the client (MDC)
33 * Author: Qian Yingjin <qian@ddn.com>
36 #define DEBUG_SUBSYSTEM S_MDC
38 #include <linux/module.h>
39 #include <lustre_update.h>
40 #include <lustre_acl.h>
42 #include "mdc_internal.h"
45 static md_update_pack_t mdc_update_packers[MD_OP_MAX];
47 static object_update_interpret_t mdc_update_interpreters[MD_OP_MAX];
49 int mdc_batch_add(struct obd_export *exp, struct lu_batch *bh,
50 struct md_op_item *item)
52 enum md_item_opcode opc = item->mop_opc;
56 if (opc >= MD_OP_MAX || mdc_update_packers[opc] == NULL ||
57 mdc_update_interpreters[opc] == NULL) {
58 CERROR("%s: unexpected opcode %d\n",
59 exp->exp_obd->obd_name, opc);
63 RETURN(cli_batch_add(exp, bh, item, mdc_update_packers[opc],
64 mdc_update_interpreters[opc]));