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 Corporation.
25 * Use is subject to license terms.
28 #define DEBUG_SUBSYSTEM S_MDS
30 #include "mdt_internal.h"
33 * Update on-disk HSM attributes.
35 int mdt_hsm_attr_set(struct mdt_thread_info *info, struct mdt_object *obj,
38 struct md_object *next = mdt_object_child(obj);
39 struct lu_buf *buf = &info->mti_buf;
40 struct hsm_attrs *attrs;
44 attrs = (struct hsm_attrs *)info->mti_xattr_buf;
45 CLASSERT(sizeof(info->mti_xattr_buf) >= sizeof(*attrs));
47 /* pack HSM attributes */
48 lustre_hsm2buf(info->mti_xattr_buf, mh);
50 /* update SOM attributes */
52 buf->lb_len = sizeof(*attrs);
53 rc = mo_xattr_set(info->mti_env, next, buf, XATTR_NAME_HSM, 0);