@@ -2459,17 +2459,16 @@ struct vfs_ceph_aio_state {
2459
2459
struct vfs_ceph_fh * cfh ;
2460
2460
#if HAVE_CEPH_ASYNCIO
2461
2461
struct tevent_req * req ;
2462
- bool orphaned ;
2463
2462
struct tevent_immediate * im ;
2464
2463
void * data ;
2465
- size_t len ;
2466
- off_t off ;
2467
- bool write ;
2468
- bool fsync ;
2469
-
2470
2464
struct ceph_ll_io_info io_info ;
2471
2465
struct iovec iov ;
2466
+ bool orphaned ;
2467
+ bool write ;
2468
+ bool fsync ;
2472
2469
#endif
2470
+ size_t len ;
2471
+ off_t off ;
2473
2472
struct timespec start_time ;
2474
2473
struct timespec finish_time ;
2475
2474
ssize_t result ;
@@ -2628,32 +2627,6 @@ static void vfs_ceph_aio_done(struct tevent_context *ev,
2628
2627
tevent_req_done (req );
2629
2628
}
2630
2629
2631
- static ssize_t vfs_ceph_aio_recv (struct tevent_req * req ,
2632
- struct vfs_aio_state * vfs_aio_state )
2633
- {
2634
- struct vfs_ceph_aio_state * state = tevent_req_data (
2635
- req , struct vfs_ceph_aio_state );
2636
- ssize_t res = -1 ;
2637
-
2638
- DBG_DEBUG ("[CEPH] aio_recv: ino=%" PRIu64
2639
- " fd=%d off=%jd len=%ju result=%ld\n" ,
2640
- state -> cfh -> iref .ino ,
2641
- state -> cfh -> fd ,
2642
- state -> off ,
2643
- state -> len ,
2644
- state -> result );
2645
-
2646
- if (tevent_req_is_unix_error (req , & vfs_aio_state -> error )) {
2647
- goto out ;
2648
- }
2649
-
2650
- * vfs_aio_state = state -> vfs_aio_state ;
2651
- res = state -> result ;
2652
- out :
2653
- tevent_req_received (req );
2654
- return res ;
2655
- }
2656
-
2657
2630
#endif /* HAVE_CEPH_ASYNCIO */
2658
2631
2659
2632
static void vfs_ceph_aio_prepare (struct vfs_handle_struct * handle ,
@@ -2761,21 +2734,29 @@ static ssize_t vfs_ceph_pread_recv(struct tevent_req *req,
2761
2734
{
2762
2735
struct vfs_ceph_aio_state * state = tevent_req_data (
2763
2736
req , struct vfs_ceph_aio_state );
2737
+ ssize_t res = -1 ;
2764
2738
2765
- DBG_DEBUG ("[CEPH] pread_recv: bytes_read=%zd\n" , state -> result );
2739
+ DBG_DEBUG ("[CEPH] pread_recv: bytes_read=%zd"
2740
+ " ino=%" PRIu64
2741
+ " fd=%d off=%jd len=%ju\n" ,
2742
+ state -> result ,
2743
+ state -> cfh -> iref .ino ,
2744
+ state -> cfh -> fd ,
2745
+ state -> off ,
2746
+ state -> len );
2766
2747
2767
2748
SMBPROFILE_BYTES_ASYNC_END (state -> profile_bytes );
2768
2749
SMBPROFILE_BYTES_ASYNC_END (state -> profile_bytes_x );
2769
2750
2770
- #if HAVE_CEPH_ASYNCIO
2771
- return vfs_ceph_aio_recv (req , vfs_aio_state );
2772
- #endif
2773
2751
if (tevent_req_is_unix_error (req , & vfs_aio_state -> error )) {
2774
- return -1 ;
2752
+ goto out ;
2775
2753
}
2776
2754
2777
2755
* vfs_aio_state = state -> vfs_aio_state ;
2778
- return state -> result ;
2756
+ res = state -> result ;
2757
+ out :
2758
+ tevent_req_received (req );
2759
+ return res ;
2779
2760
}
2780
2761
2781
2762
static ssize_t vfs_ceph_pwrite (struct vfs_handle_struct * handle ,
@@ -2869,22 +2850,29 @@ static ssize_t vfs_ceph_pwrite_recv(struct tevent_req *req,
2869
2850
{
2870
2851
struct vfs_ceph_aio_state * state = tevent_req_data (
2871
2852
req , struct vfs_ceph_aio_state );
2853
+ ssize_t res = -1 ;
2872
2854
2873
- DBG_DEBUG ("[CEPH] pwrite_recv: bytes_written=%zd\n" , state -> result );
2855
+ DBG_DEBUG ("[CEPH] pwrite_recv: bytes_written=%zd"
2856
+ " ino=%" PRIu64
2857
+ " fd=%d off=%jd len=%ju\n" ,
2858
+ state -> result ,
2859
+ state -> cfh -> iref .ino ,
2860
+ state -> cfh -> fd ,
2861
+ state -> off ,
2862
+ state -> len );
2874
2863
2875
2864
SMBPROFILE_BYTES_ASYNC_END (state -> profile_bytes );
2876
2865
SMBPROFILE_BYTES_ASYNC_END (state -> profile_bytes_x );
2877
2866
2878
- #if HAVE_CEPH_ASYNCIO
2879
- return vfs_ceph_aio_recv (req , vfs_aio_state );
2880
- #endif
2881
-
2882
2867
if (tevent_req_is_unix_error (req , & vfs_aio_state -> error )) {
2883
- return -1 ;
2868
+ goto out ;
2884
2869
}
2885
2870
2886
2871
* vfs_aio_state = state -> vfs_aio_state ;
2887
- return state -> result ;
2872
+ res = state -> result ;
2873
+ out :
2874
+ tevent_req_received (req );
2875
+ return res ;
2888
2876
}
2889
2877
2890
2878
static off_t vfs_ceph_lseek (struct vfs_handle_struct * handle ,
@@ -3063,24 +3051,31 @@ static int vfs_ceph_fsync_recv(struct tevent_req *req,
3063
3051
{
3064
3052
struct vfs_ceph_aio_state * state = tevent_req_data (
3065
3053
req , struct vfs_ceph_aio_state );
3054
+ ssize_t res = -1 ;
3066
3055
3067
- DBG_DEBUG ("[CEPH] fsync_recv: error=%d duration=%" PRIu64 "\n" ,
3056
+ DBG_DEBUG ("[CEPH] fsync_recv: error=%d duration=%" PRIu64
3057
+ " ino=%" PRIu64
3058
+ " fd=%d off=%jd len=%ju result=%ld\n" ,
3068
3059
state -> vfs_aio_state .error ,
3069
- state -> vfs_aio_state .duration );
3060
+ state -> vfs_aio_state .duration ,
3061
+ state -> cfh -> iref .ino ,
3062
+ state -> cfh -> fd ,
3063
+ state -> off ,
3064
+ state -> len ,
3065
+ state -> result );
3070
3066
3071
3067
SMBPROFILE_BYTES_ASYNC_END (state -> profile_bytes );
3072
3068
SMBPROFILE_BYTES_ASYNC_END (state -> profile_bytes_x );
3073
3069
3074
- #if HAVE_CEPH_ASYNCIO
3075
- return vfs_ceph_aio_recv (req , vfs_aio_state );
3076
- #endif
3077
-
3078
3070
if (tevent_req_is_unix_error (req , & vfs_aio_state -> error )) {
3079
- return -1 ;
3071
+ goto out ;
3080
3072
}
3081
3073
3082
3074
* vfs_aio_state = state -> vfs_aio_state ;
3083
- return 0 ;
3075
+ res = state -> result ;
3076
+ out :
3077
+ tevent_req_received (req );
3078
+ return res ;
3084
3079
}
3085
3080
3086
3081
static int vfs_ceph_stat (struct vfs_handle_struct * handle ,
0 commit comments