Lines Matching defs:buffer

381  *       has been created without an inode, it won't overflow the buffer.
405 * @mft: A buffer containing a raw MFT record
411 * the buffer, since we created the search context without an inode.
452 int utils_inode_get_name(ntfs_inode *inode, char *buffer, int bufsize)
467 if (!inode || !buffer) {
549 len = snprintf(buffer + offset, bufsize - offset, "%c%s", PATH_SEP, names[i]);
562 ntfs_log_debug("Pathname: %s\n", buffer);
571 int utils_attr_get_name(ntfs_volume *vol, ATTR_RECORD *attr, char *buffer, int bufsize)
578 if (!attr || !buffer) {
593 len = snprintf(buffer, bufsize, "%s", name);
596 len = snprintf(buffer, bufsize, "<UNKNOWN>");
608 buffer += len;
618 len = snprintf(buffer, bufsize, "<UNKNOWN>");
622 len = snprintf(buffer, bufsize, "(%s)", name);
640 * reads the relevant part of $Bitmap into a buffer and tests the bit.
642 * This function has a static buffer in which it caches a section of $Bitmap.
643 * If the lcn, being tested, lies outside the range, the buffer will be
645 * buffer.
655 static unsigned char buffer[512];
656 static long long bmplcn = -(sizeof(buffer) << 3);
666 if ((lcn < bmplcn) || (lcn >= (bmplcn + (sizeof(buffer) << 3)))) {
674 /* Mark the buffer as in use, in case the read is shorter. */
675 memset(buffer, 0xFF, sizeof(buffer));
676 bmplcn = lcn & (~((sizeof(buffer) << 3) - 1));
678 if (ntfs_attr_pread(attr, (bmplcn >> 3), sizeof(buffer),
679 buffer) < 0) {
685 ntfs_log_debug("Reloaded bitmap buffer.\n");
690 byte = (lcn >> 3) & (sizeof(buffer) - 1);
692 "in use %d\n", lcn, bmplcn, byte, bit, buffer[byte] &
695 return (buffer[byte] & bit);
705 * reads the relevant part of $BITMAP into a buffer and tests the bit.
707 * This function has a static buffer in which it caches a section of $BITMAP.
708 * If the mref, being tested, lies outside the range, the buffer will be
717 static u8 buffer[512];
718 static s64 bmpmref = -sizeof(buffer) - 1; /* Which bit of $BITMAP is in the buffer */
730 (sizeof(buffer) << 3)))) {
733 /* Mark the buffer as not in use, in case the read is shorter. */
734 memset(buffer, 0, sizeof(buffer));
735 bmpmref = mref & (~((sizeof(buffer) << 3) - 1));
737 if (ntfs_attr_pread(vol->mftbmp_na, (bmpmref>>3), sizeof(buffer), buffer) < 0) {
742 ntfs_log_debug("Reloaded bitmap buffer.\n");
746 byte = (mref >> 3) & (sizeof(buffer) - 1);
747 ntfs_log_debug("cluster = %lld, bmpmref = %lld, byte = %d, bit = %d, in use %d\n", mref, bmpmref, byte, bit, buffer[byte] & bit);
749 return (buffer[byte] & bit);