@@ -387,9 +387,14 @@ dispatch_io_create_with_path(dispatch_io_type_t type, const char *path,
387
387
int err = 0 ;
388
388
struct stat st ;
389
389
_dispatch_io_syscall_switch_noerr (err ,
390
- (path_data -> oflag & O_NOFOLLOW ) == O_NOFOLLOW ||
391
- (path_data -> oflag & O_SYMLINK ) == O_SYMLINK ?
390
+ (path_data -> oflag & O_NOFOLLOW ) == O_NOFOLLOW
391
+ #ifdef __LINUX_PORT_HDD__
392
+ ?
392
393
lstat (path_data -> path , & st ) : stat (path_data -> path , & st ),
394
+ #else
395
+ || (path_data -> oflag & O_SYMLINK ) == O_SYMLINK ?
396
+ lstat (path_data -> path , & st ) : stat (path_data -> path , & st ),
397
+ #endif
393
398
case 0 :
394
399
err = _dispatch_io_validate_type (channel , st .st_mode );
395
400
break ;
@@ -1777,17 +1782,37 @@ _dispatch_stream_cleanup_operations(dispatch_stream_t stream,
1777
1782
dispatch_operation_t op , tmp ;
1778
1783
typeof (* stream -> operations ) * operations ;
1779
1784
operations = & stream -> operations [DISPATCH_IO_RANDOM ];
1785
+ #ifdef __LINUX_PORT_HDD__
1786
+ LINUX_PORT_ERROR ();
1787
+ // NOT CORRECT (doesn't support removal during iteration)
1788
+ TAILQ_FOREACH (op , operations , operation_list ) {
1789
+ if (!channel || op -> channel == channel ) {
1790
+ _dispatch_stream_complete_operation (stream , op );
1791
+ }
1792
+ }
1793
+ #else
1780
1794
TAILQ_FOREACH_SAFE (op , operations , operation_list , tmp ) {
1781
1795
if (!channel || op -> channel == channel ) {
1782
1796
_dispatch_stream_complete_operation (stream , op );
1783
1797
}
1784
1798
}
1799
+ #endif
1785
1800
operations = & stream -> operations [DISPATCH_IO_STREAM ];
1801
+ #ifdef __LINUX_PORT_HDD__
1802
+ LINUX_PORT_ERROR ();
1803
+ // NOT CORRECT (doesn't support removal during iteration)
1804
+ TAILQ_FOREACH (op , operations , operation_list ) {
1805
+ if (!channel || op -> channel == channel ) {
1806
+ _dispatch_stream_complete_operation (stream , op );
1807
+ }
1808
+ }
1809
+ #else
1786
1810
TAILQ_FOREACH_SAFE (op , operations , operation_list , tmp ) {
1787
1811
if (!channel || op -> channel == channel ) {
1788
1812
_dispatch_stream_complete_operation (stream , op );
1789
1813
}
1790
1814
}
1815
+ #endif
1791
1816
if (stream -> source_running && !_dispatch_stream_operation_avail (stream )) {
1792
1817
dispatch_suspend (stream -> source );
1793
1818
stream -> source_running = false;
@@ -1799,11 +1824,21 @@ _dispatch_disk_cleanup_operations(dispatch_disk_t disk, dispatch_io_t channel)
1799
1824
{
1800
1825
// On pick queue
1801
1826
dispatch_operation_t op , tmp ;
1827
+ #ifdef __LINUX_PORT_HDD__
1828
+ LINUX_PORT_ERROR ();
1829
+ // NOT CORRECT (doesn't support removal during iteration)
1830
+ TAILQ_FOREACH (op , & disk -> operations , operation_list ) {
1831
+ if (!channel || op -> channel == channel ) {
1832
+ _dispatch_disk_complete_operation (disk , op );
1833
+ }
1834
+ }
1835
+ #else
1802
1836
TAILQ_FOREACH_SAFE (op , & disk -> operations , operation_list , tmp ) {
1803
1837
if (!channel || op -> channel == channel ) {
1804
1838
_dispatch_disk_complete_operation (disk , op );
1805
1839
}
1806
1840
}
1841
+ #endif
1807
1842
}
1808
1843
1809
1844
#pragma mark -
@@ -2064,6 +2099,9 @@ _dispatch_disk_perform(void *ctxt)
2064
2099
static void
2065
2100
_dispatch_operation_advise (dispatch_operation_t op , size_t chunk_size )
2066
2101
{
2102
+ #ifdef __LINUX_PORT_HDD__
2103
+ LINUX_PORT_ERROR ();
2104
+ #else
2067
2105
int err ;
2068
2106
struct radvisory advise ;
2069
2107
// No point in issuing a read advise for the next chunk if we are already
@@ -2090,6 +2128,7 @@ _dispatch_operation_advise(dispatch_operation_t op, size_t chunk_size)
2090
2128
// TODO: set disk status on error
2091
2129
default : (void )dispatch_assume_zero (err ); break ;
2092
2130
);
2131
+ #endif
2093
2132
}
2094
2133
2095
2134
static int
0 commit comments