Commit 221cdcf4 authored by Mike Hibler's avatar Mike Hibler
Browse files

Introduce some additional "netfs" debugging to track access to a file.

parent decd8ce0
Pipeline #1117 skipped
......@@ -1421,6 +1421,7 @@ grub_net_fs_open (struct grub_file *file_out, const char *name)
grub_memcpy (file_out, bufio, sizeof (struct grub_file));
grub_free (bufio);
grub_dprintf("netfs", "fs_open: '%s'\n", name);
return GRUB_ERR_NONE;
}
......@@ -1433,6 +1434,7 @@ grub_net_fs_close (grub_file_t file)
grub_net_remove_packet (file->device->net->packs.first);
}
file->device->net->protocol->close (file);
grub_dprintf("netfs", "fs_close: '%s'\n", file->device->net->name);
grub_free (file->device->net->name);
return GRUB_ERR_NONE;
}
......@@ -1629,6 +1631,10 @@ grub_net_seek_real (struct grub_file *file, grub_off_t offset)
{
if (!file->device->net->protocol->seek || have_ahead (file) >= offset)
{
grub_dprintf("netfs", "seek_real: %s: forward seek 0x%llx -> 0x%llx\n",
file->device->net->name,
(unsigned long long)file->device->net->offset,
(unsigned long long)offset);
grub_net_fs_read_real (file, NULL,
offset - file->device->net->offset);
return grub_errno;
......@@ -1640,6 +1646,10 @@ grub_net_seek_real (struct grub_file *file, grub_off_t offset)
grub_err_t err;
if (file->device->net->protocol->seek)
return file->device->net->protocol->seek (file, offset);
grub_dprintf("netfs", "seek_real: %s: backward seek 0x%llx -> 0x%llx\n",
file->device->net->name,
(unsigned long long)file->device->net->offset,
(unsigned long long)offset);
while (file->device->net->packs.first)
{
grub_netbuff_free (file->device->net->packs.first->nb);
......@@ -1662,6 +1672,12 @@ grub_net_seek_real (struct grub_file *file, grub_off_t offset)
static grub_ssize_t
grub_net_fs_read (grub_file_t file, char *buf, grub_size_t len)
{
grub_dprintf("netfs", "fs_read: %s: 0x%llx bytes @ 0x%llx (current: 0x%llx)\n",
file->device->net->name,
(unsigned long long)len,
(unsigned long long)file->offset,
(unsigned long long)file->device->net->offset);
if (file->offset != file->device->net->offset)
{
grub_err_t err;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment