All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] Handle group offsets in UFS1
@ 2009-08-13 16:04 Vladimir 'phcoder' Serbinenko
  2009-08-13 20:05 ` Robert Millan
  0 siblings, 1 reply; 5+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-08-13 16:04 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 106 bytes --]

-- 
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git

[-- Attachment #2: ufsfix --]
[-- Type: application/octet-stream, Size: 1215 bytes --]

diff --git a/ChangeLog b/ChangeLog
index 8e13775..be2eca0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2009-08-13  Vladimir Serbinenko  <phcoder@gmail.com>
 
+	Handle group offset on UFS1.
+
+	* fs/ufs.c (grub_ufs_sblock): New field 'cylg_mask'.
+	(grub_ufs_read_inode) [!MODE_UFS2]: handle cylg_offset and cylg_mask.
+	
+2009-08-13  Vladimir Serbinenko  <phcoder@gmail.com>
+
 	Split ufs.mod into ufs1.mod and ufs2.mod.
 
 	* conf/common.rmk (grub_probe_SOURCES): Add fs/ufs2.c.
diff --git a/fs/ufs.c b/fs/ufs.c
index 7f254af..13727f8 100644
--- a/fs/ufs.c
+++ b/fs/ufs.c
@@ -88,7 +88,7 @@ struct grub_ufs_sblock
 
   /* The start of the cylinder group.  */
   grub_uint32_t cylg_offset;
-  grub_uint8_t unused3[4];
+  grub_uint32_t cylg_mask;
 
   grub_uint32_t mtime;
   grub_uint8_t unused4[12];
@@ -360,6 +360,11 @@ grub_ufs_read_inode (struct grub_ufs_data *data, int ino, char *inode)
   /* The first block of the group.  */
   int grpblk = group * (grub_le_to_cpu32 (sblock->frags_per_group));
 
+#ifndef MODE_UFS2
+  grpblk += grub_le_to_cpu32 (sblock->cylg_offset)
+    * (group & (~grub_le_to_cpu32 (sblock->cylg_mask)));
+#endif
+
   if (!inode)
     {
       inode = (char *) &data->inode;

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-08-13 20:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-13 16:04 [PATCH 2/2] Handle group offsets in UFS1 Vladimir 'phcoder' Serbinenko
2009-08-13 20:05 ` Robert Millan
2009-08-13 20:14   ` Seth Goldberg
2009-08-13 20:25   ` Vladimir 'phcoder' Serbinenko
2009-08-13 20:58     ` Robert Millan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.