imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,42 +1,42 @@
 static int amdgpu_vmid_grab_reserved_locked(struct amdgpu_vm *vm, struct amdgpu_ring *ring, struct amdgpu_sync *sync, struct dma_fence *fence, struct amdgpu_job *job) {
   struct amdgpu_device *adev = ring->adev;
   unsigned vmhub = ring->funcs->vmhub;
   uint64_t fence_context = adev->fence_context + ring->idx;
   struct amdgpu_vmid *id = vm->reserved_vmid[vmhub];
   struct amdgpu_vmid_mgr *id_mgr = &adev->vm_manager.id_mgr[vmhub];
   struct dma_fence *updates = sync->last_vm_update;
   int r = 0;
   struct dma_fence *flushed, *tmp;
   bool needs_flush = vm->use_cpu_for_update;
   flushed = id->flushed_updates;
   if ((amdgpu_vmid_had_gpu_reset(adev, id)) || (atomic64_read(&id->owner) != vm->client_id) || (job->vm_pd_addr != id->pd_gpu_addr) || (updates && (!flushed || updates->context != flushed->context || dma_fence_is_later(updates, flushed))) || (!id->last_flush || (id->last_flush->context != fence_context && !dma_fence_is_signaled(id->last_flush)))) {
     needs_flush = true;
     /* to prevent one context starved by another context */
     id->pd_gpu_addr = 0;
     tmp = amdgpu_sync_peek_fence(&id->active, ring);
     if (tmp) {
       r = amdgpu_sync_fence(adev, sync, tmp, false);
       return r;
     }
   }
   /* Good we can use this VMID. Remember this submission as
    * user of the VMID.
    */
   r = amdgpu_sync_fence(ring->adev, &id->active, fence, false);
   if (r) goto out;
   if (updates && (!flushed || updates->context != flushed->context || dma_fence_is_later(updates, flushed))) {
     dma_fence_put(id->flushed_updates);
     id->flushed_updates = dma_fence_get(updates);
   }
   id->pd_gpu_addr = job->vm_pd_addr;
   atomic64_set(&id->owner, vm->client_id);
   job->vm_needs_flush = needs_flush;
   if (needs_flush) {
     dma_fence_put(id->last_flush);
     id->last_flush = NULL;
   }
-  job->vm_id = id - id_mgr->ids;
+  job->vmid = id - id_mgr->ids;
   trace_amdgpu_vm_grab_id(vm, ring, job);
 out:
   return r;
 }<sep>@@
struct amdgpu_job x;
@@

 x.
-   vm_id
+   vmid
--- initial
+++ final
@@ -1,20 +1,20 @@
 static struct dma_fence *amdgpu_job_dependency(struct drm_sched_job *sched_job, struct drm_sched_entity *s_entity) {
   struct amdgpu_job *job = to_amdgpu_job(sched_job);
   struct amdgpu_vm *vm = job->vm;
   bool explicit = false;
   int r;
   struct dma_fence *fence = amdgpu_sync_get_fence(&job->sync, &explicit);
   if (fence && explicit) {
     if (drm_sched_dependency_optimized(fence, s_entity)) {
       r = amdgpu_sync_fence(job->adev, &job->sched_sync, fence, false);
       if (r) DRM_ERROR("Error adding fence to sync (%d)\n", r);
     }
   }
-  while (fence == NULL && vm && !job->vm_id) {
+  while (fence == NULL && vm && !job->vmid) {
     struct amdgpu_ring *ring = job->ring;
     r = amdgpu_vmid_grab(vm, ring, &job->sync, &job->base.s_fence->finished, job);
     if (r) DRM_ERROR("Error getting VM ID (%d)\n", r);
     fence = amdgpu_sync_get_fence(&job->sync, NULL);
   }
   return fence;
 }<sep>@@
struct amdgpu_job x;
@@

 x.
-   vm_id
+   vmid
--- initial
+++ final
@@ -1,45 +1,45 @@
 int amdgpu_vm_flush(struct amdgpu_ring *ring, struct amdgpu_job *job, bool need_pipe_sync) {
   struct amdgpu_device *adev = ring->adev;
   unsigned vmhub = ring->funcs->vmhub;
   struct amdgpu_vmid_mgr *id_mgr = &adev->vm_manager.id_mgr[vmhub];
-  struct amdgpu_vmid *id = &id_mgr->ids[job->vm_id];
+  struct amdgpu_vmid *id = &id_mgr->ids[job->vmid];
   bool gds_switch_needed = ring->funcs->emit_gds_switch && (id->gds_base != job->gds_base || id->gds_size != job->gds_size || id->gws_base != job->gws_base || id->gws_size != job->gws_size || id->oa_base != job->oa_base || id->oa_size != job->oa_size);
   bool vm_flush_needed = job->vm_needs_flush;
   unsigned patch_offset = 0;
   int r;
   if (amdgpu_vmid_had_gpu_reset(adev, id)) {
     gds_switch_needed = true;
     vm_flush_needed = true;
   }
   if (!vm_flush_needed && !gds_switch_needed && !need_pipe_sync) return 0;
   if (ring->funcs->init_cond_exec) patch_offset = amdgpu_ring_init_cond_exec(ring);
   if (need_pipe_sync) amdgpu_ring_emit_pipeline_sync(ring);
   if (ring->funcs->emit_vm_flush && vm_flush_needed) {
     struct dma_fence *fence;
-    trace_amdgpu_vm_flush(ring, job->vm_id, job->vm_pd_addr);
-    amdgpu_ring_emit_vm_flush(ring, job->vm_id, job->vm_pd_addr);
+    trace_amdgpu_vm_flush(ring, job->vmid, job->vm_pd_addr);
+    amdgpu_ring_emit_vm_flush(ring, job->vmid, job->vm_pd_addr);
     r = amdgpu_fence_emit(ring, &fence);
     if (r) return r;
     mutex_lock(&id_mgr->lock);
     dma_fence_put(id->last_flush);
     id->last_flush = fence;
     id->current_gpu_reset_count = atomic_read(&adev->gpu_reset_counter);
     mutex_unlock(&id_mgr->lock);
   }
   if (ring->funcs->emit_gds_switch && gds_switch_needed) {
     id->gds_base = job->gds_base;
     id->gds_size = job->gds_size;
     id->gws_base = job->gws_base;
     id->gws_size = job->gws_size;
     id->oa_base = job->oa_base;
     id->oa_size = job->oa_size;
-    amdgpu_ring_emit_gds_switch(ring, job->vm_id, job->gds_base, job->gds_size, job->gws_base, job->gws_size, job->oa_base, job->oa_size);
+    amdgpu_ring_emit_gds_switch(ring, job->vmid, job->gds_base, job->gds_size, job->gws_base, job->gws_size, job->oa_base, job->oa_size);
   }
   if (ring->funcs->patch_cond_exec) amdgpu_ring_patch_cond_exec(ring, patch_offset);
   /* the double SWITCH_BUFFER here *cannot* be skipped by COND_EXEC */
   if (ring->funcs->emit_switch_buffer) {
     amdgpu_ring_emit_switch_buffer(ring);
     amdgpu_ring_emit_switch_buffer(ring);
   }
   return 0;
 }<sep>@@
struct amdgpu_job x;
@@

 x.
-   vm_id
+   vmid
--- initial
+++ final
@@ -1,13 +1,13 @@
 bool amdgpu_vm_need_pipeline_sync(struct amdgpu_ring *ring, struct amdgpu_job *job) {
   struct amdgpu_device *adev = ring->adev;
   unsigned vmhub = ring->funcs->vmhub;
   struct amdgpu_vmid_mgr *id_mgr = &adev->vm_manager.id_mgr[vmhub];
   struct amdgpu_vmid *id;
   bool gds_switch_needed;
   bool vm_flush_needed = job->vm_needs_flush || ring->has_compute_vm_bug;
-  if (job->vm_id == 0) return false;
-  id = &id_mgr->ids[job->vm_id];
+  if (job->vmid == 0) return false;
+  id = &id_mgr->ids[job->vmid];
   gds_switch_needed = ring->funcs->emit_gds_switch && (id->gds_base != job->gds_base || id->gds_size != job->gds_size || id->gws_base != job->gws_base || id->gws_size != job->gws_size || id->oa_base != job->oa_base || id->oa_size != job->oa_size);
   if (amdgpu_vmid_had_gpu_reset(adev, id)) return true;
   return vm_flush_needed || gds_switch_needed;
 }<sep>@@
struct amdgpu_job x;
@@

 x.
-   vm_id
+   vmid
--- initial
+++ final
@@ -1,51 +1,51 @@
 static struct nlm_host *nlm_alloc_host(struct nlm_lookup_host_info *ni, struct nsm_handle *nsm) {
   struct nlm_host *host = NULL;
   unsigned long now = jiffies;
   if (nsm != NULL)
-    atomic_inc(&nsm->sm_count);
+    refcount_inc(&nsm->sm_count);
   else {
     host = NULL;
     nsm = nsm_get_handle(ni->net, ni->sap, ni->salen, ni->hostname, ni->hostname_len);
     if (unlikely(nsm == NULL)) {
       dprintk("lockd: %s failed; no nsm handle\n", __func__);
       goto out;
     }
   }
   host = kmalloc(sizeof(*host), GFP_KERNEL);
   if (unlikely(host == NULL)) {
     dprintk("lockd: %s failed; no memory\n", __func__);
     nsm_release(nsm);
     goto out;
   }
   memcpy(nlm_addr(host), ni->sap, ni->salen);
   host->h_addrlen = ni->salen;
   rpc_set_port(nlm_addr(host), 0);
   host->h_srcaddrlen = 0;
   host->h_rpcclnt = NULL;
   host->h_name = nsm->sm_name;
   host->h_version = ni->version;
   host->h_proto = ni->protocol;
   host->h_reclaiming = 0;
   host->h_server = ni->server;
   host->h_noresvport = ni->noresvport;
   host->h_inuse = 0;
   init_waitqueue_head(&host->h_gracewait);
   init_rwsem(&host->h_rwsem);
   host->h_state = 0;
   host->h_nsmstate = 0;
   host->h_pidcount = 0;
-  atomic_set(&host->h_count, 1);
+  refcount_set(&host->h_count, 1);
   mutex_init(&host->h_mutex);
   host->h_nextrebind = now + NLM_HOST_REBIND;
   host->h_expires = now + NLM_HOST_EXPIRE;
   INIT_LIST_HEAD(&host->h_lockowners);
   spin_lock_init(&host->h_lock);
   INIT_LIST_HEAD(&host->h_granted);
   INIT_LIST_HEAD(&host->h_reclaim);
   host->h_nsmhandle = nsm;
   host->h_addrbuf = nsm->sm_addrbuf;
   host->net = ni->net;
   strlcpy(host->nodename, utsname()->nodename, sizeof(host->nodename));
 out:
   return host;
 }<sep>@r@
type T;
T *e;
identifier fld;
@@
-                       atomic_set(&e->fld, 1)
+                       refcount_set(&e->fld, 1)

@@
struct nsm_handle *e;
@@
- atomic_inc
+ refcount_inc
        (&e->sm_count)
--- initial
+++ final
@@ -1,14 +1,14 @@
 static struct nsm_handle *nsm_create_handle(const struct sockaddr *sap, const size_t salen, const char *hostname, const size_t hostname_len) {
   struct nsm_handle *new;
   new = kzalloc(sizeof(*new) + hostname_len + 1, GFP_KERNEL);
   if (unlikely(new == NULL)) return NULL;
-  atomic_set(&new->sm_count, 1);
+  refcount_set(&new->sm_count, 1);
   new->sm_name = (char *)(new + 1);
   memcpy(nsm_addr(new), sap, salen);
   new->sm_addrlen = salen;
   nsm_init_private(new);
   if (rpc_ntop(nsm_addr(new), new->sm_addrbuf, sizeof(new->sm_addrbuf)) == 0) (void)snprintf(new->sm_addrbuf, sizeof(new->sm_addrbuf), "unsupported address family");
   memcpy(new->sm_name, hostname, hostname_len);
   new->sm_name[hostname_len] = '\0';
   return new;
 }<sep>@r@
type T;
T *e;
identifier fld;
@@
-                       atomic_set(&e->fld, 1)
+                       refcount_set(&e->fld, 1)
--- initial
+++ final
@@ -1,37 +1,37 @@
 struct nsm_handle *nsm_get_handle(const struct net *net, const struct sockaddr *sap, const size_t salen, const char *hostname, const size_t hostname_len) {
   struct nsm_handle *cached, *new = NULL;
   struct lockd_net *ln = net_generic(net, lockd_net_id);
   if (hostname && memchr(hostname, '/', hostname_len) != NULL) {
     if (printk_ratelimit()) {
       printk(KERN_WARNING "Invalid hostname \"%.*s\" "
                           "in NFS lock request\n",
              (int)hostname_len, hostname);
     }
     return NULL;
   }
 retry:
   spin_lock(&nsm_lock);
   if (nsm_use_hostnames && hostname != NULL)
     cached = nsm_lookup_hostname(&ln->nsm_handles, hostname, hostname_len);
   else
     cached = nsm_lookup_addr(&ln->nsm_handles, sap);
   if (cached != NULL) {
-    atomic_inc(&cached->sm_count);
+    refcount_inc(&cached->sm_count);
     spin_unlock(&nsm_lock);
     kfree(new);
     dprintk("lockd: found nsm_handle for %s (%s), "
             "cnt %d\n",
-            cached->sm_name, cached->sm_addrbuf, atomic_read(&cached->sm_count));
+            cached->sm_name, cached->sm_addrbuf, refcount_read(&cached->sm_count));
     return cached;
   }
   if (new != NULL) {
     list_add(&new->sm_link, &ln->nsm_handles);
     spin_unlock(&nsm_lock);
     dprintk("lockd: created nsm_handle for %s (%s)\n", new->sm_name, new->sm_addrbuf);
     return new;
   }
   spin_unlock(&nsm_lock);
   new = nsm_create_handle(sap, salen, hostname, hostname_len);
   if (unlikely(new == NULL)) return NULL;
   goto retry;
 }<sep>@@
struct nsm_handle *e;
@@
- atomic_read
+ refcount_read
        (&e->sm_count)

@@
struct nsm_handle *e;
@@
- atomic_inc
+ refcount_inc
        (&e->sm_count)
--- initial
+++ final
@@ -1,15 +1,15 @@
 struct nsm_handle *nsm_reboot_lookup(const struct net *net, const struct nlm_reboot *info) {
   struct nsm_handle *cached;
   struct lockd_net *ln = net_generic(net, lockd_net_id);
   spin_lock(&nsm_lock);
   cached = nsm_lookup_priv(&ln->nsm_handles, &info->priv);
   if (unlikely(cached == NULL)) {
     spin_unlock(&nsm_lock);
     dprintk("lockd: never saw rebooted peer '%.*s' before\n", info->len, info->mon);
     return cached;
   }
-  atomic_inc(&cached->sm_count);
+  refcount_inc(&cached->sm_count);
   spin_unlock(&nsm_lock);
-  dprintk("lockd: host %s (%s) rebooted, cnt %d\n", cached->sm_name, cached->sm_addrbuf, atomic_read(&cached->sm_count));
+  dprintk("lockd: host %s (%s) rebooted, cnt %d\n", cached->sm_name, cached->sm_addrbuf, refcount_read(&cached->sm_count));
   return cached;
 }<sep>@@
struct nsm_handle *e;
@@
- atomic_read
+ refcount_read
        (&e->sm_count)

@@
struct nsm_handle *e;
@@
- atomic_inc
+ refcount_inc
        (&e->sm_count)
--- initial
+++ final
@@ -1,8 +1,8 @@
 void nsm_release(struct nsm_handle *nsm) {
-  if (atomic_dec_and_lock(&nsm->sm_count, &nsm_lock)) {
+  if (refcount_dec_and_lock(&nsm->sm_count, &nsm_lock)) {
     list_del(&nsm->sm_link);
     spin_unlock(&nsm_lock);
     dprintk("lockd: destroyed nsm_handle for %s (%s)\n", nsm->sm_name, nsm->sm_addrbuf);
     kfree(nsm);
   }
 }<sep>@@
struct nsm_handle *e;
expression e1;
@@
- atomic_dec_and_lock
+ refcount_dec_and_lock
        (&e->sm_count,e1)
--- initial
+++ final
@@ -1,14 +1,14 @@
 void nsm_unmonitor(const struct nlm_host *host) {
   struct nsm_handle *nsm = host->h_nsmhandle;
   struct nsm_res res;
   int status;
-  if (atomic_read(&nsm->sm_count) == 1 && nsm->sm_monitored && !nsm->sm_sticky) {
+  if (refcount_read(&nsm->sm_count) == 1 && nsm->sm_monitored && !nsm->sm_sticky) {
     dprintk("lockd: nsm_unmonitor(%s)\n", nsm->sm_name);
     status = nsm_mon_unmon(nsm, NSMPROC_UNMON, &res, host);
     if (res.status != 0) status = -EIO;
     if (status < 0)
       printk(KERN_NOTICE "lockd: cannot unmonitor %s\n", nsm->sm_name);
     else
       nsm->sm_monitored = 0;
   }
 }<sep>@@
struct nsm_handle *e;
@@
- atomic_read
+ refcount_read
        (&e->sm_count)
--- initial
+++ final
@@ -1,51 +1,51 @@
 static struct nlm_host *nlm_alloc_host(struct nlm_lookup_host_info *ni, struct nsm_handle *nsm) {
   struct nlm_host *host = NULL;
   unsigned long now = jiffies;
   if (nsm != NULL)
-    atomic_inc(&nsm->sm_count);
+    refcount_inc(&nsm->sm_count);
   else {
     host = NULL;
     nsm = nsm_get_handle(ni->net, ni->sap, ni->salen, ni->hostname, ni->hostname_len);
     if (unlikely(nsm == NULL)) {
       dprintk("lockd: %s failed; no nsm handle\n", __func__);
       goto out;
     }
   }
   host = kmalloc(sizeof(*host), GFP_KERNEL);
   if (unlikely(host == NULL)) {
     dprintk("lockd: %s failed; no memory\n", __func__);
     nsm_release(nsm);
     goto out;
   }
   memcpy(nlm_addr(host), ni->sap, ni->salen);
   host->h_addrlen = ni->salen;
   rpc_set_port(nlm_addr(host), 0);
   host->h_srcaddrlen = 0;
   host->h_rpcclnt = NULL;
   host->h_name = nsm->sm_name;
   host->h_version = ni->version;
   host->h_proto = ni->protocol;
   host->h_reclaiming = 0;
   host->h_server = ni->server;
   host->h_noresvport = ni->noresvport;
   host->h_inuse = 0;
   init_waitqueue_head(&host->h_gracewait);
   init_rwsem(&host->h_rwsem);
   host->h_state = 0;
   host->h_nsmstate = 0;
   host->h_pidcount = 0;
   refcount_set(&host->h_count, 1);
   mutex_init(&host->h_mutex);
   host->h_nextrebind = now + NLM_HOST_REBIND;
   host->h_expires = now + NLM_HOST_EXPIRE;
   INIT_LIST_HEAD(&host->h_lockowners);
   spin_lock_init(&host->h_lock);
   INIT_LIST_HEAD(&host->h_granted);
   INIT_LIST_HEAD(&host->h_reclaim);
   host->h_nsmhandle = nsm;
   host->h_addrbuf = nsm->sm_addrbuf;
   host->net = ni->net;
   strlcpy(host->nodename, utsname()->nodename, sizeof(host->nodename));
 out:
   return host;
 }<sep>@@
struct nsm_handle *e;
@@
- atomic_inc
+ refcount_inc
        (&e->sm_count)
--- initial
+++ final
@@ -1,17 +1,17 @@
 struct nlm_rqst *nlm_alloc_call(struct nlm_host *host) {
   struct nlm_rqst *call;
   for (;;) {
     call = kzalloc(sizeof(*call), GFP_KERNEL);
     if (call != NULL) {
-      atomic_set(&call->a_count, 1);
+      refcount_set(&call->a_count, 1);
       locks_init_lock(&call->a_args.lock.fl);
       locks_init_lock(&call->a_res.lock.fl);
       call->a_host = nlm_get_host(host);
       return call;
     }
     if (signalled()) break;
     printk("nlm_alloc_call: failed, waiting for memory\n");
     schedule_timeout_interruptible(5 * HZ);
   }
   return NULL;
 }<sep>@r@
type T;
T *e;
identifier fld;
@@
-                       atomic_set(&e->fld, 1)
+                       refcount_set(&e->fld, 1)
--- initial
+++ final
@@ -1,16 +1,16 @@
 static int nlmclnt_cancel(struct nlm_host *host, int block, struct file_lock *fl) {
   struct nlm_rqst *req;
   int status;
   dprintk("lockd: blocking lock attempt was interrupted by a signal.\n"
           "       Attempting to cancel lock.\n");
   req = nlm_alloc_call(host);
   if (!req) return -ENOMEM;
   req->a_flags = RPC_TASK_ASYNC;
   nlmclnt_setlockargs(req, fl);
   req->a_args.block = block;
-  atomic_inc(&req->a_count);
+  refcount_inc(&req->a_count);
   status = nlmclnt_async_call(nfs_file_cred(fl->fl_file), req, NLMPROC_CANCEL, &nlmclnt_cancel_ops);
   if (status == 0 && req->a_res.status == nlm_lck_denied) status = -ENOLCK;
   nlmclnt_release_call(req);
   return status;
 }<sep>@@
struct nlm_rqst *e;
@@
- atomic_inc
+ refcount_inc
        (&e->a_count)
--- initial
+++ final
@@ -1,8 +1,8 @@
 void nlmclnt_release_call(struct nlm_rqst *call) {
   const struct nlmclnt_operations *nlmclnt_ops = call->a_host->h_nlmclnt_ops;
-  if (!atomic_dec_and_test(&call->a_count)) return;
+  if (!refcount_dec_and_test(&call->a_count)) return;
   if (nlmclnt_ops && nlmclnt_ops->nlmclnt_release_call) nlmclnt_ops->nlmclnt_release_call(call->a_callback_data);
   nlmclnt_release_host(call->a_host);
   nlmclnt_release_lockargs(call);
   kfree(call);
 }<sep>@@
struct nlm_rqst *e;
@@
- atomic_dec_and_test
+ refcount_dec_and_test
        (&e->a_count)
--- initial
+++ final
@@ -1,30 +1,30 @@
 static int nlmclnt_unlock(struct nlm_rqst *req, struct file_lock *fl) {
   struct nlm_host *host = req->a_host;
   struct nlm_res *resp = &req->a_res;
   int status;
   unsigned char fl_flags = fl->fl_flags;
   /*
    * Note: the server is supposed to either grant us the unlock
    * request, or to deny it with NLM_LCK_DENIED_GRACE_PERIOD. In either
    * case, we want to unlock.
    */
   fl->fl_flags |= FL_EXISTS;
   down_read(&host->h_rwsem);
   status = do_vfs_lock(fl);
   up_read(&host->h_rwsem);
   fl->fl_flags = fl_flags;
   if (status == -ENOENT) {
     status = 0;
     goto out;
   }
-  atomic_inc(&req->a_count);
+  refcount_inc(&req->a_count);
   status = nlmclnt_async_call(nfs_file_cred(fl->fl_file), req, NLMPROC_UNLOCK, &nlmclnt_unlock_ops);
   if (status < 0) goto out;
   if (resp->status == nlm_granted) goto out;
   if (resp->status != nlm_lck_denied_nolocks) printk("lockd: unexpected unlock status: %d\n", ntohl(resp->status));
   /* What to do now? I'm out of my depth... */
   status = -ENOLCK;
 out:
   nlmclnt_release_call(req);
   return status;
 }<sep>@@
struct nlm_rqst *e;
@@
- atomic_inc
+ refcount_inc
        (&e->a_count)
--- initial
+++ final
@@ -1,5 +1,5 @@
 void nlmsvc_release_call(struct nlm_rqst *call) {
-  if (!atomic_dec_and_test(&call->a_count)) return;
+  if (!refcount_dec_and_test(&call->a_count)) return;
   nlmsvc_release_host(call->a_host);
   kfree(call);
 }<sep>@@
struct nlm_rqst *e;
@@
- atomic_dec_and_test
+ refcount_dec_and_test
        (&e->a_count)
--- initial
+++ final
@@ -1,9 +1,9 @@
 static struct posix_acl *f2fs_acl_clone(const struct posix_acl *acl, gfp_t flags) {
   struct posix_acl *clone = NULL;
   if (acl) {
     int size = sizeof(struct posix_acl) + acl->a_count * sizeof(struct posix_acl_entry);
     clone = kmemdup(acl, size, flags);
-    if (clone) atomic_set(&clone->a_refcount, 1);
+    if (clone) refcount_set(&clone->a_refcount, 1);
   }
   return clone;
 }<sep>@r@
type T;
T *e;
identifier fld;
@@
-                       atomic_set(&e->fld, 1)
+                       refcount_set(&e->fld, 1)
--- initial
+++ final
@@ -1,13 +1,13 @@
 struct posix_acl *get_cached_acl(struct inode *inode, int type) {
   struct posix_acl **p = acl_by_type(inode, type);
   struct posix_acl *acl;
   for (;;) {
     rcu_read_lock();
     acl = rcu_dereference(*p);
-    if (!acl || is_uncached_acl(acl) || atomic_inc_not_zero(&acl->a_refcount)) break;
+    if (!acl || is_uncached_acl(acl) || refcount_inc_not_zero(&acl->a_refcount)) break;
     rcu_read_unlock();
     cpu_relax();
   }
   rcu_read_unlock();
   return acl;
 }<sep>@@
struct posix_acl *e;
@@
- atomic_inc_not_zero
+ refcount_inc_not_zero
        (&e->a_refcount)
--- initial
+++ final
@@ -1,9 +1,9 @@
 static struct posix_acl *posix_acl_clone(const struct posix_acl *acl, gfp_t flags) {
   struct posix_acl *clone = NULL;
   if (acl) {
     int size = sizeof(struct posix_acl) + acl->a_count * sizeof(struct posix_acl_entry);
     clone = kmemdup(acl, size, flags);
-    if (clone) atomic_set(&clone->a_refcount, 1);
+    if (clone) refcount_set(&clone->a_refcount, 1);
   }
   return clone;
 }<sep>@r@
type T;
T *e;
identifier fld;
@@
-                       atomic_set(&e->fld, 1)
+                       refcount_set(&e->fld, 1)
--- initial
+++ final
@@ -1,4 +1,4 @@
 void posix_acl_init(struct posix_acl *acl, int count) {
-  atomic_set(&acl->a_refcount, 1);
+  refcount_set(&acl->a_refcount, 1);
   acl->a_count = count;
 }<sep>@r@
type T;
T *e;
identifier fld;
@@
-                       atomic_set(&e->fld, 1)
+                       refcount_set(&e->fld, 1)
--- initial
+++ final
@@ -1,12 +1,12 @@
 static struct lcs_reply *lcs_alloc_reply(struct lcs_cmd *cmd) {
   struct lcs_reply *reply;
   LCS_DBF_TEXT(4, trace, "getreply");
   reply = kzalloc(sizeof(struct lcs_reply), GFP_ATOMIC);
   if (!reply) return NULL;
-  atomic_set(&reply->refcnt, 1);
+  refcount_set(&reply->refcnt, 1);
   reply->sequence_no = cmd->sequence_no;
   reply->received = 0;
   reply->rc = 0;
   init_waitqueue_head(&reply->wait_q);
   return reply;
 }<sep>@r@
type T;
T *e;
identifier fld;
@@
-                       atomic_set(&e->fld, 1)
+                       refcount_set(&e->fld, 1)
--- initial
+++ final
@@ -1,10 +1,10 @@
 static struct qeth_reply *qeth_alloc_reply(struct qeth_card *card) {
   struct qeth_reply *reply;
   reply = kzalloc(sizeof(struct qeth_reply), GFP_ATOMIC);
   if (reply) {
-    atomic_set(&reply->refcnt, 1);
+    refcount_set(&reply->refcnt, 1);
     atomic_set(&reply->received, 0);
     reply->card = card;
   }
   return reply;
 }<sep>@r@
type T;
T *e;
identifier fld;
@@
-                       atomic_set(&e->fld, 1)
+                       refcount_set(&e->fld, 1)
--- initial
+++ final
@@ -1,10 +1,7 @@
 static void xfs_allocbt_read_verify(struct xfs_buf *bp) {
   if (!xfs_btree_sblock_verify_crc(bp))
-    xfs_buf_ioerror(bp, -EFSBADCRC);
+    xfs_verifier_error(bp, -EFSBADCRC);
   else if (!xfs_allocbt_verify(bp))
-    xfs_buf_ioerror(bp, -EFSCORRUPTED);
-  if (bp->b_error) {
-    trace_xfs_btree_corrupt(bp, _RET_IP_);
-    xfs_verifier_error(bp);
-  }
+    xfs_verifier_error(bp, -EFSCORRUPTED);
+  if (bp->b_error) trace_xfs_btree_corrupt(bp, _RET_IP_);
 }<sep>@@
expression bp;
statement S;
@@

	if (...)
-               xfs_buf_ioerror(bp, -EFSBADCRC);
+               xfs_verifier_error(bp, -EFSBADCRC);
        else if (...)
-               xfs_buf_ioerror(bp, -EFSCORRUPTED);
+               xfs_verifier_error(bp, -EFSCORRUPTED);
-
       if (bp->b_error)
- {
		S
-               xfs_verifier_error(bp);
- }
--- initial
+++ final
@@ -1,9 +1,8 @@
 static void xfs_allocbt_write_verify(struct xfs_buf *bp) {
   if (!xfs_allocbt_verify(bp)) {
     trace_xfs_btree_corrupt(bp, _RET_IP_);
-    xfs_buf_ioerror(bp, -EFSCORRUPTED);
-    xfs_verifier_error(bp);
+    xfs_verifier_error(bp, -EFSCORRUPTED);
     return;
   }
   xfs_btree_sblock_calc_crc(bp);
 }<sep>@@
expression bp,e;
@@

-               xfs_buf_ioerror(bp, e);
-               xfs_verifier_error(bp);
+               xfs_verifier_error(bp, e);
--- initial
+++ final
@@ -1,8 +1,7 @@
 static void xfs_agf_read_verify(struct xfs_buf *bp) {
   struct xfs_mount *mp = bp->b_target->bt_mount;
   if (xfs_sb_version_hascrc(&mp->m_sb) && !xfs_buf_verify_cksum(bp, XFS_AGF_CRC_OFF))
-    xfs_buf_ioerror(bp, -EFSBADCRC);
+    xfs_verifier_error(bp, -EFSBADCRC);
   else if (XFS_TEST_ERROR(!xfs_agf_verify(mp, bp), mp, XFS_ERRTAG_ALLOC_READ_AGF))
-    xfs_buf_ioerror(bp, -EFSCORRUPTED);
-  if (bp->b_error) xfs_verifier_error(bp);
+    xfs_verifier_error(bp, -EFSCORRUPTED);
 }<sep>@@
expression bp;
@@

	if (...)
-               xfs_buf_ioerror(bp, -EFSBADCRC);
+               xfs_verifier_error(bp, -EFSBADCRC);
        else if (...)
-               xfs_buf_ioerror(bp, -EFSCORRUPTED);
-
-       if (bp->b_error)
-               xfs_verifier_error(bp);
+               xfs_verifier_error(bp, -EFSCORRUPTED);