Home | History | Annotate | Download | only in blkid

Lines Matching refs:pr

52 static unsigned char *get_buffer(struct blkid_probe *pr,
59 if (!pr->sbbuf) {
60 pr->sbbuf = malloc(SB_BUFFER_SIZE);
61 if (!pr->sbbuf)
63 if (lseek(pr->fd, 0, SEEK_SET) < 0)
65 ret_read = read(pr->fd, pr->sbbuf, SB_BUFFER_SIZE);
68 pr->sb_valid = ret_read;
70 if (off+len > pr->sb_valid)
72 return pr->sbbuf + off;
74 if (len > pr->buf_max) {
75 newbuf = realloc(pr->buf, len);
78 pr->buf = newbuf;
79 pr->buf_max = len;
81 if (blkid_llseek(pr->fd, off, SEEK_SET) < 0)
83 ret_read = read(pr->fd, pr->buf, len);
86 return pr->buf;