io_uring: add header include guards to all header files
PATCH 1/1 io_uring: add header include guards to all header files
From: Vishwanath Seshagiri <[email protected]>
Add missing header include guards to all *.h files in the io_uring/ directory to prevent multiple inclusion issues. This follows the established pattern used in io_uring/zcrx.h and other kernel headers.
The guards use the format IOU_<NAME>_H to maintain consistency with the io_uring subsystem naming conventions.
Testing: Verified functionality with liburing test suite - all tests pass.
--- io_uring/advise.h | 3 +++ io_uring/epoll.h | 3 +++ io_uring/eventfd.h | 4 ++++ io_uring/fdinfo.h | 3 +++ io_uring/fs.h | 4 +++- io_uring/futex.h | 4 +++- io_uring/msg_ring.h | 4 +++- io_uring/net.h | 3 +++ io_uring/nop.h | 3 +++ io_uring/openclose.h | 3 +++ io_uring/rw.h | 3 +++ io_uring/splice.h | 3 +++ io_uring/sqpoll.h | 3 +++ io_uring/statx.h | 3 +++ io_uring/sync.h | 3 +++ io_uring/tctx.h | 3 +++ io_uring/timeout.h | 3 +++ io_uring/truncate.h | 3 +++ io_uring/uring_cmd.h | 3 +++ io_uring/waitid.h | 3 +++ io_uring/xattr.h | 3 +++ 21 files changed, 64 insertions(+), 3 deletions(-)
io_uring/advise.h +3 -0
@@ -1,7 +1,10 @@// SPDX-License-Identifier: GPL-2.0 +#ifndef IOU_ADVISE_H +#define IOU_ADVISE_H int io_madvise_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe);int io_madvise (struct io_kiocb *req,unsigned int issue_flags);int io_fadvise_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe);int io_fadvise (struct io_kiocb *req,unsigned int issue_flags); +#endif
io_uring/epoll.h +3 -0
@@ -1,4 +1,6 @@// SPDX-License-Identifier: GPL-2.0 +#ifndef IOU_EPOLL_H +#define IOU_EPOLL_H #if defined(CONFIG_EPOLL )int io_epoll_ctl_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe);
@@ -6,3 +8,4 @@ int io_epoll_ctl(struct io_kiocb *req, unsigned int issue_flags);int io_epoll_wait_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe);int io_epoll_wait (struct io_kiocb *req,unsigned int issue_flags);#endif +#endif
io_uring/eventfd.h +4 -0
@@ -1,3 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0 +#ifndef IOU_EVENT_FD_H +#define IOU_EVENT_FD_H struct io_ring_ctx ; int io_eventfd_register(struct io_ring_ctx *ctx, void __user *arg,
@@ -5,3 +8,4 @@ int io_eventfd_register(struct io_ring_ctx *ctx, void __user *arg,int io_eventfd_unregister (struct io_ring_ctx *ctx);void io_eventfd_signal (struct io_ring_ctx *ctx,bool cqe_event); +#endif
io_uring/fdinfo.h +3 -0
@@ -1,3 +1,6 @@// SPDX-License-Identifier: GPL-2.0 +#ifndef IOU_FD_INFO_H +#define IOU_FD_INFO_H void io_uring_show_fdinfo (struct seq_file *m,struct file *f); +#endif
io_uring/fs.h +3 -1
@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0 - +#ifndef IOU_FS_H +#define IOU_FS_H int io_renameat_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe);int io_renameat (struct io_kiocb *req,unsigned int issue_flags);void io_renameat_cleanup (struct io_kiocb *req);
@@ -18,3 +19,4 @@ int io_symlinkat(struct io_kiocb *req, unsigned int issue_flags);int io_linkat_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe);int io_linkat (struct io_kiocb *req,unsigned int issue_flags);void io_link_cleanup (struct io_kiocb *req); +#endif
io_uring/futex.h +3 -1
@@ -1,5 +1,6 @@// SPDX-License-Identifier: GPL-2.0 - +#ifndef IOU_FUTEX_H +#define IOU_FUTEX_H #include "cancel.h" int io_futex_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe);
@@ -35,3 +36,4 @@ static inline void io_futex_cache_free(struct io_ring_ctx *ctx) { }#endif +#endif
io_uring/msg_ring.h +3 -1
@@ -1,6 +1,8 @@// SPDX-License-Identifier: GPL-2.0 - +#ifndef IOU_MSG_RING_H +#define IOU_MSG_RING_H int io_uring_sync_msg_ring (struct io_uring_sqe *sqe);int io_msg_ring_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe);int io_msg_ring (struct io_kiocb *req,unsigned int issue_flags);void io_msg_ring_cleanup (struct io_kiocb *req); +#endif
io_uring/net.h +3 -0
@@ -1,4 +1,6 @@// SPDX-License-Identifier: GPL-2.0 +#ifndef IOU_NET_H +#define IOU_NET_H #include <linux/net.h> #include <linux/uio.h>
@@ -65,3 +67,4 @@ static inline void io_netmsg_cache_free(const void *entry) { }#endif +#endif
io_uring/nop.h +3 -0
@@ -1,4 +1,7 @@// SPDX-License-Identifier: GPL-2.0 +#ifndef IOU_NOP_H +#define IOU_NOP_H int io_nop_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe);int io_nop (struct io_kiocb *req,unsigned int issue_flags); +#endif
io_uring/openclose.h +3 -0
@@ -1,4 +1,6 @@// SPDX-License-Identifier: GPL-2.0 +#ifndef IOU_OPEN_CLOSE_H +#define IOU_OPEN_CLOSE_H int __io_close_fixed (struct io_ring_ctx *ctx,unsigned int issue_flags,unsigned int offset);
@@ -18,3 +20,4 @@ int io_pipe(struct io_kiocb *req, unsigned int issue_flags);int io_install_fixed_fd_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe);int io_install_fixed_fd (struct io_kiocb *req,unsigned int issue_flags); +#endif
io_uring/rw.h +3 -0
@@ -1,4 +1,6 @@// SPDX-License-Identifier: GPL-2.0 +#ifndef IOU_RW_H +#define IOU_RW_H #include <linux/io_uring_types.h> #include <linux/pagemap.h>
@@ -50,3 +52,4 @@ void io_req_rw_complete(struct io_kiocb *req, io_tw_token_t tw);int io_read_mshot_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe);int io_read_mshot (struct io_kiocb *req,unsigned int issue_flags);void io_rw_cache_free (const void *entry); +#endif
io_uring/splice.h +3 -0
@@ -1,4 +1,6 @@// SPDX-License-Identifier: GPL-2.0 +#ifndef IOU_SPLICE_H +#define IOU_SPLICE_H int io_tee_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe);int io_tee (struct io_kiocb *req,unsigned int issue_flags);
@@ -6,3 +8,4 @@ int io_tee(struct io_kiocb *req, unsigned int issue_flags);void io_splice_cleanup (struct io_kiocb *req);int io_splice_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe);int io_splice (struct io_kiocb *req,unsigned int issue_flags); +#endif
io_uring/sqpoll.h +3 -0
@@ -1,4 +1,6 @@// SPDX-License-Identifier: GPL-2.0 +#ifndef IOU_SQ_POLL_H +#define IOU_SQ_POLL_H struct io_sq_data { refcount_t refs;
@@ -35,3 +37,4 @@ static inline struct task_struct *sqpoll_task_locked(struct io_sq_data *sqd)return rcu_dereference_protected (sqd->thread, lockdep_is_held(&sqd->lock)); } +#endif
io_uring/statx.h +3 -0
@@ -1,5 +1,8 @@// SPDX-License-Identifier: GPL-2.0 +#ifndef IOU_STATX_H +#define IOU_STATX_H int io_statx_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe);int io_statx (struct io_kiocb *req,unsigned int issue_flags);void io_statx_cleanup (struct io_kiocb *req); +#endif
io_uring/sync.h +3 -0
@@ -1,4 +1,6 @@// SPDX-License-Identifier: GPL-2.0 +#ifndef IOU_SYNC_H +#define IOU_SYNC_H int io_sfr_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe);int io_sync_file_range (struct io_kiocb *req,unsigned int issue_flags);
@@ -8,3 +10,4 @@ int io_fsync(struct io_kiocb *req, unsigned int issue_flags);int io_fallocate (struct io_kiocb *req,unsigned int issue_flags);int io_fallocate_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe); +#endif
io_uring/tctx.h +3 -0
@@ -1,4 +1,6 @@// SPDX-License-Identifier: GPL-2.0 +#ifndef IOU_TC_TX_H +#define IOU_TC_TX_H struct io_tctx_node { struct list_head ctx_node;
@@ -31,3 +33,4 @@ static inline int io_uring_add_tctx_node(struct io_ring_ctx *ctx) return __io_uring_add_tctx_node_from_submit(ctx); } +#endif
io_uring/timeout.h +3 -0
@@ -1,4 +1,6 @@// SPDX-License-Identifier: GPL-2.0 +#ifndef IOU_TIMEOUT_H +#define IOU_TIMEOUT_H struct io_timeout_data { struct io_kiocb *req;
@@ -21,3 +23,4 @@ int io_link_timeout_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);int io_timeout (struct io_kiocb *req,unsigned int issue_flags);int io_timeout_remove_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe);int io_timeout_remove (struct io_kiocb *req,unsigned int issue_flags); +#endif
io_uring/truncate.h +3 -0
@@ -1,4 +1,7 @@// SPDX-License-Identifier: GPL-2.0 +#ifndef IOU_TRUNCATE_H +#define IOU_TRUNCATE_H int io_ftruncate_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe);int io_ftruncate (struct io_kiocb *req,unsigned int issue_flags); +#endif
io_uring/uring_cmd.h +3 -0
@@ -1,4 +1,6 @@// SPDX-License-Identifier: GPL-2.0 +#ifndef IOU_URING_CMD_H +#define IOU_URING_CMD_H #include <linux/io_uring/cmd.h> #include <linux/io_uring_types.h>
@@ -18,3 +20,4 @@ bool io_uring_try_cancel_uring_cmd(struct io_ring_ctx *ctx, struct io_uring_task *tctx, bool cancel_all);void io_cmd_cache_free (const void *entry); +#endif
io_uring/waitid.h +3 -0
@@ -1,4 +1,6 @@// SPDX-License-Identifier: GPL-2.0 +#ifndef IOU_WAIT_ID_H +#define IOU_WAIT_ID_H #include "../kernel/exit.h"
@@ -13,3 +15,4 @@ int io_waitid_cancel(struct io_ring_ctx *ctx, struct io_cancel_data *cd, unsigned int issue_flags);bool io_waitid_remove_all (struct io_ring_ctx *ctx,struct io_uring_task *tctx,bool cancel_all); +#endif
io_uring/xattr.h +3 -0
@@ -1,4 +1,6 @@// SPDX-License-Identifier: GPL-2.0 +#ifndef IOU_XATTR_H +#define IOU_XATTR_H void io_xattr_cleanup (struct io_kiocb *req);
@@ -13,3 +15,4 @@ int io_fgetxattr(struct io_kiocb *req, unsigned int issue_flags);int io_getxattr_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe);int io_getxattr (struct io_kiocb *req,unsigned int issue_flags); +#endif
Signature · 1 line
2.47.1
Jens Axboe
maintainerQuoted 8 lines · Vishwanath Seshagiri
From: Vishwanath Seshagiri <[email protected]>
Add missing header include guards to all *.h files in the
io_uring/directory to prevent multiple inclusion issues. This follows the established pattern used inio_uring/zcrx.hand other kernel headers.The guards use the format IOU_<NAME>_H to maintain consistency with the
io_uringsubsystem naming conventions.
It's quite on purpose they don't have guards - because they don't need them. These headers are included by only C files, the ones that need a guard would have them (eg ones potentially included in nested headers).
Signature · 1 line
Jens Axboe