imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,21 +1,21 @@
 static int tcf_csum_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) {
   unsigned char *b = skb_tail_pointer(skb);
   struct tcf_csum *p = to_tcf_csum(a);
   struct tcf_csum_params *params;
   struct tc_csum opt = {
       .index = p->tcf_index,
-      .refcnt = p->tcf_refcnt - ref,
-      .bindcnt = p->tcf_bindcnt - bind,
+      .refcnt = refcount_read(&p->tcf_refcnt) - ref,
+      .bindcnt = atomic_read(&p->tcf_bindcnt) - bind,
   };
   struct tcf_t t;
   params = rtnl_dereference(p->params);
   opt.action = params->action;
   opt.update_flags = params->update_flags;
   if (nla_put(skb, TCA_CSUM_PARMS, sizeof(opt), &opt)) goto nla_put_failure;
   tcf_tm_dump(&t, &p->tcf_tm);
   if (nla_put_64bit(skb, TCA_CSUM_TM, sizeof(t), &t, TCA_CSUM_PAD)) goto nla_put_failure;
   return skb->len;
 nla_put_failure:
   nlmsg_trim(skb, b);
   return -1;
 }<sep>@@
expression p;
@@

- p->tcf_bindcnt
+ atomic_read(&p->tcf_bindcnt)




@@
expression p;
@@

- p->tcf_refcnt
+ refcount_read(&p->tcf_refcnt)
--- initial
+++ final
@@ -1,28 +1,28 @@
 static int tcf_gact_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) {
   unsigned char *b = skb_tail_pointer(skb);
   struct tcf_gact *gact = to_gact(a);
   struct tc_gact opt = {
       .index = gact->tcf_index,
-      .refcnt = gact->tcf_refcnt - ref,
-      .bindcnt = gact->tcf_bindcnt - bind,
+      .refcnt = refcount_read(&gact->tcf_refcnt) - ref,
+      .bindcnt = atomic_read(&gact->tcf_bindcnt) - bind,
       .action = gact->tcf_action,
   };
   struct tcf_t t;
   if (nla_put(skb, TCA_GACT_PARMS, sizeof(opt), &opt)) goto nla_put_failure;
 #ifdef CONFIG_GACT_PROB
   if (gact->tcfg_ptype) {
     struct tc_gact_p p_opt = {
         .paction = gact->tcfg_paction,
         .pval = gact->tcfg_pval,
         .ptype = gact->tcfg_ptype,
     };
     if (nla_put(skb, TCA_GACT_PROB, sizeof(p_opt), &p_opt)) goto nla_put_failure;
   }
 #endif
   tcf_tm_dump(&t, &gact->tcf_tm);
   if (nla_put_64bit(skb, TCA_GACT_TM, sizeof(t), &t, TCA_GACT_PAD)) goto nla_put_failure;
   return skb->len;
 nla_put_failure:
   nlmsg_trim(skb, b);
   return -1;
 }<sep>@@
expression p;
@@

- p->tcf_bindcnt
+ atomic_read(&p->tcf_bindcnt)




@@
expression p;
@@

- p->tcf_refcnt
+ refcount_read(&p->tcf_refcnt)
--- initial
+++ final
@@ -1,31 +1,31 @@
 static int tcf_ife_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) {
   unsigned char *b = skb_tail_pointer(skb);
   struct tcf_ife_info *ife = to_ife(a);
   struct tcf_ife_params *p = rtnl_dereference(ife->params);
   struct tc_ife opt = {
       .index = ife->tcf_index,
-      .refcnt = ife->tcf_refcnt - ref,
-      .bindcnt = ife->tcf_bindcnt - bind,
+      .refcnt = refcount_read(&ife->tcf_refcnt) - ref,
+      .bindcnt = atomic_read(&ife->tcf_bindcnt) - bind,
       .action = ife->tcf_action,
       .flags = p->flags,
   };
   struct tcf_t t;
   if (nla_put(skb, TCA_IFE_PARMS, sizeof(opt), &opt)) goto nla_put_failure;
   tcf_tm_dump(&t, &ife->tcf_tm);
   if (nla_put_64bit(skb, TCA_IFE_TM, sizeof(t), &t, TCA_IFE_PAD)) goto nla_put_failure;
   if (!is_zero_ether_addr(p->eth_dst)) {
     if (nla_put(skb, TCA_IFE_DMAC, ETH_ALEN, p->eth_dst)) goto nla_put_failure;
   }
   if (!is_zero_ether_addr(p->eth_src)) {
     if (nla_put(skb, TCA_IFE_SMAC, ETH_ALEN, p->eth_src)) goto nla_put_failure;
   }
   if (nla_put(skb, TCA_IFE_TYPE, 2, &p->eth_type)) goto nla_put_failure;
   if (dump_metalist(skb, ife)) {
     /*ignore failure to dump metalist */
     pr_info("Failed to dump metalist\n");
   }
   return skb->len;
 nla_put_failure:
   nlmsg_trim(skb, b);
   return -1;
 }<sep>@@
expression p;
@@

- p->tcf_bindcnt
+ atomic_read(&p->tcf_bindcnt)




@@
expression p;
@@

- p->tcf_refcnt
+ refcount_read(&p->tcf_refcnt)
--- initial
+++ final
@@ -1,25 +1,25 @@
 static int tcf_ipt_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) {
   unsigned char *b = skb_tail_pointer(skb);
   struct tcf_ipt *ipt = to_ipt(a);
   struct xt_entry_target *t;
   struct tcf_t tm;
   struct tc_cnt c;
   /* for simple targets kernel size == user size
    * user name = target name
    * for foolproof you need to not assume this
    */
   t = kmemdup(ipt->tcfi_t, ipt->tcfi_t->u.user.target_size, GFP_ATOMIC);
   if (unlikely(!t)) goto nla_put_failure;
-  c.bindcnt = ipt->tcf_bindcnt - bind;
-  c.refcnt = ipt->tcf_refcnt - ref;
+  c.bindcnt = atomic_read(&ipt->tcf_bindcnt) - bind;
+  c.refcnt = refcount_read(&ipt->tcf_refcnt) - ref;
   strcpy(t->u.user.name, ipt->tcfi_t->u.kernel.target->name);
   if (nla_put(skb, TCA_IPT_TARG, ipt->tcfi_t->u.user.target_size, t) || nla_put_u32(skb, TCA_IPT_INDEX, ipt->tcf_index) || nla_put_u32(skb, TCA_IPT_HOOK, ipt->tcfi_hook) || nla_put(skb, TCA_IPT_CNT, sizeof(struct tc_cnt), &c) || nla_put_string(skb, TCA_IPT_TABLE, ipt->tcfi_tname)) goto nla_put_failure;
   tcf_tm_dump(&tm, &ipt->tcf_tm);
   if (nla_put_64bit(skb, TCA_IPT_TM, sizeof(tm), &tm, TCA_IPT_PAD)) goto nla_put_failure;
   kfree(t);
   return skb->len;
 nla_put_failure:
   nlmsg_trim(skb, b);
   kfree(t);
   return -1;
 }<sep>@@
expression p;
@@

- p->tcf_bindcnt
+ atomic_read(&p->tcf_bindcnt)




@@
expression p;
@@

- p->tcf_refcnt
+ refcount_read(&p->tcf_refcnt)
--- initial
+++ final
@@ -1,21 +1,21 @@
 static int tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) {
   unsigned char *b = skb_tail_pointer(skb);
   struct tcf_mirred *m = to_mirred(a);
   struct net_device *dev = rtnl_dereference(m->tcfm_dev);
   struct tc_mirred opt = {
       .index = m->tcf_index,
       .action = m->tcf_action,
-      .refcnt = m->tcf_refcnt - ref,
-      .bindcnt = m->tcf_bindcnt - bind,
+      .refcnt = refcount_read(&m->tcf_refcnt) - ref,
+      .bindcnt = atomic_read(&m->tcf_bindcnt) - bind,
       .eaction = m->tcfm_eaction,
       .ifindex = dev ? dev->ifindex : 0,
   };
   struct tcf_t t;
   if (nla_put(skb, TCA_MIRRED_PARMS, sizeof(opt), &opt)) goto nla_put_failure;
   tcf_tm_dump(&t, &m->tcf_tm);
   if (nla_put_64bit(skb, TCA_MIRRED_TM, sizeof(t), &t, TCA_MIRRED_PAD)) goto nla_put_failure;
   return skb->len;
 nla_put_failure:
   nlmsg_trim(skb, b);
   return -1;
 }<sep>@@
expression p;
@@

- p->tcf_bindcnt
+ atomic_read(&p->tcf_bindcnt)




@@
expression p;
@@

- p->tcf_refcnt
+ refcount_read(&p->tcf_refcnt)
--- initial
+++ final
@@ -1,22 +1,22 @@
 static int tcf_nat_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) {
   unsigned char *b = skb_tail_pointer(skb);
   struct tcf_nat *p = to_tcf_nat(a);
   struct tc_nat opt = {
       .old_addr = p->old_addr,
       .new_addr = p->new_addr,
       .mask = p->mask,
       .flags = p->flags,
       .index = p->tcf_index,
       .action = p->tcf_action,
-      .refcnt = p->tcf_refcnt - ref,
-      .bindcnt = p->tcf_bindcnt - bind,
+      .refcnt = refcount_read(&p->tcf_refcnt) - ref,
+      .bindcnt = atomic_read(&p->tcf_bindcnt) - bind,
   };
   struct tcf_t t;
   if (nla_put(skb, TCA_NAT_PARMS, sizeof(opt), &opt)) goto nla_put_failure;
   tcf_tm_dump(&t, &p->tcf_tm);
   if (nla_put_64bit(skb, TCA_NAT_TM, sizeof(t), &t, TCA_NAT_PAD)) goto nla_put_failure;
   return skb->len;
 nla_put_failure:
   nlmsg_trim(skb, b);
   return -1;
 }<sep>@@
expression p;
@@

- p->tcf_bindcnt
+ atomic_read(&p->tcf_bindcnt)




@@
expression p;
@@

- p->tcf_refcnt
+ refcount_read(&p->tcf_refcnt)
--- initial
+++ final
@@ -1,32 +1,32 @@
 static int tcf_pedit_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) {
   unsigned char *b = skb_tail_pointer(skb);
   struct tcf_pedit *p = to_pedit(a);
   struct tc_pedit *opt;
   struct tcf_t t;
   int s;
   s = sizeof(*opt) + p->tcfp_nkeys * sizeof(struct tc_pedit_key);
   /* netlink spinlocks held above us - must use ATOMIC */
   opt = kzalloc(s, GFP_ATOMIC);
   if (unlikely(!opt)) return -ENOBUFS;
   memcpy(opt->keys, p->tcfp_keys, p->tcfp_nkeys * sizeof(struct tc_pedit_key));
   opt->index = p->tcf_index;
   opt->nkeys = p->tcfp_nkeys;
   opt->flags = p->tcfp_flags;
   opt->action = p->tcf_action;
-  opt->refcnt = p->tcf_refcnt - ref;
-  opt->bindcnt = p->tcf_bindcnt - bind;
+  opt->refcnt = refcount_read(&p->tcf_refcnt) - ref;
+  opt->bindcnt = atomic_read(&p->tcf_bindcnt) - bind;
   if (p->tcfp_keys_ex) {
     tcf_pedit_key_ex_dump(skb, p->tcfp_keys_ex, p->tcfp_nkeys);
     if (nla_put(skb, TCA_PEDIT_PARMS_EX, s, opt)) goto nla_put_failure;
   } else {
     if (nla_put(skb, TCA_PEDIT_PARMS, s, opt)) goto nla_put_failure;
   }
   tcf_tm_dump(&t, &p->tcf_tm);
   if (nla_put_64bit(skb, TCA_PEDIT_TM, sizeof(t), &t, TCA_PEDIT_PAD)) goto nla_put_failure;
   kfree(opt);
   return skb->len;
 nla_put_failure:
   nlmsg_trim(skb, b);
   kfree(opt);
   return -1;
 }<sep>@@
expression p;
@@

- p->tcf_bindcnt
+ atomic_read(&p->tcf_bindcnt)




@@
expression p;
@@

- p->tcf_refcnt
+ refcount_read(&p->tcf_refcnt)
--- initial
+++ final
@@ -1,27 +1,27 @@
 static int tcf_act_police_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) {
   unsigned char *b = skb_tail_pointer(skb);
   struct tcf_police *police = to_police(a);
   struct tc_police opt = {
       .index = police->tcf_index,
       .action = police->tcf_action,
       .mtu = police->tcfp_mtu,
       .burst = PSCHED_NS2TICKS(police->tcfp_burst),
-      .refcnt = police->tcf_refcnt - ref,
-      .bindcnt = police->tcf_bindcnt - bind,
+      .refcnt = refcount_read(&police->tcf_refcnt) - ref,
+      .bindcnt = atomic_read(&police->tcf_bindcnt) - bind,
   };
   struct tcf_t t;
   if (police->rate_present) psched_ratecfg_getrate(&opt.rate, &police->rate);
   if (police->peak_present) psched_ratecfg_getrate(&opt.peakrate, &police->peak);
   if (nla_put(skb, TCA_POLICE_TBF, sizeof(opt), &opt)) goto nla_put_failure;
   if (police->tcfp_result && nla_put_u32(skb, TCA_POLICE_RESULT, police->tcfp_result)) goto nla_put_failure;
   if (police->tcfp_ewma_rate && nla_put_u32(skb, TCA_POLICE_AVRATE, police->tcfp_ewma_rate)) goto nla_put_failure;
   t.install = jiffies_to_clock_t(jiffies - police->tcf_tm.install);
   t.lastuse = jiffies_to_clock_t(jiffies - police->tcf_tm.lastuse);
   t.firstuse = jiffies_to_clock_t(jiffies - police->tcf_tm.firstuse);
   t.expires = jiffies_to_clock_t(police->tcf_tm.expires);
   if (nla_put_64bit(skb, TCA_POLICE_TM, sizeof(t), &t, TCA_POLICE_PAD)) goto nla_put_failure;
   return skb->len;
 nla_put_failure:
   nlmsg_trim(skb, b);
   return -1;
 }<sep>@@
expression p;
@@

- p->tcf_bindcnt
+ atomic_read(&p->tcf_bindcnt)




@@
expression p;
@@

- p->tcf_refcnt
+ refcount_read(&p->tcf_refcnt)
--- initial
+++ final
@@ -1,22 +1,22 @@
 static int tcf_sample_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) {
   unsigned char *b = skb_tail_pointer(skb);
   struct tcf_sample *s = to_sample(a);
   struct tc_sample opt = {
       .index = s->tcf_index,
       .action = s->tcf_action,
-      .refcnt = s->tcf_refcnt - ref,
-      .bindcnt = s->tcf_bindcnt - bind,
+      .refcnt = refcount_read(&s->tcf_refcnt) - ref,
+      .bindcnt = atomic_read(&s->tcf_bindcnt) - bind,
   };
   struct tcf_t t;
   if (nla_put(skb, TCA_SAMPLE_PARMS, sizeof(opt), &opt)) goto nla_put_failure;
   tcf_tm_dump(&t, &s->tcf_tm);
   if (nla_put_64bit(skb, TCA_SAMPLE_TM, sizeof(t), &t, TCA_SAMPLE_PAD)) goto nla_put_failure;
   if (nla_put_u32(skb, TCA_SAMPLE_RATE, s->rate)) goto nla_put_failure;
   if (s->truncate)
     if (nla_put_u32(skb, TCA_SAMPLE_TRUNC_SIZE, s->trunc_size)) goto nla_put_failure;
   if (nla_put_u32(skb, TCA_SAMPLE_PSAMPLE_GROUP, s->psample_group_num)) goto nla_put_failure;
   return skb->len;
 nla_put_failure:
   nlmsg_trim(skb, b);
   return -1;
 }<sep>@@
expression p;
@@

- p->tcf_bindcnt
+ atomic_read(&p->tcf_bindcnt)




@@
expression p;
@@

- p->tcf_refcnt
+ refcount_read(&p->tcf_refcnt)
--- initial
+++ final
@@ -1,18 +1,18 @@
 static int tcf_simp_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) {
   unsigned char *b = skb_tail_pointer(skb);
   struct tcf_defact *d = to_defact(a);
   struct tc_defact opt = {
       .index = d->tcf_index,
-      .refcnt = d->tcf_refcnt - ref,
-      .bindcnt = d->tcf_bindcnt - bind,
+      .refcnt = refcount_read(&d->tcf_refcnt) - ref,
+      .bindcnt = atomic_read(&d->tcf_bindcnt) - bind,
       .action = d->tcf_action,
   };
   struct tcf_t t;
   if (nla_put(skb, TCA_DEF_PARMS, sizeof(opt), &opt) || nla_put_string(skb, TCA_DEF_DATA, d->tcfd_defdata)) goto nla_put_failure;
   tcf_tm_dump(&t, &d->tcf_tm);
   if (nla_put_64bit(skb, TCA_DEF_TM, sizeof(t), &t, TCA_DEF_PAD)) goto nla_put_failure;
   return skb->len;
 nla_put_failure:
   nlmsg_trim(skb, b);
   return -1;
 }<sep>@@
expression p;
@@

- p->tcf_bindcnt
+ atomic_read(&p->tcf_bindcnt)




@@
expression p;
@@

- p->tcf_refcnt
+ refcount_read(&p->tcf_refcnt)
--- initial
+++ final
@@ -1,26 +1,26 @@
 static int tcf_skbedit_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) {
   unsigned char *b = skb_tail_pointer(skb);
   struct tcf_skbedit *d = to_skbedit(a);
   struct tc_skbedit opt = {
       .index = d->tcf_index,
-      .refcnt = d->tcf_refcnt - ref,
-      .bindcnt = d->tcf_bindcnt - bind,
+      .refcnt = refcount_read(&d->tcf_refcnt) - ref,
+      .bindcnt = atomic_read(&d->tcf_bindcnt) - bind,
       .action = d->tcf_action,
   };
   struct tcf_t t;
   u64 pure_flags = 0;
   if (nla_put(skb, TCA_SKBEDIT_PARMS, sizeof(opt), &opt)) goto nla_put_failure;
   if ((d->flags & SKBEDIT_F_PRIORITY) && nla_put_u32(skb, TCA_SKBEDIT_PRIORITY, d->priority)) goto nla_put_failure;
   if ((d->flags & SKBEDIT_F_QUEUE_MAPPING) && nla_put_u16(skb, TCA_SKBEDIT_QUEUE_MAPPING, d->queue_mapping)) goto nla_put_failure;
   if ((d->flags & SKBEDIT_F_MARK) && nla_put_u32(skb, TCA_SKBEDIT_MARK, d->mark)) goto nla_put_failure;
   if ((d->flags & SKBEDIT_F_PTYPE) && nla_put_u16(skb, TCA_SKBEDIT_PTYPE, d->ptype)) goto nla_put_failure;
   if ((d->flags & SKBEDIT_F_MASK) && nla_put_u32(skb, TCA_SKBEDIT_MASK, d->mask)) goto nla_put_failure;
   if (d->flags & SKBEDIT_F_INHERITDSFIELD) pure_flags |= SKBEDIT_F_INHERITDSFIELD;
   if (pure_flags != 0 && nla_put(skb, TCA_SKBEDIT_FLAGS, sizeof(pure_flags), &pure_flags)) goto nla_put_failure;
   tcf_tm_dump(&t, &d->tcf_tm);
   if (nla_put_64bit(skb, TCA_SKBEDIT_TM, sizeof(t), &t, TCA_SKBEDIT_PAD)) goto nla_put_failure;
   return skb->len;
 nla_put_failure:
   nlmsg_trim(skb, b);
   return -1;
 }<sep>@@
expression p;
@@

- p->tcf_bindcnt
+ atomic_read(&p->tcf_bindcnt)




@@
expression p;
@@

- p->tcf_refcnt
+ refcount_read(&p->tcf_refcnt)
--- initial
+++ final
@@ -1,23 +1,23 @@
 static int tcf_skbmod_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) {
   struct tcf_skbmod *d = to_skbmod(a);
   unsigned char *b = skb_tail_pointer(skb);
   struct tcf_skbmod_params *p = rtnl_dereference(d->skbmod_p);
   struct tc_skbmod opt = {
       .index = d->tcf_index,
-      .refcnt = d->tcf_refcnt - ref,
-      .bindcnt = d->tcf_bindcnt - bind,
+      .refcnt = refcount_read(&d->tcf_refcnt) - ref,
+      .bindcnt = atomic_read(&d->tcf_bindcnt) - bind,
       .action = d->tcf_action,
   };
   struct tcf_t t;
   opt.flags = p->flags;
   if (nla_put(skb, TCA_SKBMOD_PARMS, sizeof(opt), &opt)) goto nla_put_failure;
   if ((p->flags & SKBMOD_F_DMAC) && nla_put(skb, TCA_SKBMOD_DMAC, ETH_ALEN, p->eth_dst)) goto nla_put_failure;
   if ((p->flags & SKBMOD_F_SMAC) && nla_put(skb, TCA_SKBMOD_SMAC, ETH_ALEN, p->eth_src)) goto nla_put_failure;
   if ((p->flags & SKBMOD_F_ETYPE) && nla_put_u16(skb, TCA_SKBMOD_ETYPE, ntohs(p->eth_type))) goto nla_put_failure;
   tcf_tm_dump(&t, &d->tcf_tm);
   if (nla_put_64bit(skb, TCA_SKBMOD_TM, sizeof(t), &t, TCA_SKBMOD_PAD)) goto nla_put_failure;
   return skb->len;
 nla_put_failure:
   nlmsg_trim(skb, b);
   return -1;
 }<sep>@@
expression p;
@@

- p->tcf_bindcnt
+ atomic_read(&p->tcf_bindcnt)




@@
expression p;
@@

- p->tcf_refcnt
+ refcount_read(&p->tcf_refcnt)
--- initial
+++ final
@@ -1,27 +1,27 @@
 static int tunnel_key_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) {
   unsigned char *b = skb_tail_pointer(skb);
   struct tcf_tunnel_key *t = to_tunnel_key(a);
   struct tcf_tunnel_key_params *params;
   struct tc_tunnel_key opt = {
       .index = t->tcf_index,
-      .refcnt = t->tcf_refcnt - ref,
-      .bindcnt = t->tcf_bindcnt - bind,
+      .refcnt = refcount_read(&t->tcf_refcnt) - ref,
+      .bindcnt = atomic_read(&t->tcf_bindcnt) - bind,
   };
   struct tcf_t tm;
   params = rtnl_dereference(t->params);
   opt.t_action = params->tcft_action;
   opt.action = params->action;
   if (nla_put(skb, TCA_TUNNEL_KEY_PARMS, sizeof(opt), &opt)) goto nla_put_failure;
   if (params->tcft_action == TCA_TUNNEL_KEY_ACT_SET) {
     struct ip_tunnel_info *info = &params->tcft_enc_metadata->u.tun_info;
     struct ip_tunnel_key *key = &info->key;
     __be32 key_id = tunnel_id_to_key32(key->tun_id);
     if (nla_put_be32(skb, TCA_TUNNEL_KEY_ENC_KEY_ID, key_id) || tunnel_key_dump_addresses(skb, &params->tcft_enc_metadata->u.tun_info) || nla_put_be16(skb, TCA_TUNNEL_KEY_ENC_DST_PORT, key->tp_dst) || nla_put_u8(skb, TCA_TUNNEL_KEY_NO_CSUM, !(key->tun_flags & TUNNEL_CSUM)) || tunnel_key_opts_dump(skb, info)) goto nla_put_failure;
   }
   tcf_tm_dump(&tm, &t->tcf_tm);
   if (nla_put_64bit(skb, TCA_TUNNEL_KEY_TM, sizeof(tm), &tm, TCA_TUNNEL_KEY_PAD)) goto nla_put_failure;
   return skb->len;
 nla_put_failure:
   nlmsg_trim(skb, b);
   return -1;
 }<sep>@@
expression p;
@@

- p->tcf_bindcnt
+ atomic_read(&p->tcf_bindcnt)




@@
expression p;
@@

- p->tcf_refcnt
+ refcount_read(&p->tcf_refcnt)
--- initial
+++ final
@@ -1,21 +1,21 @@
 static int tcf_vlan_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) {
   unsigned char *b = skb_tail_pointer(skb);
   struct tcf_vlan *v = to_vlan(a);
   struct tcf_vlan_params *p = rtnl_dereference(v->vlan_p);
   struct tc_vlan opt = {
       .index = v->tcf_index,
-      .refcnt = v->tcf_refcnt - ref,
-      .bindcnt = v->tcf_bindcnt - bind,
+      .refcnt = refcount_read(&v->tcf_refcnt) - ref,
+      .bindcnt = atomic_read(&v->tcf_bindcnt) - bind,
       .action = v->tcf_action,
       .v_action = p->tcfv_action,
   };
   struct tcf_t t;
   if (nla_put(skb, TCA_VLAN_PARMS, sizeof(opt), &opt)) goto nla_put_failure;
   if ((p->tcfv_action == TCA_VLAN_ACT_PUSH || p->tcfv_action == TCA_VLAN_ACT_MODIFY) && (nla_put_u16(skb, TCA_VLAN_PUSH_VLAN_ID, p->tcfv_push_vid) || nla_put_be16(skb, TCA_VLAN_PUSH_VLAN_PROTOCOL, p->tcfv_push_proto) || (nla_put_u8(skb, TCA_VLAN_PUSH_VLAN_PRIORITY, p->tcfv_push_prio)))) goto nla_put_failure;
   tcf_tm_dump(&t, &v->tcf_tm);
   if (nla_put_64bit(skb, TCA_VLAN_TM, sizeof(t), &t, TCA_VLAN_PAD)) goto nla_put_failure;
   return skb->len;
 nla_put_failure:
   nlmsg_trim(skb, b);
   return -1;
 }<sep>@@
expression p;
@@

- p->tcf_bindcnt
+ atomic_read(&p->tcf_bindcnt)




@@
expression p;
@@

- p->tcf_refcnt
+ refcount_read(&p->tcf_refcnt)
--- initial
+++ final
@@ -1,46 +1,46 @@
 int xchk_get_inode(struct xfs_scrub *sc, struct xfs_inode *ip_in) {
   struct xfs_imap imap;
   struct xfs_mount *mp = sc->mp;
   struct xfs_inode *ip = NULL;
   int error;
   /* We want to scan the inode we already had opened. */
   if (sc->sm->sm_ino == 0 || sc->sm->sm_ino == ip_in->i_ino) {
     sc->ip = ip_in;
     return 0;
   }
   /* Look up the inode, see if the generation number matches. */
   if (xfs_internal_inum(mp, sc->sm->sm_ino)) return -ENOENT;
   error = xfs_iget(mp, NULL, sc->sm->sm_ino, XFS_IGET_UNTRUSTED | XFS_IGET_DONTCACHE, 0, &ip);
   switch (error) {
   case -ENOENT:
     /* Inode doesn't exist, just bail out. */
     return error;
   case 0:
     /* Got an inode, continue. */
     break;
   case -EINVAL:
     /*
      * -EINVAL with IGET_UNTRUSTED could mean one of several
      * things: userspace gave us an inode number that doesn't
      * correspond to fs space, or doesn't have an inobt entry;
      * or it could simply mean that the inode buffer failed the
      * read verifiers.
      *
      * Try just the inode mapping lookup -- if it succeeds, then
      * the inode buffer verifier failed and something needs fixing.
      * Otherwise, we really couldn't find it so tell userspace
      * that it no longer exists.
      */
     error = xfs_imap(sc->mp, sc->tp, sc->sm->sm_ino, &imap, XFS_IGET_UNTRUSTED | XFS_IGET_DONTCACHE);
     if (error) return -ENOENT;
     error = -EFSCORRUPTED;
     /* fall through */
   default: trace_xchk_op_error(sc, XFS_INO_TO_AGNO(mp, sc->sm->sm_ino), XFS_INO_TO_AGBNO(mp, sc->sm->sm_ino), error, __return_address); return error;
   }
   if (VFS_I(ip)->i_generation != sc->sm->sm_gen) {
-    iput(VFS_I(ip));
+    xfs_irele(ip);
     return -ENOENT;
   }
   sc->ip = ip;
   return 0;
 }<sep>@@
expression dp;
@@
-               iput(VFS_I(dp));
+               xfs_irele(dp);
--- initial
+++ final
@@ -1,26 +1,26 @@
 STATIC int xchk_dir_check_ftype(struct xchk_dir_ctx *sdc, xfs_fileoff_t offset, xfs_ino_t inum, int dtype) {
   struct xfs_mount *mp = sdc->sc->mp;
   struct xfs_inode *ip;
   int ino_dtype;
   int error = 0;
   if (!xfs_sb_version_hasftype(&mp->m_sb)) {
     if (dtype != DT_UNKNOWN && dtype != DT_DIR) xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset);
     goto out;
   }
   /*
    * Grab the inode pointed to by the dirent.  We release the
    * inode before we cancel the scrub transaction.  Since we're
    * don't know a priori that releasing the inode won't trigger
    * eofblocks cleanup (which allocates what would be a nested
    * transaction), we can't use DONTCACHE here because DONTCACHE
    * inodes can trigger immediate inactive cleanup of the inode.
    */
   error = xfs_iget(mp, sdc->sc->tp, inum, 0, 0, &ip);
   if (!xchk_fblock_xref_process_error(sdc->sc, XFS_DATA_FORK, offset, &error)) goto out;
   /* Convert mode to the DT_* values that dir_emit uses. */
   ino_dtype = xfs_dir3_get_dtype(mp, xfs_mode_to_ftype(VFS_I(ip)->i_mode));
   if (ino_dtype != dtype) xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset);
-  iput(VFS_I(ip));
+  xfs_irele(ip);
 out:
   return error;
 }<sep>@@
expression dp;
@@
-               iput(VFS_I(dp));
+               xfs_irele(dp);
--- initial
+++ final
@@ -1,21 +1,21 @@
 STATIC int xchk_teardown(struct xfs_scrub *sc, struct xfs_inode *ip_in, int error) {
   xchk_ag_free(sc, &sc->sa);
   if (sc->tp) {
     if (error == 0 && (sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR))
       error = xfs_trans_commit(sc->tp);
     else
       xfs_trans_cancel(sc->tp);
     sc->tp = NULL;
   }
   if (sc->ip) {
     if (sc->ilock_flags) xfs_iunlock(sc->ip, sc->ilock_flags);
-    if (sc->ip != ip_in && !xfs_internal_inum(sc->mp, sc->ip->i_ino)) iput(VFS_I(sc->ip));
+    if (sc->ip != ip_in && !xfs_internal_inum(sc->mp, sc->ip->i_ino)) xfs_irele(sc->ip);
     sc->ip = NULL;
   }
   if (sc->has_quotaofflock) mutex_unlock(&sc->mp->m_quotainfo->qi_quotaofflock);
   if (sc->buf) {
     kmem_free(sc->buf);
     sc->buf = NULL;
   }
   return error;
 }<sep>@@
expression dp;
@@
-               iput(VFS_I(dp));
+               xfs_irele(dp);