Whamcloud - gitweb
5c2bea7c0b53a58ad3fde7383675f4b7c77f15cd
[fs/lustre-release.git] / lustre / utils / liblustreapi_nodemap.c
1 /*
2  * LGPL HEADER START
3  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * All rights reserved. This program and the accompanying materials
7  * are made available under the terms of the GNU Lesser General Public License
8  * (LGPL) version 2.1 or (at your discretion) any later version.
9  * (LGPL) version 2.1 accompanies this distribution, and is available at
10  * http://www.gnu.org/licenses/lgpl-2.1.html
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * LGPL HEADER END
18  */
19 /*
20  * Copyright (C) 2013, Trustees of Indiana University
21  *
22  * Copyright (c) 2014, Intel Corporation.
23  *
24  * Author: Joshua Walgenbach <jjw@iu.edu>
25  */
26
27 #include <stdlib.h>
28 #include <stdio.h>
29 #include <string.h>
30 #include <libcfs/libcfs.h>
31 #include <lustre/lustreapi.h>
32 #include "lustreapi_internal.h"
33
34 int llapi_nodemap_exists(const char *nodemap)
35 {
36         char mapname[PATH_MAX + 1];
37
38         snprintf(mapname, sizeof(mapname), "nodemap/%s", nodemap);
39
40         return get_param(mapname, NULL, 0);
41 }