2 * Copyright (C) 2012-2020 all contributors <cmogstored-public@yhbt.net>
3 * License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
6 static inline struct mog_fd
* mog_fd_of(void *as_obj
)
8 uintptr_t as_addr
= (uintptr_t)as_obj
;
10 return (struct mog_fd
*)(as_addr
- offsetof(struct mog_fd
, as
));
14 /* used to validate a mog_fd is never in two queues at once */
15 static inline void mog_fd_check_in(struct mog_fd
*mfd
)
17 /* currently unused */
20 /* used to validate a mog_fd is never in two queues at once */
21 static inline void mog_fd_check_out(struct mog_fd
*mfd
)
23 /* currently unused */
26 struct mog_fd
* mog_fd_init(int fd
, enum mog_fd_type fd_type
);