Skip to contentSkip to conversation

aio: always provide ki_destruct_fn callback pointer

PATCH New Arnd Bergmann 1 participant 1 message Mar 15, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 aio: always provide ki_destruct_fn callback pointer

The newly added synchronous openat support in AIO adds a ki_destruct_fn function pointer to struct aio_kiocb inside of a CONFIG_AIO_THREAD check but calls it unconditionally, leading to a build error:

fs/aio.c: In function 'kiocb_free':
fs/aio.c:1101:9: error: 'struct aio_kiocb' has no member named 'ki_destruct_fn'
if (req->ki_destruct_fn)

         ^~

fs/aio.c:1102:6: error: 'struct aio_kiocb' has no member named 'ki_destruct_fn'

This moves the declaration outside of the #ifdef, assuming that we want to call this regardless.

Fixes 5d3d80fcf992 ("aio: add support for in-submit openat")
---
 fs/aio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/aio.c +1 -1
index f6d7df041342..72a7e8a2f67e 100644
@@ -221,8 +221,8 @@ struct aio_kiocb {
 	struct fs_struct	*ki_fs;
 	struct files_struct	*ki_files;
 	const struct cred	*ki_cred;
-	aio_destruct_fn_t	ki_destruct_fn;
 #endif
+	aio_destruct_fn_t	ki_destruct_fn;
 };
 
 /*------ sysctl variables----*/
Signature · 1 line
2.7.0