X25: Move interrupt flag to bitfield
authorandrew hendry <andrew.hendry@gmail.com>
Sun, 16 May 2010 23:00:02 +0000 (23:00 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 May 2010 00:39:27 +0000 (17:39 -0700)
Moves the x25 interrupt flag from char into bitfield.

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/x25.h
net/x25/af_x25.c
net/x25/x25_in.c
net/x25/x25_out.c

index 7b5795e1ceb2904d56e1ec53985d3eb2e238e3f5..1576e92c6cec750bd2b0e542b557d81a8cceb6f3 100644 (file)
@@ -115,6 +115,7 @@ enum {
 
 /* Bitset in x25_sock->flags for misc flags */
 #define X25_Q_BIT_FLAG         0
+#define X25_INTERRUPT_FLAG     1
 
 /**
  *     struct x25_route - x25 routing entry
@@ -149,7 +150,7 @@ struct x25_sock {
        struct x25_address      source_addr, dest_addr;
        struct x25_neigh        *neighbour;
        unsigned int            lci, cudmatchlength;
-       unsigned char           state, condition, intflag, accptapprv;
+       unsigned char           state, condition, accptapprv;
        unsigned short          vs, vr, va, vl;
        unsigned long           t2, t21, t22, t23;
        unsigned short          fraglen;
index 720534ce1fd97fe25aa9830c7417b68faa5b5c92..3d97b8caf0b16b11c48ba9339a636c8039a755be 100644 (file)
@@ -641,6 +641,7 @@ static struct sock *x25_make_new(struct sock *osk)
        x25->cudmatchlength = ox25->cudmatchlength;
        x25->accptapprv = ox25->accptapprv;
 
+       clear_bit(X25_INTERRUPT_FLAG, &x25->flags);
        x25_init_timers(sk);
 out:
        return sk;
index 372ac226e648445057f82786e95a7ee64c11cd2d..63178961efac00488d36e7c8fc3d21f00e036e2e 100644 (file)
@@ -273,7 +273,7 @@ static int x25_state3_machine(struct sock *sk, struct sk_buff *skb, int frametyp
                        break;
 
                case X25_INTERRUPT_CONFIRMATION:
-                       x25->intflag = 0;
+                       clear_bit(X25_INTERRUPT_FLAG, &x25->flags);
                        break;
 
                case X25_INTERRUPT:
index 52351a26b6fc4b713f034e9b2d7a1990247ca419..d00649fb251d3df8bddafad81508e96d74821eb1 100644 (file)
@@ -148,8 +148,9 @@ void x25_kick(struct sock *sk)
        /*
         *      Transmit interrupt data.
         */
-       if (!x25->intflag && skb_peek(&x25->interrupt_out_queue) != NULL) {
-               x25->intflag = 1;
+       if (skb_peek(&x25->interrupt_out_queue) != NULL &&
+               !test_and_set_bit(X25_INTERRUPT_FLAG, &x25->flags)) {
+
                skb = skb_dequeue(&x25->interrupt_out_queue);
                x25_transmit_link(skb, x25->neighbour);
        }