4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * (C) Copyright (c) 2018, DataDirect Networks Inc, all rights reserved.
8 * All rights reserved. This program and the accompanying materials
9 * are made available under the terms of the GNU Lesser General Public License
10 * LGPL version 2.1 or (at your discretion) any later version.
11 * LGPL version 2.1 accompanies this distribution, and is available at
12 * http://www.gnu.org/licenses/lgpl-2.1.html
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
22 * lustre/utils/liblustreapi_heat.c
24 * lustreapi library for heat
26 * Author: Li Xi <lixi@ddn.com>
29 #include <lustre/lustreapi.h>
31 #include <sys/ioctl.h>
33 #include <libcfs/util/ioctl.h>
34 #include <lustre/lustreapi.h>
35 #include <linux/lustre/lustre_ioctl.h>
36 #include "lustreapi_internal.h"
41 * \param fd File to get heat.
42 * \param heat Buffer to save heat.
44 * \retval 0 on success.
45 * \retval -errno on failure.
47 int llapi_heat_get(int fd, struct lu_heat *heat)
51 rc = ioctl(fd, LL_IOC_HEAT_GET, heat);
53 llapi_error(LLAPI_MSG_ERROR, -errno, "cannot get heat");
62 * \param fd File to get heat.
63 * \param heat Buffer to save heat.
65 * \retval 0 on success.
66 * \retval -errno on failure.
68 int llapi_heat_set(int fd, __u64 flags)
72 rc = ioctl(fd, LL_IOC_HEAT_SET, &flags);
74 llapi_error(LLAPI_MSG_ERROR, -errno, "cannot set heat flags");