Преглед изворни кода

NFS: Cleanup file handle allocations in fs/nfs/super.c

Use the new helper functions instead of open coding.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Trond Myklebust пре 15 година
родитељ
комит
b157b06ca2
1 измењених фајлова са 4 додато и 4 уклоњено
  1. 4 4
      fs/nfs/super.c

+ 4 - 4
fs/nfs/super.c

@@ -2176,7 +2176,7 @@ static int nfs_get_sb(struct file_system_type *fs_type,
 	int error = -ENOMEM;
 	int error = -ENOMEM;
 
 
 	data = nfs_alloc_parsed_mount_data(3);
 	data = nfs_alloc_parsed_mount_data(3);
-	mntfh = kzalloc(sizeof(*mntfh), GFP_KERNEL);
+	mntfh = nfs_alloc_fhandle();
 	if (data == NULL || mntfh == NULL)
 	if (data == NULL || mntfh == NULL)
 		goto out_free_fh;
 		goto out_free_fh;
 
 
@@ -2251,7 +2251,7 @@ out:
 	kfree(data->fscache_uniq);
 	kfree(data->fscache_uniq);
 	security_free_mnt_opts(&data->lsm_opts);
 	security_free_mnt_opts(&data->lsm_opts);
 out_free_fh:
 out_free_fh:
-	kfree(mntfh);
+	nfs_free_fhandle(mntfh);
 	kfree(data);
 	kfree(data);
 	return error;
 	return error;
 
 
@@ -2560,7 +2560,7 @@ static int nfs4_remote_get_sb(struct file_system_type *fs_type,
 	};
 	};
 	int error = -ENOMEM;
 	int error = -ENOMEM;
 
 
-	mntfh = kzalloc(sizeof(*mntfh), GFP_KERNEL);
+	mntfh = nfs_alloc_fhandle();
 	if (data == NULL || mntfh == NULL)
 	if (data == NULL || mntfh == NULL)
 		goto out_free_fh;
 		goto out_free_fh;
 
 
@@ -2618,7 +2618,7 @@ static int nfs4_remote_get_sb(struct file_system_type *fs_type,
 out:
 out:
 	security_free_mnt_opts(&data->lsm_opts);
 	security_free_mnt_opts(&data->lsm_opts);
 out_free_fh:
 out_free_fh:
-	kfree(mntfh);
+	nfs_free_fhandle(mntfh);
 	return error;
 	return error;
 
 
 out_free:
 out_free: