diff --git a/src/channel.c b/src/channel.c
index bb818dc..2e88080 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -362,7 +362,7 @@
 	return TRUE;
 
     /* If reading from or a buffer it's still useful. */
-    if (channel->ch_part[PART_IN].ch_buffer != NULL)
+    if (channel->ch_part[PART_IN].ch_bufref.br_buf != NULL)
 	return TRUE;
 
     /* If there is no callback then nobody can get readahead.  If the fd is
@@ -379,9 +379,11 @@
     return (channel->ch_callback != NULL && (has_sock_msg
 		|| has_out_msg || has_err_msg))
 	    || ((channel->ch_part[PART_OUT].ch_callback != NULL
-		      || channel->ch_part[PART_OUT].ch_buffer) && has_out_msg)
+		       || channel->ch_part[PART_OUT].ch_bufref.br_buf != NULL)
+		    && has_out_msg)
 	    || ((channel->ch_part[PART_ERR].ch_callback != NULL
-		     || channel->ch_part[PART_ERR].ch_buffer) && has_err_msg);
+		       || channel->ch_part[PART_ERR].ch_bufref.br_buf != NULL)
+		    && has_err_msg);
 }
 
 /*
@@ -1046,19 +1048,19 @@
     {
 	chanpart_T *in_part = &channel->ch_part[PART_IN];
 
-	in_part->ch_buffer = job->jv_in_buf;
+	set_bufref(&in_part->ch_bufref, job->jv_in_buf);
 	ch_logs(channel, "reading from buffer '%s'",
-					(char *)in_part->ch_buffer->b_ffname);
+				 (char *)in_part->ch_bufref.br_buf->b_ffname);
 	if (options->jo_set & JO_IN_TOP)
 	{
 	    if (options->jo_in_top == 0 && !(options->jo_set & JO_IN_BOT))
 	    {
 		/* Special mode: send last-but-one line when appending a line
 		 * to the buffer. */
-		in_part->ch_buffer->b_write_to_channel = TRUE;
+		in_part->ch_bufref.br_buf->b_write_to_channel = TRUE;
 		in_part->ch_buf_append = TRUE;
 		in_part->ch_buf_top =
-				   in_part->ch_buffer->b_ml.ml_line_count + 1;
+			    in_part->ch_bufref.br_buf->b_ml.ml_line_count + 1;
 	    }
 	    else
 		in_part->ch_buf_top = options->jo_in_top;
@@ -1068,7 +1070,7 @@
 	if (options->jo_set & JO_IN_BOT)
 	    in_part->ch_buf_bot = options->jo_in_bot;
 	else
-	    in_part->ch_buf_bot = in_part->ch_buffer->b_ml.ml_line_count;
+	    in_part->ch_buf_bot = in_part->ch_bufref.br_buf->b_ml.ml_line_count;
     }
 }
 
@@ -1229,7 +1231,7 @@
 	    {
 		ch_logs(channel, "writing out to buffer '%s'",
 						       (char *)buf->b_ffname);
-		channel->ch_part[PART_OUT].ch_buffer = buf;
+		set_bufref(&channel->ch_part[PART_OUT].ch_bufref, buf);
 	    }
 	}
     }
@@ -1244,7 +1246,7 @@
 	if (!(opt->jo_set & JO_ERR_MODE))
 	    channel->ch_part[PART_ERR].ch_mode = MODE_NL;
 	if (opt->jo_io[PART_ERR] == JIO_OUT)
-	    buf = channel->ch_part[PART_OUT].ch_buffer;
+	    buf = channel->ch_part[PART_OUT].ch_bufref.br_buf;
 	else if (opt->jo_set & JO_ERR_BUF)
 	{
 	    buf = buflist_findnr(opt->jo_io_buf[PART_ERR]);
@@ -1266,7 +1268,7 @@
 	    {
 		ch_logs(channel, "writing err to buffer '%s'",
 						       (char *)buf->b_ffname);
-		channel->ch_part[PART_ERR].ch_buffer = buf;
+		set_bufref(&channel->ch_part[PART_ERR].ch_bufref, buf);
 	    }
 	}
     }
@@ -1407,15 +1409,15 @@
 {
     chanpart_T *in_part = &channel->ch_part[PART_IN];
     linenr_T    lnum;
-    buf_T	*buf = in_part->ch_buffer;
+    buf_T	*buf = in_part->ch_bufref.br_buf;
     int		written = 0;
 
     if (buf == NULL || in_part->ch_buf_append)
 	return;  /* no buffer or using appending */
-    if (!buf_valid(buf) || buf->b_ml.ml_mfp == NULL)
+    if (!bufref_valid(&in_part->ch_bufref) || buf->b_ml.ml_mfp == NULL)
     {
 	/* buffer was wiped out or unloaded */
-	in_part->ch_buffer = NULL;
+	in_part->ch_bufref.br_buf = NULL;
 	return;
     }
 
@@ -1437,7 +1439,7 @@
     if (lnum > buf->b_ml.ml_line_count)
     {
 	/* Writing is done, no longer need the buffer. */
-	in_part->ch_buffer = NULL;
+	in_part->ch_bufref.br_buf = NULL;
 	ch_log(channel, "Finished writing all lines to channel");
     }
     else
@@ -1459,11 +1461,11 @@
 	{
 	    chanpart_T  *ch_part = &channel->ch_part[part];
 
-	    if (ch_part->ch_buffer == buf)
+	    if (ch_part->ch_bufref.br_buf == buf)
 	    {
 		ch_logs(channel, "%s buffer has been wiped out",
 							    part_names[part]);
-		ch_part->ch_buffer = NULL;
+		ch_part->ch_bufref.br_buf = NULL;
 	    }
 	}
 }
@@ -1480,10 +1482,10 @@
     {
 	chanpart_T  *in_part = &channel->ch_part[PART_IN];
 
-	if (in_part->ch_buffer != NULL)
+	if (in_part->ch_bufref.br_buf != NULL)
 	{
 	    if (in_part->ch_buf_append)
-		channel_write_new_lines(in_part->ch_buffer);
+		channel_write_new_lines(in_part->ch_bufref.br_buf);
 	    else
 		channel_write_in(channel);
 	}
@@ -1507,7 +1509,7 @@
 	linenr_T    lnum;
 	int	    written = 0;
 
-	if (in_part->ch_buffer == buf && in_part->ch_buf_append)
+	if (in_part->ch_bufref.br_buf == buf && in_part->ch_buf_append)
 	{
 	    if (in_part->ch_fd == INVALID_FD)
 		continue;  /* pipe was closed */
@@ -2312,7 +2314,7 @@
 	{
 	    chanpart_T  *in_part = &ch->ch_part[PART_IN];
 
-	    if (in_part->ch_buffer == buffer)
+	    if (in_part->ch_bufref.br_buf == buffer)
 		in_part->ch_buf_bot = buffer->b_ml.ml_line_count;
 	}
     }
@@ -2374,11 +2376,11 @@
 	partial = channel->ch_partial;
     }
 
-    buffer = channel->ch_part[part].ch_buffer;
-    if (buffer != NULL && !buf_valid(buffer))
+    buffer = channel->ch_part[part].ch_bufref.br_buf;
+    if (buffer != NULL && !bufref_valid(&channel->ch_part[part].ch_bufref))
     {
 	/* buffer was wiped out */
-	channel->ch_part[part].ch_buffer = NULL;
+	channel->ch_part[part].ch_bufref.br_buf = NULL;
 	buffer = NULL;
     }
 
@@ -2834,7 +2836,7 @@
     {
 	chanpart_T  *in_part = &ch->ch_part[PART_IN];
 
-	if (in_part->ch_fd != INVALID_FD && in_part->ch_buffer != NULL)
+	if (in_part->ch_fd != INVALID_FD && in_part->ch_bufref.br_buf != NULL)
 	{
 	    FD_SET((int)in_part->ch_fd, wfds);
 	    if ((int)in_part->ch_fd >= maxfd)
@@ -2857,7 +2859,7 @@
     {
 	chanpart_T  *in_part = &ch->ch_part[PART_IN];
 
-	if (in_part->ch_fd != INVALID_FD && in_part->ch_buffer != NULL)
+	if (in_part->ch_fd != INVALID_FD && in_part->ch_bufref.br_buf != NULL)
 	{
 	    in_part->ch_poll_idx = nfd;
 	    fds[nfd].fd = in_part->ch_fd;
@@ -3643,8 +3645,8 @@
 	{
 	    if (in_part->ch_buf_append)
 	    {
-		if (in_part->ch_buffer != NULL)
-		    channel_write_new_lines(in_part->ch_buffer);
+		if (in_part->ch_bufref.br_buf != NULL)
+		    channel_write_new_lines(in_part->ch_bufref.br_buf);
 	    }
 	    else
 		channel_write_in(channel);
@@ -3721,8 +3723,8 @@
 	{
 	    if (in_part->ch_buf_append)
 	    {
-		if (in_part->ch_buffer != NULL)
-		    channel_write_new_lines(in_part->ch_buffer);
+		if (in_part->ch_bufref.br_buf != NULL)
+		    channel_write_new_lines(in_part->ch_bufref.br_buf);
 	    }
 	    else
 		channel_write_in(channel);
