Skip to content

Commit

Permalink
Revert "Make NDMP ImageStream buffer dynamically allocated size."
Browse files Browse the repository at this point in the history
This reverts commit d4ea100.

It seems we don't have the right info for dynamically sizing
the buffers at the specific place in the library. So this needs more
testing.
  • Loading branch information
Marco van Wieringen committed May 12, 2015
1 parent 7a5dbed commit da38df3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
9 changes: 0 additions & 9 deletions src/ndmp/ndma_image_stream.c
Expand Up @@ -93,13 +93,6 @@ ndmis_initialize (struct ndm_session *sess)
NDMOS_MACRO_ZEROFILL (sess->plumb.image_stream);
NDMOS_MACRO_ZEROFILL (&sess->plumb.image_stream->chan);

sess->plumb.image_stream->buf = NDMOS_API_MALLOC (sess->control_acb->job.record_size);
if (!sess->plumb.image_stream->buf) {
NDMOS_API_FREE (sess->plumb.image_stream);
return -1;
}
NDMOS_MACRO_ZEROFILL (sess->plumb.image_stream->buf);

ndmis_reinit_remote (sess);

sess->plumb.image_stream->data_ep.name = "DATA";
Expand Down Expand Up @@ -130,13 +123,11 @@ ndmis_destroy (struct ndm_session *sess)
return 0;
}

NDMOS_API_FREE (sess->plumb.image_stream->buf);
NDMOS_API_FREE (sess->plumb.image_stream);
sess->plumb.image_stream = NULL;

return 0;
}

/* Belay -- Cancel partially issued activation/start */
int
ndmis_belay (struct ndm_session *sess)
Expand Down
6 changes: 5 additions & 1 deletion src/ndmp/ndmagents.h
Expand Up @@ -932,6 +932,10 @@ extern int ndmra_destroy (struct ndm_session *sess);
****************************************************************
*/

#ifndef NDM_N_IMAGE_STREAM_BUF
#define NDM_N_IMAGE_STREAM_BUF (100*1024)
#endif

enum ndmis_connect_status {
NDMIS_CONN_IDLE = 0,
NDMIS_CONN_LISTEN,
Expand Down Expand Up @@ -971,7 +975,7 @@ struct ndm_image_stream {
/* transfer stuff */
int transfer_mode;
struct ndmchan chan;
char * buf;
char buf[NDM_N_IMAGE_STREAM_BUF];
};

extern int ndmis_initialize (struct ndm_session *sess);
Expand Down

0 comments on commit da38df3

Please sign in to comment.