Skip to content

rust: block: allow(deprecated) for fetch_update for Rust >= 1.99.0 - #42

Open
blktests-ci-block-trial[bot] wants to merge 1 commit into
for-next_basefrom
series/372=>for-next
Open

rust: block: allow(deprecated) for fetch_update for Rust >= 1.99.0#42
blktests-ci-block-trial[bot] wants to merge 1 commit into
for-next_basefrom
series/372=>for-next

Conversation

@blktests-ci-block-trial

Copy link
Copy Markdown

Pull request for series with
subject: rust: block: allow(deprecated) for fetch_update for Rust >= 1.99.0
version: 1
url: http://redsun45:8000/project/linux-block/list/?series=372

@blktests-ci-block-trial

Copy link
Copy Markdown
Author

Upstream branch: ef542b8
series: http://redsun45:8000/project/linux-block/list/?series=372
version: 1

Pull request is NOT updated. Failed to apply http://redsun45:8000/project/linux-block/list/?series=372
error message:

Cmd('git') failed due to: exit code(128)
  cmdline: git am --3way
  stdout: 'Applying: rust: block: `allow(deprecated)` for `fetch_update` for Rust >= 1.99.0
Using index info to reconstruct a base tree...
M	rust/kernel/block/mq/request.rs
Falling back to patching base and 3-way merge...
Auto-merging rust/kernel/block/mq/request.rs
CONFLICT (content): Merge conflict in rust/kernel/block/mq/request.rs
Patch failed at 0001 rust: block: `allow(deprecated)` for `fetch_update` for Rust >= 1.99.0'
  stderr: 'error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"'

conflict:

diff --cc rust/kernel/block/mq/request.rs
index ce3e30c81cb5,1c7937653542..000000000000
--- a/rust/kernel/block/mq/request.rs
+++ b/rust/kernel/block/mq/request.rs
@@@ -229,6 -200,34 +229,37 @@@ unsafe impl<T: Operations> Send for Req
  // mutate `self` are internally synchronized`
  unsafe impl<T: Operations> Sync for Request<T> {}
  
++<<<<<<< HEAD
++=======
+ /// Store the result of `op(target.load())` in target, returning new value of
+ /// target.
+ fn atomic_relaxed_op_return(target: &AtomicU64, op: impl Fn(u64) -> u64) -> u64 {
+     #[allow(deprecated)]
+     let old = target.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |x| Some(op(x)));
+ 
+     // SAFETY: Because the operation passed to `fetch_update` above always
+     // return `Some`, `old` will always be `Ok`.
+     let old = unsafe { old.unwrap_unchecked() };
+ 
+     op(old)
+ }
+ 
+ /// Store the result of `op(target.load)` in `target` if `target.load() !=
+ /// pred`, returning [`true`] if the target was updated.
+ fn atomic_relaxed_op_unless(target: &AtomicU64, op: impl Fn(u64) -> u64, pred: u64) -> bool {
+     #[allow(deprecated)]
+     target
+         .fetch_update(Ordering::Relaxed, Ordering::Relaxed, |x| {
+             if x == pred {
+                 None
+             } else {
+                 Some(op(x))
+             }
+         })
+         .is_ok()
+ }
+ 
++>>>>>>> rust: block: `allow(deprecated)` for `fetch_update` for Rust >= 1.99.0
  // SAFETY: All instances of `Request<T>` are reference counted. This
  // implementation of `AlwaysRefCounted` ensure that increments to the ref count
  // keeps the object alive in memory at least until a matching reference count

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant