diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2017-05-09 16:02:57 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2017-05-09 16:02:57 -0400 |
commit | 76b2a303384e1d6299c3a0249f0f0ce2f8f96017 (patch) | |
tree | 3fac401ef4767578191971cf6c363a8b5aaafabc /fs/nfs/flexfilelayout/flexfilelayout.c | |
parent | f4b23de3dda1536590787c9e5c3d16b8738ab108 (diff) | |
download | linux-76b2a303384e1d6299c3a0249f0f0ce2f8f96017.tar.gz linux-76b2a303384e1d6299c3a0249f0f0ce2f8f96017.tar.bz2 linux-76b2a303384e1d6299c3a0249f0f0ce2f8f96017.zip |
pNFS/flexfiles: Always attempt to call layoutstats when flexfiles is enabled
Layoutstats is always desirable when using the flexfiles driver, so
we should enable it if that driver is being loaded. It is safe to do
so, because even when the mount specifies NFSv4.1, we will turn it
off if the server tells us it is unsupported.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/flexfilelayout/flexfilelayout.c')
-rw-r--r-- | fs/nfs/flexfilelayout/flexfilelayout.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index 4e8bf02a62f9..f5714ee01000 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c @@ -2361,10 +2361,21 @@ ff_layout_prepare_layoutstats(struct nfs42_layoutstat_args *args) return 0; } +static int +ff_layout_set_layoutdriver(struct nfs_server *server, + const struct nfs_fh *dummy) +{ +#if IS_ENABLED(CONFIG_NFS_V4_2) + server->caps |= NFS_CAP_LAYOUTSTATS; +#endif + return 0; +} + static struct pnfs_layoutdriver_type flexfilelayout_type = { .id = LAYOUT_FLEX_FILES, .name = "LAYOUT_FLEX_FILES", .owner = THIS_MODULE, + .set_layoutdriver = ff_layout_set_layoutdriver, .alloc_layout_hdr = ff_layout_alloc_layout_hdr, .free_layout_hdr = ff_layout_free_layout_hdr, .alloc_lseg = ff_layout_alloc_lseg, |