teknoraver / rpms / mstflint

Forked from rpms/mstflint 24 days ago
Clone

Blame flock.patch

9339e9
From 963895584a99f3fc8a506a6ab65b9a0ffad6477c Mon Sep 17 00:00:00 2001
9339e9
From: oburstein <oburstein@nvidia.com>
9339e9
Date: Wed, 29 Jan 2025 16:33:52 +0200
9339e9
Subject: [PATCH] [mtcr_ul] Remove flock() usage from READ4_PCI() WRITE4_PCI()
9339e9
 macros no need for this semaphore as we rely on the VSC's semaphore.
9339e9
9339e9
---
9339e9
 mtcr_ul/mtcr_ul_com.c | 28 ----------------------------
9339e9
 1 file changed, 28 deletions(-)
9339e9
9339e9
diff --git a/mtcr_ul/mtcr_ul_com.c b/mtcr_ul/mtcr_ul_com.c
9339e9
index d37b64f7..77d2f19a 100644
9339e9
--- a/mtcr_ul/mtcr_ul_com.c
9339e9
+++ b/mtcr_ul/mtcr_ul_com.c
9339e9
@@ -712,21 +712,7 @@ enum {
9339e9
     do                                                               \
9339e9
     {                                                                \
9339e9
         int       rc;                                                \
9339e9
-        int       lock_rc;                                           \
9339e9
-        ul_ctx_t* pci_ctx = mf->ul_ctx;                              \
9339e9
-        lock_rc = _flock_int(pci_ctx->fdlock, LOCK_EX);              \
9339e9
-        if (lock_rc)                                                 \
9339e9
-        {                                                            \
9339e9
-            perror(err_prefix);                                      \
9339e9
-            action_on_fail;                                          \
9339e9
-        }                                                            \
9339e9
         rc = pread(mf->fd, val_ptr, 4, pci_offs);                    \
9339e9
-        lock_rc = _flock_int(pci_ctx->fdlock, LOCK_UN);              \
9339e9
-        if (lock_rc)                                                 \
9339e9
-        {                                                            \
9339e9
-            perror(err_prefix);                                      \
9339e9
-            action_on_fail;                                          \
9339e9
-        }                                                            \
9339e9
         if (rc != 4)                                                 \
9339e9
         {                                                            \
9339e9
             if (rc < 0)                                              \
9339e9
@@ -742,23 +728,9 @@ enum {
9339e9
     do                                                            \
9339e9
     {                                                             \
9339e9
         int       rc;                                             \
9339e9
-        int       lock_rc;                                        \
9339e9
         u_int32_t val_le;                                         \
9339e9
-        ul_ctx_t* pci_ctx = mf->ul_ctx;                           \
9339e9
         val_le = __cpu_to_le32(val);                              \
9339e9
-        lock_rc = _flock_int(pci_ctx->fdlock, LOCK_EX);           \
9339e9
-        if (lock_rc)                                              \
9339e9
-        {                                                         \
9339e9
-            perror(err_prefix);                                   \
9339e9
-            action_on_fail;                                       \
9339e9
-        }                                                         \
9339e9
         rc = pwrite(mf->fd, &val_le, 4, pci_offs);                \
9339e9
-        lock_rc = _flock_int(pci_ctx->fdlock, LOCK_UN);           \
9339e9
-        if (lock_rc)                                              \
9339e9
-        {                                                         \
9339e9
-            perror(err_prefix);                                   \
9339e9
-            action_on_fail;                                       \
9339e9
-        }                                                         \
9339e9
         if (rc != 4)                                              \
9339e9
         {                                                         \
9339e9
             if (rc < 0)                                           \