~ubuntu-branches/ubuntu/saucy/linux-ti-omap4/saucy-proposed

« back to all changes in this revision

Viewing changes to fs/dlm/requestqueue.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati, Stefan Bader, Upstream Kernel Changes
  • Date: 2012-08-15 17:17:43 UTC
  • Revision ID: package-import@ubuntu.com-20120815171743-h5wnuf51xe7pvdid
Tags: 3.5.0-207.13
[ Paolo Pisati ]

* Start new release

[ Stefan Bader ]

* (config) Enable getabis to use local package copies

[ Upstream Kernel Changes ]

* fixup: gargabe collect iva_seq[0|1] init
* [Config] enable all SND_OMAP_SOC_*s
* fixup: cm2xxx_3xxx.o is needed for omap2_cm_read|write_reg
* fixup: add some snd_soc_dai* helper functions
* fixup: s/snd_soc_dpcm_params/snd_soc_dpcm/g
* fixup: typo, no_host_mode and useless SDP4430 init
* fixup: enable again aess hwmod

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
struct rq_entry {
21
21
        struct list_head list;
 
22
        uint32_t recover_seq;
22
23
        int nodeid;
23
24
        struct dlm_message request;
24
25
};
41
42
                return;
42
43
        }
43
44
 
 
45
        e->recover_seq = ls->ls_recover_seq & 0xFFFFFFFF;
44
46
        e->nodeid = nodeid;
45
47
        memcpy(&e->request, ms, ms->m_header.h_length);
46
48
 
63
65
int dlm_process_requestqueue(struct dlm_ls *ls)
64
66
{
65
67
        struct rq_entry *e;
 
68
        struct dlm_message *ms;
66
69
        int error = 0;
67
70
 
68
71
        mutex_lock(&ls->ls_requestqueue_mutex);
76
79
                e = list_entry(ls->ls_requestqueue.next, struct rq_entry, list);
77
80
                mutex_unlock(&ls->ls_requestqueue_mutex);
78
81
 
79
 
                dlm_receive_message_saved(ls, &e->request);
 
82
                ms = &e->request;
 
83
 
 
84
                log_limit(ls, "dlm_process_requestqueue msg %d from %d "
 
85
                          "lkid %x remid %x result %d seq %u",
 
86
                          ms->m_type, ms->m_header.h_nodeid,
 
87
                          ms->m_lkid, ms->m_remid, ms->m_result,
 
88
                          e->recover_seq);
 
89
 
 
90
                dlm_receive_message_saved(ls, &e->request, e->recover_seq);
80
91
 
81
92
                mutex_lock(&ls->ls_requestqueue_mutex);
82
93
                list_del(&e->list);
138
149
        if (!dlm_no_directory(ls))
139
150
                return 0;
140
151
 
141
 
        /* with no directory, the master is likely to change as a part of
142
 
           recovery; requests to/from the defunct master need to be purged */
143
 
 
144
 
        switch (type) {
145
 
        case DLM_MSG_REQUEST:
146
 
        case DLM_MSG_CONVERT:
147
 
        case DLM_MSG_UNLOCK:
148
 
        case DLM_MSG_CANCEL:
149
 
                /* we're no longer the master of this resource, the sender
150
 
                   will resend to the new master (see waiter_needs_recovery) */
151
 
 
152
 
                if (dlm_hash2nodeid(ls, ms->m_hash) != dlm_our_nodeid())
153
 
                        return 1;
154
 
                break;
155
 
 
156
 
        case DLM_MSG_REQUEST_REPLY:
157
 
        case DLM_MSG_CONVERT_REPLY:
158
 
        case DLM_MSG_UNLOCK_REPLY:
159
 
        case DLM_MSG_CANCEL_REPLY:
160
 
        case DLM_MSG_GRANT:
161
 
                /* this reply is from the former master of the resource,
162
 
                   we'll resend to the new master if needed */
163
 
 
164
 
                if (dlm_hash2nodeid(ls, ms->m_hash) != nodeid)
165
 
                        return 1;
166
 
                break;
167
 
        }
168
 
 
169
 
        return 0;
 
152
        return 1;
170
153
}
171
154
 
172
155
void dlm_purge_requestqueue(struct dlm_ls *ls)