aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fscache
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2015-02-24 05:39:28 -0500
committerDavid Howells <dhowells@redhat.com>2015-04-02 09:28:53 -0400
commit3c3059841a9b99fa8dd8d878607deceec1e363e9 (patch)
tree030a328b83fc952fde8915abc2bb3a2010cb1166 /fs/fscache
parent182d919b84902eece162c63ed3d476c8016b4197 (diff)
FS-Cache: Move fscache_report_unexpected_submission() to make it more available
Move fscache_report_unexpected_submission() up within operation.c so that it can be called from fscache_submit_exclusive_op() too. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Steve Dickson <steved@redhat.com> Acked-by: Jeff Layton <jeff.layton@primarydata.com>
Diffstat (limited to 'fs/fscache')
-rw-r--r--fs/fscache/operation.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/fs/fscache/operation.c b/fs/fscache/operation.c
index e7b87a0e5185..68ead8482617 100644
--- a/fs/fscache/operation.c
+++ b/fs/fscache/operation.c
@@ -76,6 +76,43 @@ static void fscache_run_op(struct fscache_object *object,
76} 76}
77 77
78/* 78/*
79 * report an unexpected submission
80 */
81static void fscache_report_unexpected_submission(struct fscache_object *object,
82 struct fscache_operation *op,
83 const struct fscache_state *ostate)
84{
85 static bool once_only;
86 struct fscache_operation *p;
87 unsigned n;
88
89 if (once_only)
90 return;
91 once_only = true;
92
93 kdebug("unexpected submission OP%x [OBJ%x %s]",
94 op->debug_id, object->debug_id, object->state->name);
95 kdebug("objstate=%s [%s]", object->state->name, ostate->name);
96 kdebug("objflags=%lx", object->flags);
97 kdebug("objevent=%lx [%lx]", object->events, object->event_mask);
98 kdebug("ops=%u inp=%u exc=%u",
99 object->n_ops, object->n_in_progress, object->n_exclusive);
100
101 if (!list_empty(&object->pending_ops)) {
102 n = 0;
103 list_for_each_entry(p, &object->pending_ops, pend_link) {
104 ASSERTCMP(p->object, ==, object);
105 kdebug("%p %p", op->processor, op->release);
106 n++;
107 }
108
109 kdebug("n=%u", n);
110 }
111
112 dump_stack();
113}
114
115/*
79 * submit an exclusive operation for an object 116 * submit an exclusive operation for an object
80 * - other ops are excluded from running simultaneously with this one 117 * - other ops are excluded from running simultaneously with this one
81 * - this gets any extra refs it needs on an op 118 * - this gets any extra refs it needs on an op
@@ -139,43 +176,6 @@ int fscache_submit_exclusive_op(struct fscache_object *object,
139} 176}
140 177
141/* 178/*
142 * report an unexpected submission
143 */
144static void fscache_report_unexpected_submission(struct fscache_object *object,
145 struct fscache_operation *op,
146 const struct fscache_state *ostate)
147{
148 static bool once_only;
149 struct fscache_operation *p;
150 unsigned n;
151
152 if (once_only)
153 return;
154 once_only = true;
155
156 kdebug("unexpected submission OP%x [OBJ%x %s]",
157 op->debug_id, object->debug_id, object->state->name);
158 kdebug("objstate=%s [%s]", object->state->name, ostate->name);
159 kdebug("objflags=%lx", object->flags);
160 kdebug("objevent=%lx [%lx]", object->events, object->event_mask);
161 kdebug("ops=%u inp=%u exc=%u",
162 object->n_ops, object->n_in_progress, object->n_exclusive);
163
164 if (!list_empty(&object->pending_ops)) {
165 n = 0;
166 list_for_each_entry(p, &object->pending_ops, pend_link) {
167 ASSERTCMP(p->object, ==, object);
168 kdebug("%p %p", op->processor, op->release);
169 n++;
170 }
171
172 kdebug("n=%u", n);
173 }
174
175 dump_stack();
176}
177
178/*
179 * submit an operation for an object 179 * submit an operation for an object
180 * - objects may be submitted only in the following states: 180 * - objects may be submitted only in the following states:
181 * - during object creation (write ops may be submitted) 181 * - during object creation (write ops may be submitted)