@@ -425,11 +425,7 @@ struct io_sr_msg {
425
425
struct io_open {
426
426
struct file * file ;
427
427
int dfd ;
428
- union {
429
- unsigned mask ;
430
- };
431
428
struct filename * filename ;
432
- struct statx __user * buffer ;
433
429
struct open_how how ;
434
430
unsigned long nofile ;
435
431
};
@@ -481,6 +477,15 @@ struct io_provide_buf {
481
477
__u16 bid ;
482
478
};
483
479
480
+ struct io_statx {
481
+ struct file * file ;
482
+ int dfd ;
483
+ unsigned int mask ;
484
+ unsigned int flags ;
485
+ struct filename * filename ;
486
+ struct statx __user * buffer ;
487
+ };
488
+
484
489
struct io_async_connect {
485
490
struct sockaddr_storage address ;
486
491
};
@@ -622,6 +627,7 @@ struct io_kiocb {
622
627
struct io_epoll epoll ;
623
628
struct io_splice splice ;
624
629
struct io_provide_buf pbuf ;
630
+ struct io_statx statx ;
625
631
};
626
632
627
633
struct io_async_ctx * io ;
@@ -3381,19 +3387,19 @@ static int io_statx_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
3381
3387
if (req -> flags & REQ_F_NEED_CLEANUP )
3382
3388
return 0 ;
3383
3389
3384
- req -> open .dfd = READ_ONCE (sqe -> fd );
3385
- req -> open .mask = READ_ONCE (sqe -> len );
3390
+ req -> statx .dfd = READ_ONCE (sqe -> fd );
3391
+ req -> statx .mask = READ_ONCE (sqe -> len );
3386
3392
fname = u64_to_user_ptr (READ_ONCE (sqe -> addr ));
3387
- req -> open .buffer = u64_to_user_ptr (READ_ONCE (sqe -> addr2 ));
3388
- req -> open . how .flags = READ_ONCE (sqe -> statx_flags );
3393
+ req -> statx .buffer = u64_to_user_ptr (READ_ONCE (sqe -> addr2 ));
3394
+ req -> statx .flags = READ_ONCE (sqe -> statx_flags );
3389
3395
3390
- if (vfs_stat_set_lookup_flags (& lookup_flags , req -> open . how .flags ))
3396
+ if (vfs_stat_set_lookup_flags (& lookup_flags , req -> statx .flags ))
3391
3397
return - EINVAL ;
3392
3398
3393
- req -> open .filename = getname_flags (fname , lookup_flags , NULL );
3394
- if (IS_ERR (req -> open .filename )) {
3395
- ret = PTR_ERR (req -> open .filename );
3396
- req -> open .filename = NULL ;
3399
+ req -> statx .filename = getname_flags (fname , lookup_flags , NULL );
3400
+ if (IS_ERR (req -> statx .filename )) {
3401
+ ret = PTR_ERR (req -> statx .filename );
3402
+ req -> statx .filename = NULL ;
3397
3403
return ret ;
3398
3404
}
3399
3405
@@ -3403,7 +3409,7 @@ static int io_statx_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
3403
3409
3404
3410
static int io_statx (struct io_kiocb * req , bool force_nonblock )
3405
3411
{
3406
- struct io_open * ctx = & req -> open ;
3412
+ struct io_statx * ctx = & req -> statx ;
3407
3413
unsigned lookup_flags ;
3408
3414
struct path path ;
3409
3415
struct kstat stat ;
@@ -3416,7 +3422,7 @@ static int io_statx(struct io_kiocb *req, bool force_nonblock)
3416
3422
return - EAGAIN ;
3417
3423
}
3418
3424
3419
- if (vfs_stat_set_lookup_flags (& lookup_flags , ctx -> how . flags ))
3425
+ if (vfs_stat_set_lookup_flags (& lookup_flags , ctx -> flags ))
3420
3426
return - EINVAL ;
3421
3427
3422
3428
retry :
@@ -3428,7 +3434,7 @@ static int io_statx(struct io_kiocb *req, bool force_nonblock)
3428
3434
if (ret )
3429
3435
goto err ;
3430
3436
3431
- ret = vfs_getattr (& path , & stat , ctx -> mask , ctx -> how . flags );
3437
+ ret = vfs_getattr (& path , & stat , ctx -> mask , ctx -> flags );
3432
3438
path_put (& path );
3433
3439
if (retry_estale (ret , lookup_flags )) {
3434
3440
lookup_flags |= LOOKUP_REVAL ;
0 commit comments