lkml.org 
[lkml]   [2009]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[RFC 4/5] nfs, support pathconf(3) with _PC_LINK_MAX
    Date
    Return the value via struct statfs.f_spare[0], based upon PATHCONF
    procedure. As namemax, it is set to a new member in struct nfs_server,
    named linkmax.
    Since NFSv2 (v4 too?) doesn't have PATHCONF procedure, it will be set to
    LINK_MAX_DEFAULT which is a default value of GLibc implementation.

    Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp>
    ---
    fs/nfs/client.c | 10 +++++++---
    fs/nfs/super.c | 1 +
    include/linux/nfs_fs_sb.h | 1 +
    3 files changed, 9 insertions(+), 3 deletions(-)

    diff --git a/fs/nfs/client.c b/fs/nfs/client.c
    index 99ea196..ed3fddd 100644
    --- a/fs/nfs/client.c
    +++ b/fs/nfs/client.c
    @@ -851,6 +851,7 @@ static int nfs_init_server(struct nfs_server *server,
    server->mountd_protocol = data->mount_server.protocol;

    server->namelen = data->namlen;
    + server->linkmax = LINK_MAX_DEFAULT;
    /* Create a client RPC handle for the NFSv3 ACL management interface */
    nfs_init_server_aclclient(server);
    dprintk("<-- nfs_init_server() = 0 [new %p]\n", clp);
    @@ -941,14 +942,17 @@ static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, str
    nfs_server_set_fsinfo(server, &fsinfo);

    /* Get some general file system info */
    - if (server->namelen == 0) {
    + {
    struct nfs_pathconf pathinfo;

    pathinfo.fattr = fattr;
    nfs_fattr_init(fattr);

    - if (clp->rpc_ops->pathconf(server, mntfh, &pathinfo) >= 0)
    - server->namelen = pathinfo.max_namelen;
    + if (clp->rpc_ops->pathconf(server, mntfh, &pathinfo) >= 0) {
    + if (server->namelen == 0)
    + server->namelen = pathinfo.max_namelen;
    + server->linkmax = pathinfo.max_link;
    + }
    }

    dprintk("<-- nfs_probe_fsinfo() = 0\n");
    diff --git a/fs/nfs/super.c b/fs/nfs/super.c
    index 90be551..ae0599c 100644
    --- a/fs/nfs/super.c
    +++ b/fs/nfs/super.c
    @@ -453,6 +453,7 @@ static int nfs_statfs(struct dentry *dentry, struct kstatfs *buf)
    buf->f_ffree = res.afiles;

    buf->f_namelen = server->namelen;
    + buf->f_linkmax = server->linkmax;

    return 0;

    diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
    index 320569e..d66ab43 100644
    --- a/include/linux/nfs_fs_sb.h
    +++ b/include/linux/nfs_fs_sb.h
    @@ -123,6 +123,7 @@ struct nfs_server {
    unsigned int acdirmin;
    unsigned int acdirmax;
    unsigned int namelen;
    + unsigned int linkmax;
    unsigned int options; /* extra options enabled by mount */
    #define NFS_OPTION_FSCACHE 0x00000001 /* - local caching enabled */

    --
    1.6.1.284.g5dc13


    \
     
     \ /
      Last update: 2009-12-06 09:03    [W:0.025 / U:92.768 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site