[1783] 2008-08-06 Bean <[email protected]>

Bean <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 1783
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=1783
Author:   bean
Date:     2008-08-06 06:17:14 +0000 (Wed, 06 Aug 2008)

Log Message:
-----------
2008-08-06  Bean  <[email protected]>

	* fs/i386/pc/pxe.c (grub_pxe_data): New member block_size.
	(grub_pxefs_fs_int): Remove dummy definition.
	(grub_pxefs_open): Use data->block_size to store the current block
	size setting.
	(grub_pxefs_read): Use block size stored in data->block_size. As the
	value of grub_pxe_blksize can be changed after the file is opened.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/fs/i386/pc/pxe.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2008-08-06 04:05:12 UTC (rev 1782)
+++ trunk/grub2/ChangeLog	2008-08-06 06:17:14 UTC (rev 1783)
@@ -1,5 +1,14 @@
 2008-08-06  Bean  <[email protected]>
 
+	* fs/i386/pc/pxe.c (grub_pxe_data): New member block_size.
+	(grub_pxefs_fs_int): Remove dummy definition.
+	(grub_pxefs_open): Use data->block_size to store the current block
+	size setting.
+	(grub_pxefs_read): Use block size stored in data->block_size. As the
+	value of grub_pxe_blksize can be changed after the file is opened.
+
+2008-08-06  Bean  <[email protected]>
+
 	* fs/i386/pc/pxe.c (curr_file): new variable.
 	(grub_pxefs_open): Simply the handling of pxe file system. Don't
 	require the dummy internal file system anymore.

Modified: trunk/grub2/fs/i386/pc/pxe.c
===================================================================
--- trunk/grub2/fs/i386/pc/pxe.c	2008-08-06 04:05:12 UTC (rev 1782)
+++ trunk/grub2/fs/i386/pc/pxe.c	2008-08-06 06:17:14 UTC (rev 1783)
@@ -44,6 +44,7 @@
 struct grub_pxe_data
 {
   grub_uint32_t packet_number;
+  grub_uint32_t block_size;
   char filename[0];
 };
 
@@ -113,8 +114,6 @@
   return GRUB_ERR_NONE;
 }
 
-static struct grub_fs grub_pxefs_fs_int;
-
 static grub_err_t
 grub_pxefs_open (struct grub_file *file, const char *name)
 {
@@ -146,6 +145,7 @@
     return grub_errno;
 
   data->packet_number = 0;
+  data->block_size = grub_pxe_blksize;
   grub_strcpy (data->filename, name);
 
   file_int = grub_malloc (sizeof (*file_int));
@@ -159,7 +159,7 @@
   grub_memcpy (file_int, file, sizeof (struct grub_file));
   curr_file = file_int;
 
-  bufio = grub_bufio_open (file_int, grub_pxe_blksize);
+  bufio = grub_bufio_open (file_int, data->block_size);
   if (! bufio)
     {
       grub_free (file_int);
@@ -181,7 +181,7 @@
 
   data = file->data;
 
-  pn = grub_divmod64 (file->offset, grub_pxe_blksize, &r);
+  pn = grub_divmod64 (file->offset, data->block_size, &r);
   if (r)
     return grub_error (GRUB_ERR_BAD_FS,
                        "read access must be aligned to packet size");
@@ -196,7 +196,7 @@
       o.gateway_ip = grub_pxe_gateway_ip;
       grub_strcpy (o.filename, data->filename);
       o.tftp_port = grub_cpu_to_be16 (GRUB_PXE_TFTP_PORT);
-      o.packet_size = grub_pxe_blksize;
+      o.packet_size = data->block_size;
       grub_pxe_call (GRUB_PXENV_TFTP_OPEN, &o);
       if (o.status)
         return grub_error (GRUB_ERR_BAD_FS, "open fails");
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.