]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - kernel/trace/seq_buf.c
tracing: Add seq_buf_get_buf() and seq_buf_commit() helper functions
[mirror_ubuntu-artful-kernel.git] / kernel / trace / seq_buf.c
index c53f1d5088e8d3de886bdfbe35ec03bb85f18edc..086f594ac8902f7530cb2ef4484ae865ec87de0b 100644 (file)
@@ -293,8 +293,8 @@ int seq_buf_putmem_hex(struct seq_buf *s, const void *mem,
  */
 int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc)
 {
-       char *buf = s->buffer + s->len;
-       size_t size = seq_buf_buffer_left(s);
+       char *buf;
+       size_t size = seq_buf_get_buf(s, &buf);
        int res = -1;
 
        WARN_ON(s->size == 0);
@@ -307,8 +307,7 @@ int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc)
                                res = end - buf;
                }
        }
-       if (res > 0)
-               s->len += res;
+       seq_buf_commit(s, res);
 
        return res;
 }