2010-10-21 21:14:48

by Myklebust, Trond

[permalink] [raw]
Subject: [PATCH] NFSv4.1: Use more sensible names for 'initialize_mountpoint'

The initialize_mountpoint/uninitialise_mountpoint functions are really about
setting or clearing the layout driver to be used on this filesystem. Change
the names to the more descriptive 'set_layoutdriver/clear_layoutdriver'.

Signed-off-by: Trond Myklebust <[email protected]>
---
fs/nfs/nfs4filelayout.c | 14 +++++++-------
fs/nfs/pnfs.c | 4 ++--
fs/nfs/pnfs.h | 4 ++--
3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index 9e82b51..2e92f0d 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -40,8 +40,8 @@ MODULE_LICENSE("GPL");
MODULE_AUTHOR("Dean Hildebrand <[email protected]>");
MODULE_DESCRIPTION("The NFSv4 file layout driver");

-int
-filelayout_initialize_mountpoint(struct nfs_server *nfss)
+static int
+filelayout_set_layoutdriver(struct nfs_server *nfss)
{
int status = pnfs_alloc_init_deviceid_cache(nfss->nfs_client,
nfs4_fl_free_deviceid_callback);
@@ -55,9 +55,9 @@ filelayout_initialize_mountpoint(struct nfs_server *nfss)
return 0;
}

-/* Uninitialize a mountpoint by destroying its device list */
-int
-filelayout_uninitialize_mountpoint(struct nfs_server *nfss)
+/* Clear out the layout by destroying its device list */
+static int
+filelayout_clear_layoutdriver(struct nfs_server *nfss)
{
dprintk("--> %s\n", __func__);

@@ -256,8 +256,8 @@ static struct pnfs_layoutdriver_type filelayout_type = {
.id = LAYOUT_NFSV4_1_FILES,
.name = "LAYOUT_NFSV4_1_FILES",
.owner = THIS_MODULE,
- .initialize_mountpoint = filelayout_initialize_mountpoint,
- .uninitialize_mountpoint = filelayout_uninitialize_mountpoint,
+ .set_layoutdriver = filelayout_set_layoutdriver,
+ .clear_layoutdriver = filelayout_clear_layoutdriver,
.alloc_lseg = filelayout_alloc_lseg,
.free_lseg = filelayout_free_lseg,
};
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index d1ad7df..db77342 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -75,7 +75,7 @@ void
unset_pnfs_layoutdriver(struct nfs_server *nfss)
{
if (nfss->pnfs_curr_ld) {
- nfss->pnfs_curr_ld->uninitialize_mountpoint(nfss);
+ nfss->pnfs_curr_ld->clear_layoutdriver(nfss);
module_put(nfss->pnfs_curr_ld->owner);
}
nfss->pnfs_curr_ld = NULL;
@@ -115,7 +115,7 @@ set_pnfs_layoutdriver(struct nfs_server *server, u32 id)
goto out_no_driver;
}
server->pnfs_curr_ld = ld_type;
- if (ld_type->initialize_mountpoint(server)) {
+ if (ld_type->set_layoutdriver(server)) {
printk(KERN_ERR
"%s: Error initializing mount point for layout driver %u.\n",
__func__, id);
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index cbba28c..e12367d 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -53,8 +53,8 @@ struct pnfs_layoutdriver_type {
const u32 id;
const char *name;
struct module *owner;
- int (*initialize_mountpoint) (struct nfs_server *);
- int (*uninitialize_mountpoint) (struct nfs_server *);
+ int (*set_layoutdriver) (struct nfs_server *);
+ int (*clear_layoutdriver) (struct nfs_server *);
struct pnfs_layout_segment * (*alloc_lseg) (struct pnfs_layout_hdr *layoutid, struct nfs4_layoutget_res *lgr);
void (*free_lseg) (struct pnfs_layout_segment *lseg);
};
--
1.7.2.3



2010-10-22 01:53:27

by Fred Isaman

[permalink] [raw]
Subject: Re: [PATCH] NFSv4.1: Use more sensible names for 'initialize_mountpoint'

Looks good to me.

=46red


On Thu, Oct 21, 2010 at 5:14 PM, Trond Myklebust
<[email protected]> wrote:
> The initialize_mountpoint/uninitialise_mountpoint functions are reall=
y about
> setting or clearing the layout driver to be used on this filesystem. =
Change
> the names to the more descriptive 'set_layoutdriver/clear_layoutdrive=
r'.
>
> Signed-off-by: Trond Myklebust <[email protected]>
> ---
> =A0fs/nfs/nfs4filelayout.c | =A0 14 +++++++-------
> =A0fs/nfs/pnfs.c =A0 =A0 =A0 =A0 =A0 | =A0 =A04 ++--
> =A0fs/nfs/pnfs.h =A0 =A0 =A0 =A0 =A0 | =A0 =A04 ++--
> =A03 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
> index 9e82b51..2e92f0d 100644
> --- a/fs/nfs/nfs4filelayout.c
> +++ b/fs/nfs/nfs4filelayout.c
> @@ -40,8 +40,8 @@ MODULE_LICENSE("GPL");
> =A0MODULE_AUTHOR("Dean Hildebrand <[email protected]>");
> =A0MODULE_DESCRIPTION("The NFSv4 file layout driver");
>
> -int
> -filelayout_initialize_mountpoint(struct nfs_server *nfss)
> +static int
> +filelayout_set_layoutdriver(struct nfs_server *nfss)
> =A0{
> =A0 =A0 =A0 =A0int status =3D pnfs_alloc_init_deviceid_cache(nfss->nf=
s_client,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 =A0 =A0nfs4_fl_free_deviceid_callback);
> @@ -55,9 +55,9 @@ filelayout_initialize_mountpoint(struct nfs_server =
*nfss)
> =A0 =A0 =A0 =A0return 0;
> =A0}
>
> -/* Uninitialize a mountpoint by destroying its device list */
> -int
> -filelayout_uninitialize_mountpoint(struct nfs_server *nfss)
> +/* Clear out the layout by destroying its device list */
> +static int
> +filelayout_clear_layoutdriver(struct nfs_server *nfss)
> =A0{
> =A0 =A0 =A0 =A0dprintk("--> %s\n", __func__);
>
> @@ -256,8 +256,8 @@ static struct pnfs_layoutdriver_type filelayout_t=
ype =3D {
> =A0 =A0 =A0 =A0.id =3D LAYOUT_NFSV4_1_FILES,
> =A0 =A0 =A0 =A0.name =3D "LAYOUT_NFSV4_1_FILES",
> =A0 =A0 =A0 =A0.owner =3D THIS_MODULE,
> - =A0 =A0 =A0 .initialize_mountpoint =A0 =3D filelayout_initialize_mo=
untpoint,
> - =A0 =A0 =A0 .uninitialize_mountpoint =3D filelayout_uninitialize_mo=
untpoint,
> + =A0 =A0 =A0 .set_layoutdriver =3D filelayout_set_layoutdriver,
> + =A0 =A0 =A0 .clear_layoutdriver =3D filelayout_clear_layoutdriver,
> =A0 =A0 =A0 =A0.alloc_lseg =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D filelayout_=
alloc_lseg,
> =A0 =A0 =A0 =A0.free_lseg =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D filelayout_=
free_lseg,
> =A0};
> diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
> index d1ad7df..db77342 100644
> --- a/fs/nfs/pnfs.c
> +++ b/fs/nfs/pnfs.c
> @@ -75,7 +75,7 @@ void
> =A0unset_pnfs_layoutdriver(struct nfs_server *nfss)
> =A0{
> =A0 =A0 =A0 =A0if (nfss->pnfs_curr_ld) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 nfss->pnfs_curr_ld->uninitialize_mountp=
oint(nfss);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 nfss->pnfs_curr_ld->clear_layoutdriver(=
nfss);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0module_put(nfss->pnfs_curr_ld->owner);
> =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0nfss->pnfs_curr_ld =3D NULL;
> @@ -115,7 +115,7 @@ set_pnfs_layoutdriver(struct nfs_server *server, =
u32 id)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto out_no_driver;
> =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0server->pnfs_curr_ld =3D ld_type;
> - =A0 =A0 =A0 if (ld_type->initialize_mountpoint(server)) {
> + =A0 =A0 =A0 if (ld_type->set_layoutdriver(server)) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printk(KERN_ERR
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "%s: Error initializing m=
ount point for layout driver %u.\n",
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 __func__, id);
> diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
> index cbba28c..e12367d 100644
> --- a/fs/nfs/pnfs.h
> +++ b/fs/nfs/pnfs.h
> @@ -53,8 +53,8 @@ struct pnfs_layoutdriver_type {
> =A0 =A0 =A0 =A0const u32 id;
> =A0 =A0 =A0 =A0const char *name;
> =A0 =A0 =A0 =A0struct module *owner;
> - =A0 =A0 =A0 int (*initialize_mountpoint) (struct nfs_server *);
> - =A0 =A0 =A0 int (*uninitialize_mountpoint) (struct nfs_server *);
> + =A0 =A0 =A0 int (*set_layoutdriver) (struct nfs_server *);
> + =A0 =A0 =A0 int (*clear_layoutdriver) (struct nfs_server *);
> =A0 =A0 =A0 =A0struct pnfs_layout_segment * (*alloc_lseg) (struct pnf=
s_layout_hdr *layoutid, struct nfs4_layoutget_res *lgr);
> =A0 =A0 =A0 =A0void (*free_lseg) (struct pnfs_layout_segment *lseg);
> =A0};
> --
> 1.7.2.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" =
in
> the body of a message to [email protected]
> More majordomo info at =A0http://vger.kernel.org/majordomo-info.html
>