]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
NFSv4.1: clean up nfs4_recall_slot to use nfs4_alloc_slots
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 20 Nov 2012 00:50:45 +0000 (19:50 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 21 Nov 2012 14:29:53 +0000 (09:29 -0500)
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/nfs4_fs.h
fs/nfs/nfs4proc.c
fs/nfs/nfs4state.c

index a525fdefccdeb475edb9468c1467e6196db20246..36880b9aa91e8ec334fee0845f9df6c53f6c1367 100644 (file)
@@ -258,6 +258,8 @@ extern int nfs4_proc_get_lease_time(struct nfs_client *clp,
 extern int nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data,
                                  bool sync);
 
+extern struct nfs4_slot *nfs4_alloc_slots(u32 max_slots, gfp_t gfp_flags);
+
 static inline bool
 is_ds_only_client(struct nfs_client *clp)
 {
index 0402ebb9b4907d7b10b92453e4faa08962a4a99c..5e5cc5a5065f887de9975a08bdcf520569bdbb30 100644 (file)
@@ -5656,7 +5656,7 @@ int nfs4_proc_get_lease_time(struct nfs_client *clp, struct nfs_fsinfo *fsinfo)
        return status;
 }
 
-static struct nfs4_slot *nfs4_alloc_slots(u32 max_slots, gfp_t gfp_flags)
+struct nfs4_slot *nfs4_alloc_slots(u32 max_slots, gfp_t gfp_flags)
 {
        return kmalloc_array(max_slots, sizeof(struct nfs4_slot), gfp_flags);
 }
index f3d1bc48c9c4a273d99ba86e58b2f12e70154a4a..96fcbb97fd6a12fd7ab1ba758562053a21218f3c 100644 (file)
@@ -2033,8 +2033,7 @@ static int nfs4_recall_slot(struct nfs_client *clp)
                return 0;
        nfs4_begin_drain_session(clp);
        fc_tbl = &clp->cl_session->fc_slot_table;
-       new = kmalloc(fc_tbl->target_max_slots * sizeof(struct nfs4_slot),
-                     GFP_NOFS);
+       new = nfs4_alloc_slots(fc_tbl->target_max_slots, GFP_NOFS);
         if (!new)
                return -ENOMEM;