FreeBSD Bugzilla – Attachment 110654 Details for
Bug 151850
[patch] style cleanups to newfs_msdosfs(8)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.36 KB, created by
Pedro F. Giffuni
on 2010-11-01 00:00:21 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Pedro F. Giffuni
Created:
2010-11-01 00:00:21 UTC
Size:
2.36 KB
patch
obsolete
>--- newfs_msdos.c.orig 2010-04-03 12:36:58.000000000 +0000 >+++ newfs_msdos.c 2010-04-03 17:18:12.000000000 +0000 >@@ -55,6 +55,7 @@ > #define NPB 2 /* nibbles per byte */ > > #define DOSMAGIC 0xaa55 /* DOS magic number */ >+#define MAXBPS 4096 /* maximum bytes per sector */ > #define MINBPS 512 /* minimum bytes per sector */ > #define MAXSPC 128 /* maximum sectors per cluster */ > #define MAXNFT 16 /* maximum number of FATs */ >@@ -406,24 +407,29 @@ > (int)delta, bpb.bpbSecPerTrack); > bpb.bpbHugeSectors -= delta; > } >- if (bpb.bpbSecPerClust == 0) { /* set defaults */ >- if (bpb.bpbHugeSectors <= 6000) /* about 3MB -> 512 bytes */ >- bpb.bpbSecPerClust = 1; >- else if (bpb.bpbHugeSectors <= (1<<17)) /* 64M -> 4k */ >- bpb.bpbSecPerClust = 8; >- else if (bpb.bpbHugeSectors <= (1<<19)) /* 256M -> 8k */ >- bpb.bpbSecPerClust = 16; >- else if (bpb.bpbHugeSectors <= (1<<21)) /* 1G -> 16k */ >- bpb.bpbSecPerClust = 32; >- else >- bpb.bpbSecPerClust = 64; /* otherwise 32k */ >- } >+ else >+ bpb.bpbSecPerClust /= (bpb.bpbBytesPerSec / MINBPS); >+ } >+ if (bpb.bpbSecPerClust == 0) { /* set defaults */ >+ if (bpb.bpbHugeSectors <= 6000) /* about 3MB -> 512 bytes */ >+ bpb.bpbSecPerClust = 1; >+ else if (bpb.bpbHugeSectors <= (1<<17)) /* 64M -> 4k */ >+ bpb.bpbSecPerClust = 8; >+ else if (bpb.bpbHugeSectors <= (1<<19)) /* 256M -> 8k */ >+ bpb.bpbSecPerClust = 16; >+ else if (bpb.bpbHugeSectors <= (1<<21)) /* 1G -> 16k */ >+ bpb.bpbSecPerClust = 32; >+ else >+ bpb.bpbSecPerClust = 64; /* otherwise 32k */ > } > if (!powerof2(bpb.bpbBytesPerSec)) > errx(1, "bytes/sector (%u) is not a power of 2", bpb.bpbBytesPerSec); > if (bpb.bpbBytesPerSec < MINBPS) > errx(1, "bytes/sector (%u) is too small; minimum is %u", > bpb.bpbBytesPerSec, MINBPS); >+ if (bpb.bpbBytesPerSec > MAXBPS) >+ printf( "WARNING: bytes/sector (%u) is bigger than %u", >+ bpb.bpbBytesPerSec, MAXBPS); > if (!(fat = opt_F)) { > if (opt_f) > fat = 12; >@@ -447,6 +453,9 @@ > opt_b, bpb.bpbBytesPerSec * MAXSPC); > bpb.bpbSecPerClust = opt_b / bpb.bpbBytesPerSec; > } >+ if (bpb.bpbSecPerClust * bpb.bpbBytesPerSec > 32 * 1024) >+ printf("WARNING: bytes per sector (%u) is greater than 32K", >+ bpb.bpbSecPerClust * bpb.bpbBytesPerSec); > if (opt_c) { > if (!powerof2(opt_c)) > errx(1, "sectors/cluster (%u) is not a power of 2", opt_c);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 151850
: 110654 |
110655