Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: nbmakefs 2G limit?



On Oct 22,  3:16pm, gdt%ir.bbn.com@localhost (Greg Troxel) wrote:
-- Subject: Re: nbmakefs 2G limit?

Amended..

christos

Index: cd9660.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/makefs/cd9660.c,v
retrieving revision 1.26
diff -u -u -r1.26 cd9660.c
--- cd9660.c    16 Jan 2009 18:02:24 -0000      1.26
+++ cd9660.c    22 Oct 2010 20:59:48 -0000
@@ -158,7 +158,7 @@
 #endif
 static int cd9660_convert_filename(const char *, char *, int);
 static void cd9660_populate_dot_records(cd9660node *);
-static int cd9660_compute_offsets(cd9660node *, int);
+static int64_t cd9660_compute_offsets(cd9660node *, int64_t);
 #if 0
 static int cd9660_copy_stat_info(cd9660node *, cd9660node *, int);
 #endif
@@ -451,11 +451,11 @@
 cd9660_makefs(const char *image, const char *dir, fsnode *root,
              fsinfo_t *fsopts)
 {
-       int startoffset;
+       int64_t startoffset;
        int numDirectories;
-       int pathTableSectors;
-       int firstAvailableSector;
-       int totalSpace;
+       iint64_t pathTableSectors;
+       int64_t firstAvailableSector;
+       int64_t totalSpace;
        int error;
        cd9660node *real_root;
 
@@ -592,11 +592,12 @@
        /* Debugging output */
        if (diskStructure.verbose_level > 0) {
                printf("cd9660_makefs: Sectors 0-15 reserved\n");
-               printf("cd9660_makefs: Primary path tables starts in sector 
%i\n",
-                       diskStructure.primaryLittleEndianTableSector);
-               printf("cd9660_makefs: File data starts in sector %i\n",
-                       diskStructure.dataFirstSector);
-               printf("cd9660_makefs: Total sectors: 
%i\n",diskStructure.totalSectors);
+               printf("cd9660_makefs: Primary path tables starts in sector %"
+                   PRId64 "\n", diskStructure.primaryLittleEndianTableSector);
+               printf("cd9660_makefs: File data starts in sector %"
+                   PRId64 "\n", diskStructure.dataFirstSector);
+               printf("cd9660_makefs: Total sectors: %"
+                   PRId64 "\n", diskStructure.totalSectors);
        }
 
        /*
@@ -1822,19 +1823,19 @@
  * @returns int The total size of files and directory entries (should be
  *              a multiple of sector size)
 */
-static int
-cd9660_compute_offsets(cd9660node *node, int startOffset)
+static int64_t
+cd9660_compute_offsets(cd9660node *node, int64_t startOffset)
 {
        /*
         * This function needs to compute the size of directory records and
         * runs, file lengths, and set the appropriate variables both in
         * cd9660node and isoDirEntry
         */
-       int used_bytes = 0;
-       int current_sector_usage = 0;
+       int64_t used_bytes = 0;
+       int64_t current_sector_usage = 0;
        cd9660node *child;
        fsinode *inode;
-       int r;
+       int64_t r;
 
        assert(node != NULL);
 
Index: cd9660.h
===================================================================
RCS file: /cvsroot/src/usr.sbin/makefs/cd9660.h,v
retrieving revision 1.14
diff -u -u -r1.14 cd9660.h
--- cd9660.h    22 Oct 2010 00:49:15 -0000      1.14
+++ cd9660.h    22 Oct 2010 20:59:49 -0000
@@ -181,10 +181,7 @@
         */
        int64_t fileDataLength;
 
-       /*
-        * XXXfvdl sectors are int
-        */
-       int fileSectorsUsed;
+       int64_t fileSectorsUsed;
        int fileRecordSize;/*copy of a variable, int for quicker calculations*/
 
        /* Old name, used for renaming - needs to be optimized but low priority 
*/
@@ -196,21 +193,21 @@
        /* For Rock Ridge */
        struct _cd9660node *rr_real_parent, *rr_relocated;
 
-       int susp_entry_size;
-       int susp_dot_entry_size;
-       int susp_dot_dot_entry_size;
+       int64_t susp_entry_size;
+       int64_t susp_dot_entry_size;
+       int64_t susp_dot_dot_entry_size;
 
        /* Continuation area stuff */
-       int susp_entry_ce_start;
-       int susp_dot_ce_start;
-       int susp_dot_dot_ce_start;
-
-       int susp_entry_ce_length;
-       int susp_dot_ce_length;
-       int susp_dot_dot_ce_length;
+       int64_t susp_entry_ce_start;
+       int64_t susp_dot_ce_start;
+       int64_t susp_dot_dot_ce_start;
+
+       int64_t susp_entry_ce_length;
+       int64_t susp_dot_ce_length;
+       int64_t susp_dot_dot_ce_length;
 
        /* Data to put at the end of the System Use field */
-       int su_tail_size;
+       int64_t su_tail_size;
        char *su_tail_data;
 
        /*** PATH TABLE STUFF ***/
@@ -234,7 +231,7 @@
 typedef struct _volume_descriptor
 {
        u_char *volumeDescriptorData; /*ALWAYS 2048 bytes long*/
-       int sector;
+       int64_t sector;
        struct _volume_descriptor *next;
 } volume_descriptor;
 
@@ -251,22 +248,22 @@
 
        /* Important sector numbers here */
        /* primaryDescriptor.type_l_path_table*/
-       int primaryBigEndianTableSector;
+       int64_t primaryBigEndianTableSector;
 
        /* primaryDescriptor.type_m_path_table*/
-       int primaryLittleEndianTableSector;
+       int64_t primaryLittleEndianTableSector;
 
        /* primaryDescriptor.opt_type_l_path_table*/
-       int secondaryBigEndianTableSector;
+       int64_t secondaryBigEndianTableSector;
 
        /* primaryDescriptor.opt_type_m_path_table*/
-       int secondaryLittleEndianTableSector;
+       int64_t secondaryLittleEndianTableSector;
 
        /* primaryDescriptor.path_table_size*/
        int pathTableLength;
-       int dataFirstSector;
+       int64_t dataFirstSector;
 
-       int totalSectors;
+       int64_t totalSectors;
        /* OPTIONS GO HERE */
        int     isoLevel;
 
@@ -278,9 +275,9 @@
        int keep_bad_images;
 
        /* SUSP options and variables */
-       int susp_continuation_area_start_sector;
-       int susp_continuation_area_size;
-       int susp_continuation_area_current_free;
+       int64_t susp_continuation_area_start_sector;
+       int64_t susp_continuation_area_size;
+       int64_t susp_continuation_area_current_free;
 
        int rock_ridge_enabled;
        /* Other Rock Ridge Variables */
@@ -304,7 +301,7 @@
        char *generic_bootimage;
 
        int is_bootable;/* Default to 0 */
-       int boot_catalog_sector;
+       int64_t boot_catalog_sector;
        boot_volume_descriptor *boot_descriptor;
        char * boot_image_directory;
 
Index: cd9660/cd9660_debug.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/makefs/cd9660/cd9660_debug.c,v
retrieving revision 1.10
diff -u -u -r1.10 cd9660_debug.c
--- cd9660/cd9660_debug.c       22 Oct 2010 00:49:15 -0000      1.10
+++ cd9660/cd9660_debug.c       22 Oct 2010 20:59:49 -0000
@@ -105,12 +105,12 @@
                printf("..(%i)\n",
                    isonum_733(node->isoDirRecord->extent));
        } else if (node->isoDirRecord->name[0]=='\0') {
-               printf("(ROOT) (%i to %i)\n",
+               printf("(ROOT) (%" PRIu32 " to %" PRId64 ")\n",
                    node->fileDataSector,
                    node->fileDataSector +
                        node->fileSectorsUsed - 1);
        } else {
-               printf("%s (%s) (%i to %i)\n",
+               printf("%s (%s) (%" PRIu32 " to %" PRId64 ")\n",
                    node->isoDirRecord->name,
                    (node->isoDirRecord->flags[0]
                        & ISO_FLAG_DIRECTORY) ?  "DIR" : "FILE",
@@ -160,7 +160,8 @@
        while (tmp != NULL) {
                memset(temp, 0, CD9660_SECTOR_SIZE);
                memcpy(temp, tmp->volumeDescriptorData + 1, 5);
-               printf("Volume descriptor in sector %i: type %i, ID %s\n",
+               printf("Volume descriptor in sector %" PRId64
+                   ": type %i, ID %s\n",
                    tmp->sector, tmp->volumeDescriptorData[0], temp);
                switch(tmp->volumeDescriptorData[0]) {
                case 0:/*boot record*/
Index: cd9660/cd9660_eltorito.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/makefs/cd9660/cd9660_eltorito.c,v
retrieving revision 1.13
diff -u -u -r1.13 cd9660_eltorito.c
--- cd9660/cd9660_eltorito.c    22 Oct 2010 00:49:15 -0000      1.13
+++ cd9660/cd9660_eltorito.c    22 Oct 2010 20:59:49 -0000
@@ -511,7 +511,7 @@
                err(1, "fseeko");
 
        if (diskStructure.verbose_level > 0) {
-               printf("Writing boot catalog to sector %d\n",
+               printf("Writing boot catalog to sector %" PRId64 "\n",
                    diskStructure.boot_catalog_sector);
        }
        LIST_FOREACH(e, &diskStructure.boot_entries, ll_struct) {


Home | Main Index | Thread Index | Old Index