Merge remote-tracking branch 'torvalds/master' into perf/core
[linux-2.6-microblaze.git] / fs / nfs / client.c
index ff5c4d0..330f657 100644 (file)
@@ -406,7 +406,7 @@ struct nfs_client *nfs_get_client(const struct nfs_client_initdata *cl_init)
 
        if (cl_init->hostname == NULL) {
                WARN_ON(1);
-               return NULL;
+               return ERR_PTR(-EINVAL);
        }
 
        /* see if the client already exists */
@@ -476,7 +476,6 @@ void nfs_init_timeout_values(struct rpc_timeout *to, int proto,
                        to->to_maxval = to->to_initval;
                to->to_exponential = 0;
                break;
-#ifndef CONFIG_NFS_DISABLE_UDP_SUPPORT
        case XPRT_TRANSPORT_UDP:
                if (retrans == NFS_UNSPEC_RETRANS)
                        to->to_retries = NFS_DEF_UDP_RETRANS;
@@ -487,7 +486,6 @@ void nfs_init_timeout_values(struct rpc_timeout *to, int proto,
                to->to_maxval = NFS_MAX_UDP_TIMEOUT;
                to->to_exponential = 1;
                break;
-#endif
        default:
                BUG();
        }
@@ -698,9 +696,18 @@ static int nfs_init_server(struct nfs_server *server,
        /* Initialise the client representation from the mount data */
        server->flags = ctx->flags;
        server->options = ctx->options;
-       server->caps |= NFS_CAP_HARDLINKS|NFS_CAP_SYMLINKS|NFS_CAP_FILEID|
-               NFS_CAP_MODE|NFS_CAP_NLINK|NFS_CAP_OWNER|NFS_CAP_OWNER_GROUP|
-               NFS_CAP_ATIME|NFS_CAP_CTIME|NFS_CAP_MTIME;
+       server->caps |= NFS_CAP_HARDLINKS | NFS_CAP_SYMLINKS;
+
+       switch (clp->rpc_ops->version) {
+       case 2:
+               server->fattr_valid = NFS_ATTR_FATTR_V2;
+               break;
+       case 3:
+               server->fattr_valid = NFS_ATTR_FATTR_V3;
+               break;
+       default:
+               server->fattr_valid = NFS_ATTR_FATTR_V4;
+       }
 
        if (ctx->rsize)
                server->rsize = nfs_block_size(ctx->rsize, NULL);
@@ -794,6 +801,7 @@ static void nfs_server_set_fsinfo(struct nfs_server *server,
        server->maxfilesize = fsinfo->maxfilesize;
 
        server->time_delta = fsinfo->time_delta;
+       server->change_attr_type = fsinfo->change_attr_type;
 
        server->clone_blksize = fsinfo->clone_blksize;
        /* We're airborne Set socket buffersize */
@@ -935,6 +943,8 @@ struct nfs_server *nfs_alloc_server(void)
                return NULL;
        }
 
+       server->change_attr_type = NFS4_CHANGE_TYPE_IS_UNDEFINED;
+
        ida_init(&server->openowner_id);
        ida_init(&server->lockowner_id);
        pnfs_init_server(server);