소스 검색

Revert "block/file-posix: Use O_RDWR for locking on macOS"

This reverts commit c800dbb61e39547b97ce8278e8a293d10e365053.
osy 1 년 전
부모
커밋
76a68e0f5b
1개의 변경된 파일0개의 추가작업 그리고 17개의 파일을 삭제
  1. 0 17
      block/file-posix.c

+ 0 - 17
block/file-posix.c

@@ -131,14 +131,6 @@
 #define RAW_LOCK_PERM_BASE             100
 #define RAW_LOCK_SHARED_BASE           200
 
-/*
- * qemu_lock_fd_test always returns 0 when fd is not open for writing and
- * exclusive is true on macOS 11.3.1.
- */
-#ifdef __APPLE__
-#define RAW_LOCK_WRITES
-#endif
-
 typedef struct BDRVRawState {
     int fd;
     bool use_lock;
@@ -691,11 +683,7 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
                                                false);
 
     s->open_flags = open_flags;
-#ifdef RAW_LOCK_WRITES
-    raw_parse_flags(bdrv_flags, &s->open_flags, s->use_lock);
-#else
     raw_parse_flags(bdrv_flags, &s->open_flags, false);
-#endif
 
     s->fd = -1;
     fd = qemu_open(filename, s->open_flags, errp);
@@ -1060,11 +1048,6 @@ static int raw_reconfigure_getfd(BlockDriverState *bs, int flags,
     bool has_writers = perm &
         (BLK_PERM_WRITE | BLK_PERM_WRITE_UNCHANGED | BLK_PERM_RESIZE);
     int fcntl_flags = O_APPEND | O_NONBLOCK;
-#ifdef RAW_LOCK_WRITES
-    if (s->use_lock) {
-        has_writers = true;
-    }
-#endif
 #ifdef O_NOATIME
     fcntl_flags |= O_NOATIME;
 #endif