Re: [Gluster-users] glusterfs-3.0.0 on solaris 10x86 - my first patch

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

 



Greetings,

I successfully compile glusterfs-3.0.0 on OpenSolaris 2009.06 !

It's first dirty patch, please review it!

Problems:

1) /glusterfs-3.0.0/libglusterfs/src/xlator.h
O_ASYNC is not POSIX. Solaris doesnt support it. You should look at Solaris AIO. We
should do it with #ifdefs.
http://sunsite.uakom.sk/sunworldonline/swol-03-1996/swol-03-aio.html

2) glusterfs-3.0.0/glusterfsd/src/glusterfsd.c
 a) declare it: sighandler_t
 b) gf_proc_dump_info - not posix

3) /glusterfs-3.0.0/xlators/storage/posix/src/posix.h
 a) FTW_CONTINUE - not posix

Thanx!
p.s.
I'm attach patch, and it's aval. for downloading from our website http://node3.rnode.ru/glusterfs-3.0.0-p1.patch


WBR
diff -ruN a/glusterfs-3.0.0/glusterfsd/src/glusterfsd.c b/glusterfs-3.0.0/glusterfsd/src/glusterfsd.c
--- a/glusterfs-3.0.0/glusterfsd/src/glusterfsd.c	2009-12-08 09:24:06.000000000 +0300
+++ b/glusterfs-3.0.0/glusterfsd/src/glusterfsd.c	2009-12-11 10:52:54.783465854 +0300
@@ -928,7 +928,7 @@
         gf_log ("glusterfs", GF_LOG_WARNING, "shutting down");
 
         if (ctx->pidfp) {
-                flock (fileno (ctx->pidfp), LOCK_UN);
+                lockf (fileno (ctx->pidfp), F_ULOCK, 0);
                 fclose (ctx->pidfp);
                 ctx->pidfp = NULL;
         }
@@ -1201,7 +1201,10 @@
 #ifdef DEBUG
         mtrace ();
 #endif
+/*
         signal (SIGUSR1, (sighandler_t) gf_proc_dump_info);
+*/
+        signal (SIGUSR1, gf_proc_dump_info);
         signal (SIGSEGV, gf_print_trace);
         signal (SIGABRT, gf_print_trace);
         signal (SIGPIPE, SIG_IGN);
@@ -1285,8 +1288,8 @@
                                 /* do cleanup and exit ?! */
                                 return -1;
                         }
-                        ret = flock (fileno (ctx->pidfp),
-                                     (LOCK_EX | LOCK_NB));
+                        ret = lockf (fileno (ctx->pidfp),
+                                     (F_LOCK | F_TLOCK), 0);
                         if (ret == -1) {
                                 gf_log ("glusterfs", GF_LOG_ERROR,
                                         "Is another instance of %s running?",
@@ -1305,7 +1308,7 @@
                                         "unable to truncate file %s. %s.",
                                         cmd_args->pid_file,
                                         strerror (errno));
-                                flock (fileno (ctx->pidfp), LOCK_UN);
+                                lockf (fileno (ctx->pidfp), F_ULOCK, 0);
                                 fclose (ctx->pidfp);
                                 if (write (pipe_fd[1], &gf_failure,
                                            sizeof (int)) < 0) {
diff -ruN a/glusterfs-3.0.0/libglusterfs/src/logging.h b/glusterfs-3.0.0/libglusterfs/src/logging.h
--- a/glusterfs-3.0.0/libglusterfs/src/logging.h	2009-12-08 09:24:06.000000000 +0300
+++ b/glusterfs-3.0.0/libglusterfs/src/logging.h	2009-12-11 12:40:42.375623813 +0300
@@ -28,6 +28,7 @@
 
 #include <stdint.h>
 #include <stdio.h>  
+#include <stdarg.h>
 
 #define GF_PRI_FSBLK       PRId64
 #define GF_PRI_BLKSIZE     "ld"
diff -ruN a/glusterfs-3.0.0/libglusterfs/src/xlator.h b/glusterfs-3.0.0/libglusterfs/src/xlator.h
--- a/glusterfs-3.0.0/libglusterfs/src/xlator.h	2009-12-08 09:24:06.000000000 +0300
+++ b/glusterfs-3.0.0/libglusterfs/src/xlator.h	2009-12-09 22:31:37.000000000 +0300
@@ -964,3 +964,12 @@
 
 #endif /* _XLATOR_H */
 
+#ifndef O_ASYNC
+# ifdef FASYNC
+# define O_ASYNC FASYNC
+# else
+# define O_ASYNC 0
+# endif
+#endif
+
+
diff -ruN a/glusterfs-3.0.0/xlators/storage/posix/src/posix.h b/glusterfs-3.0.0/xlators/storage/posix/src/posix.h
--- a/glusterfs-3.0.0/xlators/storage/posix/src/posix.h	2009-12-08 09:24:06.000000000 +0300
+++ b/glusterfs-3.0.0/xlators/storage/posix/src/posix.h	2009-12-09 23:21:07.000000000 +0300
@@ -132,3 +132,7 @@
         } while (0)
 
 #endif /* _POSIX_H */
+
+#ifndef FTW_CONTINUE
+# define FTW_CONTINUE 0
+#endif

[Index of Archives]     [Gluster Users]     [Ceph Users]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux