Skip to contentSkip to conversation

RDS: use gfp flags from caller in conn_alloc()

PATCH Applied Dan Carpenter 3 participants 3 messages Mar 22, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDS: use gfp flags from caller in conn_alloc()

We should be using the gfp flags the caller specified here, instead of GFP_KERNEL. I think this might be a bugfix, depending on the value of "sock->sk->sk_allocation" when we call rds_conn_create_outgoing() in rds_sendmsg(). Otherwise, it's just a cleanup.

net/rds/loop.c +1 -1
index 87ff2a8..6b12b68 100644
@@ -121,7 +121,7 @@ static int rds_loop_conn_alloc(struct rds_connection *conn, gfp_t gfp)
 	struct rds_loop_connection *lc;
 	unsigned long flags;
 
-	lc = kzalloc(sizeof(struct rds_loop_connection), GFP_KERNEL);
+	lc = kzalloc(sizeof(struct rds_loop_connection), gfp);
 	if (!lc)
 		return -ENOMEM;
 
net/rds/iw_cm.c +1 -1
index 9556d28..a91e1db 100644
@@ -694,7 +694,7 @@ int rds_iw_conn_alloc(struct rds_connection *conn, gfp_t gfp)
 	unsigned long flags;
 
 	/* XXX too lazy? */
-	ic = kzalloc(sizeof(struct rds_iw_connection), GFP_KERNEL);
+	ic = kzalloc(sizeof(struct rds_iw_connection), gfp);
 	if (!ic)
 		return -ENOMEM;
 
net/rds/ib_cm.c +1 -1
index 51c8689..a1e1162 100644
@@ -749,7 +749,7 @@ int rds_ib_conn_alloc(struct rds_connection *conn, gfp_t gfp)
 	int ret;
 
 	/* XXX too lazy? */
-	ic = kzalloc(sizeof(struct rds_ib_connection), GFP_KERNEL);
+	ic = kzalloc(sizeof(struct rds_ib_connection), gfp);
 	if (!ic)
 		return -ENOMEM;
 
maintainer Applied
#2 lore raw

From: Venkat Venkatsubra <[email protected]>
Date: Thu, 22 Mar 2012 10:19:50 -0500

Quoted 8 lines · Dan Carpenter
Quoted 6 lines

We should be using the gfp flags the caller specified here, instead of GFP_KERNEL. I think this might be a bugfix, depending on the value of "sock->sk->sk_allocation" when we call rds_conn_create_outgoing() in rds_sendmsg(). Otherwise, it's just a cleanup.

Applied.