diff mbox

[2/6] Fedora 18 - build-fixes.patch

Message ID 1358618781-26629-3-git-send-email-gene@czarc.net (mailing list archive)
State New, archived
Headers show

Commit Message

Gene Czarcinski Jan. 19, 2013, 6:06 p.m. UTC
Signed-off-by: Gene Czarcinski <gene@czarc.net>
---
 btrfsck.c | 2 ++
 mkfs.c    | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Gene Czarcinski Jan. 22, 2013, 9:25 p.m. UTC | #1
I believe that this if the likely source of this patch:
http://article.gmane.org/gmane.comp.file-systems.btrfs/4547

I do wonder how much this is still applicable.  However, it has been in 
the btrfs-progs package for Fedora 15, 16, 17, and 18 plus likely some 
versions of RHEL.

On 01/19/2013 01:06 PM, Gene Czarcinski wrote:
> Signed-off-by: Gene Czarcinski <gene@czarc.net>
> ---
>   btrfsck.c | 2 ++
>   mkfs.c    | 4 ++--
>   2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/btrfsck.c b/btrfsck.c
> index a851008..6274ff7 100644
> --- a/btrfsck.c
> +++ b/btrfsck.c
> @@ -22,7 +22,9 @@
>   #include <stdlib.h>
>   #include <unistd.h>
>   #include <fcntl.h>
> +#include <sys/types.h>
>   #include <sys/stat.h>
> +#include <unistd.h>
>   #include <getopt.h>
>   #include "kerncompat.h"
>   #include "ctree.h"
> diff --git a/mkfs.c b/mkfs.c
> index fbf8319..d123d5f 100644
> --- a/mkfs.c
> +++ b/mkfs.c
> @@ -1206,7 +1206,7 @@ int main(int ac, char **av)
>   	u64 alloc_start = 0;
>   	u64 metadata_profile = 0;
>   	u64 data_profile = 0;
> -	u32 leafsize = getpagesize();
> +	u32 leafsize = sysconf(_SC_PAGESIZE);
>   	u32 sectorsize = 4096;
>   	u32 nodesize = leafsize;
>   	u32 stripesize = 4096;
> @@ -1282,7 +1282,7 @@ int main(int ac, char **av)
>   				print_usage();
>   		}
>   	}
> -	sectorsize = max(sectorsize, (u32)getpagesize());
> +	sectorsize = max(sectorsize, (u32)sysconf(_SC_PAGESIZE));
>   	if (check_leaf_or_node_size(leafsize, sectorsize))
>   		exit(1);
>   	if (check_leaf_or_node_size(nodesize, sectorsize))

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Sterba Jan. 23, 2013, 6:12 p.m. UTC | #2
On Tue, Jan 22, 2013 at 04:25:44PM -0500, Gene Czarcinski wrote:
> I believe that this if the likely source of this patch:
> http://article.gmane.org/gmane.comp.file-systems.btrfs/4547

Thanks for the pointer.

> I do wonder how much this is still applicable.  However, it has been in the
> btrfs-progs package for Fedora 15, 16, 17, and 18 plus likely some versions
> of RHEL.

man getpagesize:

"Portable applications should employ sysconf(_SC_PAGESIZE) instead of getpagesize()"

added with the original changelog and s-o-b, modified the subject line
to say "Use sysconf instead of getpagesize".

david
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/btrfsck.c b/btrfsck.c
index a851008..6274ff7 100644
--- a/btrfsck.c
+++ b/btrfsck.c
@@ -22,7 +22,9 @@ 
 #include <stdlib.h>
 #include <unistd.h>
 #include <fcntl.h>
+#include <sys/types.h>
 #include <sys/stat.h>
+#include <unistd.h>
 #include <getopt.h>
 #include "kerncompat.h"
 #include "ctree.h"
diff --git a/mkfs.c b/mkfs.c
index fbf8319..d123d5f 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -1206,7 +1206,7 @@  int main(int ac, char **av)
 	u64 alloc_start = 0;
 	u64 metadata_profile = 0;
 	u64 data_profile = 0;
-	u32 leafsize = getpagesize();
+	u32 leafsize = sysconf(_SC_PAGESIZE);
 	u32 sectorsize = 4096;
 	u32 nodesize = leafsize;
 	u32 stripesize = 4096;
@@ -1282,7 +1282,7 @@  int main(int ac, char **av)
 				print_usage();
 		}
 	}
-	sectorsize = max(sectorsize, (u32)getpagesize());
+	sectorsize = max(sectorsize, (u32)sysconf(_SC_PAGESIZE));
 	if (check_leaf_or_node_size(leafsize, sectorsize))
 		exit(1);
 	if (check_leaf_or_node_size(nodesize, sectorsize))