xref: /freebsd/sys/contrib/openzfs/include/os/linux/spl/sys/user.h (revision 61145dc2b94f12f6a47344fb9aac702321880e43)
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  *  Copyright (C) 2015 Cluster Inc.
4  *  Produced at ClusterHQ Inc (cf, DISCLAIMER).
5  *  Written by Richard Yao <richard.yao@clusterhq.com>.
6  *
7  *  This file is part of the SPL, Solaris Porting Layer.
8  *
9  *  The SPL is free software; you can redistribute it and/or modify it
10  *  under the terms of the GNU General Public License as published by the
11  *  Free Software Foundation; either version 2 of the License, or (at your
12  *  option) any later version.
13  *
14  *  The SPL is distributed in the hope that it will be useful, but WITHOUT
15  *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17  *  for more details.
18  *
19  *  You should have received a copy of the GNU General Public License along
20  *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef _SPL_USER_H
24 #define	_SPL_USER_H
25 
26 /*
27  * We have uf_info_t for areleasef(). We implement areleasef() using a global
28  * linked list of all open file descriptors with the task structs referenced,
29  * so accessing the correct descriptor from areleasef() only requires knowing
30  * about the Linux task_struct. Since this is internal to our compatibility
31  * layer, we make it an opaque type.
32  *
33  * XXX: If the descriptor changes under us and we do not do a getf() between
34  * the change and using it, we would get an incorrect reference.
35  */
36 
37 struct uf_info;
38 typedef struct uf_info uf_info_t;
39 
40 #define	P_FINFO(x) ((uf_info_t *)x)
41 
42 #endif /* SPL_USER_H */
43