rpms/iscsitarget/devel iscsitarget-0.4.15-qelem.patch, NONE, 1.1 iscsitarget.spec, 1.1, 1.2

Hans de Goede jwrdegoede at rpmfusion.org
Wed Oct 15 13:58:32 CEST 2008


Author: jwrdegoede

Update of /cvs/free/rpms/iscsitarget/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv19789

Modified Files:
	iscsitarget.spec 
Added Files:
	iscsitarget-0.4.15-qelem.patch 
Log Message:
* Wed Oct 15 2008 Hans de Goede <j.w.r.degoede at hhs.nl> - 1:0.4.15-11.svn142
- Fix building with latest glibc (needs _GNU_SOURCE to be defined)


iscsitarget-0.4.15-qelem.patch:

--- NEW FILE iscsitarget-0.4.15-qelem.patch ---
diff -up iscsitarget-0.4.15/usr/iscsid.h.qelem iscsitarget-0.4.15/usr/iscsid.h
--- iscsitarget-0.4.15/usr/iscsid.h.qelem	2006-09-25 11:08:51.000000000 +0200
+++ iscsitarget-0.4.15/usr/iscsid.h	2008-10-15 13:55:01.000000000 +0200
@@ -32,7 +32,7 @@ struct PDU {
 #define KEY_STATE_DONE		2
 
 struct session {
-	struct qelem slist;
+	struct q_elem slist;
 
 	char *initiator;
 	struct target *target;
@@ -122,9 +122,9 @@ struct connection {
 #define INCOMING_BUFSIZE	8192
 
 struct target {
-	struct qelem tlist;
+	struct q_elem tlist;
 
-	struct qelem sessions_list;
+	struct q_elem sessions_list;
 
 	u32 tid;
 	char name[ISCSI_NAME_LEN];
@@ -133,7 +133,7 @@ struct target {
 	int max_nr_sessions;
 	int nr_sessions;
 
-	struct qelem isns_head;
+	struct q_elem isns_head;
 };
 
 /* chap.c */
@@ -180,7 +180,7 @@ extern void session_create(struct connec
 extern void session_remove(struct session *session);
 
 /* target.c */
-extern struct qelem targets_list;
+extern struct q_elem targets_list;
 extern int target_add(u32 *, char *);
 extern int target_del(u32);
 extern u32 target_find_by_name(const char *name);
diff -up iscsitarget-0.4.15/usr/isns.c.qelem iscsitarget-0.4.15/usr/isns.c
--- iscsitarget-0.4.15/usr/isns.c.qelem	2008-10-15 13:50:14.000000000 +0200
+++ iscsitarget-0.4.15/usr/isns.c	2008-10-15 13:55:01.000000000 +0200
@@ -44,12 +44,12 @@ struct isns_io {
 struct isns_qry_mgmt {
 	char name[ISCSI_NAME_LEN];
 	uint16_t transaction;
-	struct qelem qlist;
+	struct q_elem qlist;
 };
 
 struct isns_initiator {
 	char name[ISCSI_NAME_LEN];
-	struct qelem ilist;
+	struct q_elem ilist;
 };
 
 static LIST_HEAD(qry_list);
diff -up iscsitarget-0.4.15/usr/misc.h.qelem iscsitarget-0.4.15/usr/misc.h
--- iscsitarget-0.4.15/usr/misc.h.qelem	2006-08-15 01:58:34.000000000 +0200
+++ iscsitarget-0.4.15/usr/misc.h	2008-10-15 13:55:01.000000000 +0200
@@ -5,9 +5,9 @@
 #ifndef MISC_H
 #define MISC_H
 
-struct qelem {
-	struct qelem *q_forw;
-	struct qelem *q_back;
+struct q_elem {
+	struct q_elem *q_forw;
+	struct q_elem *q_back;
 };
 
 /* stolen list stuff from Linux kernel */
@@ -21,18 +21,18 @@ struct qelem {
 
 #define LIST_HEAD_INIT(name) { &(name), &(name) }
 #define LIST_HEAD(name) \
-	struct qelem name = LIST_HEAD_INIT(name)
+	struct q_elem name = LIST_HEAD_INIT(name)
 
 #define INIT_LIST_HEAD(ptr) do { \
 	(ptr)->q_forw = (ptr); (ptr)->q_back = (ptr); \
 } while (0)
 
-static inline int list_empty(const struct qelem *head)
+static inline int list_empty(const struct q_elem *head)
 {
 	return head->q_forw == head;
 }
 
-static inline int list_length_is_one(const struct qelem *head)
+static inline int list_length_is_one(const struct q_elem *head)
 {
         return head->q_forw == head->q_back;
 }
diff -up iscsitarget-0.4.15/usr/plain.c.qelem iscsitarget-0.4.15/usr/plain.c
--- iscsitarget-0.4.15/usr/plain.c.qelem	2007-04-10 09:44:48.000000000 +0200
+++ iscsitarget-0.4.15/usr/plain.c	2008-10-15 13:55:01.000000000 +0200
@@ -31,7 +31,7 @@
  */
 
 struct user {
-	struct qelem ulist;
+	struct q_elem ulist;
 
 	u32 tid;
 	char *name;
@@ -62,18 +62,18 @@ static struct iscsi_key user_keys[] = {
 	{NULL,},
 };
 
-static struct qelem discovery_users_in = LIST_HEAD_INIT(discovery_users_in);
-static struct qelem discovery_users_out = LIST_HEAD_INIT(discovery_users_out);
+static struct q_elem discovery_users_in = LIST_HEAD_INIT(discovery_users_in);
+static struct q_elem discovery_users_out = LIST_HEAD_INIT(discovery_users_out);
 
 #define HASH_ORDER	4
 #define acct_hash(x)	((x) & ((1 << HASH_ORDER) - 1))
 
-static struct qelem trgt_acct_in[1 << HASH_ORDER];
-static struct qelem trgt_acct_out[1 << HASH_ORDER];
+static struct q_elem trgt_acct_in[1 << HASH_ORDER];
+static struct q_elem trgt_acct_out[1 << HASH_ORDER];
 
-static struct qelem *account_list_get(u32 tid, int dir)
+static struct q_elem *account_list_get(u32 tid, int dir)
 {
-	struct qelem *list = NULL;
+	struct q_elem *list = NULL;
 
 	if (tid) {
 		list = (dir == AUTH_DIR_INCOMING) ?
@@ -125,7 +125,7 @@ static int plain_account_init(char *file
 /* Return the first account if the length of name is zero */
 static struct user *account_lookup_by_name(u32 tid, int dir, char *name)
 {
-	struct qelem *list = account_list_get(tid, dir);
+	struct q_elem *list = account_list_get(tid, dir);
 	struct user *user = NULL;
 
 	list_for_each_entry(user, list, ulist) {
@@ -196,7 +196,7 @@ static int plain_account_add(u32 tid, in
 {
 	int err = -ENOMEM;
 	struct user *user;
-	struct qelem *list;
+	struct q_elem *list;
 
 	if (!name || !pass)
 		return -EINVAL;
diff -up iscsitarget-0.4.15/usr/target.c.qelem iscsitarget-0.4.15/usr/target.c
--- iscsitarget-0.4.15/usr/target.c.qelem	2006-08-29 15:04:24.000000000 +0200
+++ iscsitarget-0.4.15/usr/target.c	2008-10-15 13:55:01.000000000 +0200
@@ -14,7 +14,7 @@
 
 #include "iscsid.h"
 
-struct qelem targets_list = LIST_HEAD_INIT(targets_list);
+struct q_elem targets_list = LIST_HEAD_INIT(targets_list);
 
 void target_list_build(struct connection *conn, char *addr, char *name)
 {


Index: iscsitarget.spec
===================================================================
RCS file: /cvs/free/rpms/iscsitarget/devel/iscsitarget.spec,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- iscsitarget.spec	3 Oct 2008 13:56:24 -0000	1.1
+++ iscsitarget.spec	15 Oct 2008 11:58:32 -0000	1.2
@@ -2,7 +2,7 @@
 
 Name:           iscsitarget
 Version:        0.4.15
-Release:        10.%{patchlevel}%{?dist}
+Release:        11.%{patchlevel}%{?dist}
 Epoch:          1
 Summary:        Utilities for iSCSI Enterprise Target 
 
@@ -15,6 +15,8 @@
 #       http://svn.berlios.de/svnroot/repos/iscsitarget/trunk/@142
 Patch0:         iscsitarget-0.4.15-%{patchlevel}.patch
 Patch1:         iscsitarget-0.4.15-initscript.patch
+# rename qelem to q_elem to avoid name clash with glibc qelem
+Patch2:         iscsitarget-0.4.15-qelem.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 Requires:       %{name}-kmod >= %{epoch}:%{version}
@@ -36,10 +38,11 @@
 %setup -q
 %patch0 -p0 -b .%{patchlevel}
 %patch1 -p1 -b .initscript
+%patch2 -p1 -b .qelem
 
 
 %build
-make CFLAGS="%{optflags} -I../include" -C usr %{?_smp_flags}
+make CFLAGS="%{optflags} -I../include -D_GNU_SOURCE" -C usr %{?_smp_flags}
 
 
 %install
@@ -80,6 +83,9 @@
 
 
 %changelog
+* Wed Oct 15 2008 Hans de Goede <j.w.r.degoede at hhs.nl> - 1:0.4.15-11.svn142
+- Fix building with latest glibc (needs _GNU_SOURCE to be defined)
+
 * Fri Oct 03 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info - 1:0.4.15-10.svn142
 - rebuild for rpm fusion
 



More information about the rpmfusion-commits mailing list