return buf;
}
+static void printf_widen_string(struct printf_state *ps, int n)
+{
+ ps->buf = widen_string(ps->buf, n, ps->end, ps->spec);
+}
+
static noinline_for_stack
char *string(char *buf, char *end, const char *s, struct printf_spec spec)
{
}
static noinline_for_stack
-char *dentry_name(char *buf, char *end, const struct dentry *d, struct printf_spec spec,
- const char *fmt)
+char *dentry_name(struct printf_state *ps, const struct dentry *d)
{
const char *array[4], *s;
const struct dentry *p;
int depth;
int i, n;
- switch (fmt[1]) {
+ switch (ps->fmt[1]) {
case '2': case '3': case '4':
- depth = fmt[1] - '0';
+ depth = ps->fmt[1] - '0';
break;
default:
depth = 1;
}
}
s = array[--i];
- for (n = 0; n != spec.precision; n++, buf++) {
+ for (n = 0; n != ps->spec.precision; n++, ps->buf++) {
char c = *s++;
if (!c) {
if (!i)
c = '/';
s = array[--i];
}
- if (buf < end)
- *buf = c;
+ if (ps->buf < ps->end)
+ *ps->buf = c;
}
rcu_read_unlock();
- return widen_string(buf, n, end, spec);
+ printf_widen_string(ps, n);
+ return ps->buf;
}
#ifdef CONFIG_BLOCK
return netdev_bits(buf, end, ptr, spec, fmt);
case 'a':
return address_val(buf, end, ptr, fmt);
+ case 'D':
+ ptr = ((const struct file *)ptr)->f_path.dentry;
+ /* fall through */
case 'd':
- return dentry_name(buf, end, ptr, spec, fmt);
+ return dentry_name(ps, ptr);
case 'C':
return clock(buf, end, ptr, spec, fmt);
- case 'D':
- return dentry_name(buf, end,
- ((const struct file *)ptr)->f_path.dentry,
- spec, fmt);
#ifdef CONFIG_BLOCK
case 'g':
return bdev_name(ps, ptr);