xref: /netbsd-src/lib/librefuse/refuse/legacy.c (revision a95017a87a910ba9aaf4537e381dba0e6fc34a1d)
1*a95017a8Spho /* $NetBSD: legacy.c,v 1.1 2022/01/22 07:57:30 pho Exp $ */
2*a95017a8Spho 
3*a95017a8Spho /*
4*a95017a8Spho  * Copyright (c) 2021 The NetBSD Foundation, Inc.
5*a95017a8Spho  * All rights reserved.
6*a95017a8Spho  *
7*a95017a8Spho  * Redistribution and use in source and binary forms, with or without
8*a95017a8Spho  * modification, are permitted provided that the following conditions
9*a95017a8Spho  * are met:
10*a95017a8Spho  * 1. Redistributions of source code must retain the above copyright
11*a95017a8Spho  *    notice, this list of conditions and the following disclaimer.
12*a95017a8Spho  * 2. Redistributions in binary form must reproduce the above copyright
13*a95017a8Spho  *    notice, this list of conditions and the following disclaimer in the
14*a95017a8Spho  *    documentation and/or other materials provided with the distribution.
15*a95017a8Spho  * 3. The name of the author may not be used to endorse or promote
16*a95017a8Spho  *    products derived from this software without specific prior written
17*a95017a8Spho  *    permission.
18*a95017a8Spho  *
19*a95017a8Spho  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
20*a95017a8Spho  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21*a95017a8Spho  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22*a95017a8Spho  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
23*a95017a8Spho  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24*a95017a8Spho  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
25*a95017a8Spho  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26*a95017a8Spho  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27*a95017a8Spho  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28*a95017a8Spho  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29*a95017a8Spho  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30*a95017a8Spho  */
31*a95017a8Spho 
32*a95017a8Spho #include <sys/cdefs.h>
33*a95017a8Spho #if !defined(lint)
34*a95017a8Spho __RCSID("$NetBSD: legacy.c,v 1.1 2022/01/22 07:57:30 pho Exp $");
35*a95017a8Spho #endif /* !lint */
36*a95017a8Spho 
37*a95017a8Spho #include <errno.h>
38*a95017a8Spho #include <fuse_internal.h>
39*a95017a8Spho 
40*a95017a8Spho int
fuse_invalidate(struct fuse * fuse,const char * path)41*a95017a8Spho fuse_invalidate(struct fuse *fuse __attribute__((__unused__)),
42*a95017a8Spho                 const char *path __attribute__((__unused__)))
43*a95017a8Spho {
44*a95017a8Spho     int res = fuse_invalidate_path(fuse, path);
45*a95017a8Spho 
46*a95017a8Spho     switch (res) {
47*a95017a8Spho     case -ENOENT:
48*a95017a8Spho         /* There was no entry to be invalidated. This isn't an
49*a95017a8Spho          * error. */
50*a95017a8Spho         return 0;
51*a95017a8Spho     default:
52*a95017a8Spho         return res;
53*a95017a8Spho     }
54*a95017a8Spho }
55