Merge git://git.linux-nfs.org/pub/linux/nfs-2.6

* git://git.linux-nfs.org/pub/linux/nfs-2.6:
  SUNRPC: Fix sparse warnings
  NLM: Fix sparse warnings
  NFS: Fix more sparse warnings
  NFS: Fix some 'sparse' warnings...
  SUNRPC: remove dead variable 'rpciod_running'
  NFS4: Fix incorrect use of sizeof() in fs/nfs/nfs4xdr.c
  NFS: use zero_user_page
  NLM: don't use CLONE_SIGHAND in nlmclnt_recovery
  NLM: Fix locking client timeouts...
This commit is contained in:
Linus Torvalds 2007-05-17 20:14:43 -07:00
commit b42895d6fe
18 changed files with 77 additions and 79 deletions

View File

@ -153,7 +153,7 @@ nlmclnt_recovery(struct nlm_host *host)
if (!host->h_reclaiming++) { if (!host->h_reclaiming++) {
nlm_get_host(host); nlm_get_host(host);
__module_get(THIS_MODULE); __module_get(THIS_MODULE);
if (kernel_thread(reclaimer, host, CLONE_KERNEL) < 0) if (kernel_thread(reclaimer, host, CLONE_FS | CLONE_FILES) < 0)
module_put(THIS_MODULE); module_put(THIS_MODULE);
} }
} }

View File

@ -221,7 +221,7 @@ nlm_bind_host(struct nlm_host *host)
host->h_nextrebind - jiffies); host->h_nextrebind - jiffies);
} }
} else { } else {
unsigned long increment = nlmsvc_timeout * HZ; unsigned long increment = nlmsvc_timeout;
struct rpc_timeout timeparms = { struct rpc_timeout timeparms = {
.to_initval = increment, .to_initval = increment,
.to_increment = increment, .to_increment = increment,

View File

@ -586,10 +586,6 @@ static struct rpc_version nlm_version3 = {
.procs = nlm_procedures, .procs = nlm_procedures,
}; };
#ifdef CONFIG_LOCKD_V4
extern struct rpc_version nlm_version4;
#endif
static struct rpc_version * nlm_versions[] = { static struct rpc_version * nlm_versions[] = {
[1] = &nlm_version1, [1] = &nlm_version1,
[3] = &nlm_version3, [3] = &nlm_version3,

View File

@ -123,7 +123,8 @@ static __be32 *
nlm4_decode_lock(__be32 *p, struct nlm_lock *lock) nlm4_decode_lock(__be32 *p, struct nlm_lock *lock)
{ {
struct file_lock *fl = &lock->fl; struct file_lock *fl = &lock->fl;
__s64 len, start, end; __u64 len, start;
__s64 end;
if (!(p = xdr_decode_string_inplace(p, &lock->caller, if (!(p = xdr_decode_string_inplace(p, &lock->caller,
&lock->len, NLM_MAXSTRLEN)) &lock->len, NLM_MAXSTRLEN))
@ -417,7 +418,8 @@ nlm4clt_decode_testres(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
if (resp->status == nlm_lck_denied) { if (resp->status == nlm_lck_denied) {
struct file_lock *fl = &resp->lock.fl; struct file_lock *fl = &resp->lock.fl;
u32 excl; u32 excl;
s64 start, end, len; __u64 start, len;
__s64 end;
memset(&resp->lock, 0, sizeof(resp->lock)); memset(&resp->lock, 0, sizeof(resp->lock));
locks_init_lock(fl); locks_init_lock(fl);

View File

@ -24,7 +24,7 @@ enum nfs4_callback_opnum {
}; };
struct cb_compound_hdr_arg { struct cb_compound_hdr_arg {
int taglen; unsigned int taglen;
const char *tag; const char *tag;
unsigned int callback_ident; unsigned int callback_ident;
unsigned nops; unsigned nops;
@ -32,7 +32,7 @@ struct cb_compound_hdr_arg {
struct cb_compound_hdr_res { struct cb_compound_hdr_res {
__be32 *status; __be32 *status;
int taglen; unsigned int taglen;
const char *tag; const char *tag;
__be32 *nops; __be32 *nops;
}; };

View File

@ -226,7 +226,7 @@ restart:
spin_unlock(&clp->cl_lock); spin_unlock(&clp->cl_lock);
} }
int nfs_do_expire_all_delegations(void *ptr) static int nfs_do_expire_all_delegations(void *ptr)
{ {
struct nfs_client *clp = ptr; struct nfs_client *clp = ptr;
struct nfs_delegation *delegation; struct nfs_delegation *delegation;

View File

@ -607,7 +607,7 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
return res; return res;
} }
loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int origin) static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int origin)
{ {
mutex_lock(&filp->f_path.dentry->d_inode->i_mutex); mutex_lock(&filp->f_path.dentry->d_inode->i_mutex);
switch (origin) { switch (origin) {
@ -633,7 +633,7 @@ out:
* All directory operations under NFS are synchronous, so fsync() * All directory operations under NFS are synchronous, so fsync()
* is a dummy operation. * is a dummy operation.
*/ */
int nfs_fsync_dir(struct file *filp, struct dentry *dentry, int datasync) static int nfs_fsync_dir(struct file *filp, struct dentry *dentry, int datasync)
{ {
dfprintk(VFS, "NFS: fsync_dir(%s/%s) datasync %d\n", dfprintk(VFS, "NFS: fsync_dir(%s/%s) datasync %d\n",
dentry->d_parent->d_name.name, dentry->d_name.name, dentry->d_parent->d_name.name, dentry->d_name.name,

View File

@ -790,7 +790,7 @@ out:
return -EACCES; return -EACCES;
} }
int nfs4_recover_expired_lease(struct nfs_server *server) static int nfs4_recover_expired_lease(struct nfs_server *server)
{ {
struct nfs_client *clp = server->nfs_client; struct nfs_client *clp = server->nfs_client;
int ret; int ret;
@ -2748,7 +2748,7 @@ static int nfs4_delay(struct rpc_clnt *clnt, long *timeout)
/* This is the error handling routine for processes that are allowed /* This is the error handling routine for processes that are allowed
* to sleep. * to sleep.
*/ */
int nfs4_handle_exception(const struct nfs_server *server, int errorcode, struct nfs4_exception *exception) static int nfs4_handle_exception(const struct nfs_server *server, int errorcode, struct nfs4_exception *exception)
{ {
struct nfs_client *clp = server->nfs_client; struct nfs_client *clp = server->nfs_client;
int ret = errorcode; int ret = errorcode;

View File

@ -104,7 +104,7 @@ struct rpc_cred *nfs4_get_renew_cred(struct nfs_client *clp)
return cred; return cred;
} }
struct rpc_cred *nfs4_get_setclientid_cred(struct nfs_client *clp) static struct rpc_cred *nfs4_get_setclientid_cred(struct nfs_client *clp)
{ {
struct nfs4_state_owner *sp; struct nfs4_state_owner *sp;

View File

@ -646,10 +646,10 @@ static int encode_close(struct xdr_stream *xdr, const struct nfs_closeargs *arg)
{ {
__be32 *p; __be32 *p;
RESERVE_SPACE(8+sizeof(arg->stateid->data)); RESERVE_SPACE(8+NFS4_STATEID_SIZE);
WRITE32(OP_CLOSE); WRITE32(OP_CLOSE);
WRITE32(arg->seqid->sequence->counter); WRITE32(arg->seqid->sequence->counter);
WRITEMEM(arg->stateid->data, sizeof(arg->stateid->data)); WRITEMEM(arg->stateid->data, NFS4_STATEID_SIZE);
return 0; return 0;
} }
@ -793,17 +793,17 @@ static int encode_lock(struct xdr_stream *xdr, const struct nfs_lock_args *args)
WRITE64(nfs4_lock_length(args->fl)); WRITE64(nfs4_lock_length(args->fl));
WRITE32(args->new_lock_owner); WRITE32(args->new_lock_owner);
if (args->new_lock_owner){ if (args->new_lock_owner){
RESERVE_SPACE(40); RESERVE_SPACE(4+NFS4_STATEID_SIZE+20);
WRITE32(args->open_seqid->sequence->counter); WRITE32(args->open_seqid->sequence->counter);
WRITEMEM(args->open_stateid->data, sizeof(args->open_stateid->data)); WRITEMEM(args->open_stateid->data, NFS4_STATEID_SIZE);
WRITE32(args->lock_seqid->sequence->counter); WRITE32(args->lock_seqid->sequence->counter);
WRITE64(args->lock_owner.clientid); WRITE64(args->lock_owner.clientid);
WRITE32(4); WRITE32(4);
WRITE32(args->lock_owner.id); WRITE32(args->lock_owner.id);
} }
else { else {
RESERVE_SPACE(20); RESERVE_SPACE(NFS4_STATEID_SIZE+4);
WRITEMEM(args->lock_stateid->data, sizeof(args->lock_stateid->data)); WRITEMEM(args->lock_stateid->data, NFS4_STATEID_SIZE);
WRITE32(args->lock_seqid->sequence->counter); WRITE32(args->lock_seqid->sequence->counter);
} }
@ -830,11 +830,11 @@ static int encode_locku(struct xdr_stream *xdr, const struct nfs_locku_args *arg
{ {
__be32 *p; __be32 *p;
RESERVE_SPACE(44); RESERVE_SPACE(12+NFS4_STATEID_SIZE+16);
WRITE32(OP_LOCKU); WRITE32(OP_LOCKU);
WRITE32(nfs4_lock_type(args->fl, 0)); WRITE32(nfs4_lock_type(args->fl, 0));
WRITE32(args->seqid->sequence->counter); WRITE32(args->seqid->sequence->counter);
WRITEMEM(args->stateid->data, sizeof(args->stateid->data)); WRITEMEM(args->stateid->data, NFS4_STATEID_SIZE);
WRITE64(args->fl->fl_start); WRITE64(args->fl->fl_start);
WRITE64(nfs4_lock_length(args->fl)); WRITE64(nfs4_lock_length(args->fl));
@ -966,9 +966,9 @@ static inline void encode_claim_delegate_cur(struct xdr_stream *xdr, const struc
{ {
__be32 *p; __be32 *p;
RESERVE_SPACE(4+sizeof(stateid->data)); RESERVE_SPACE(4+NFS4_STATEID_SIZE);
WRITE32(NFS4_OPEN_CLAIM_DELEGATE_CUR); WRITE32(NFS4_OPEN_CLAIM_DELEGATE_CUR);
WRITEMEM(stateid->data, sizeof(stateid->data)); WRITEMEM(stateid->data, NFS4_STATEID_SIZE);
encode_string(xdr, name->len, name->name); encode_string(xdr, name->len, name->name);
} }
@ -996,9 +996,9 @@ static int encode_open_confirm(struct xdr_stream *xdr, const struct nfs_open_con
{ {
__be32 *p; __be32 *p;
RESERVE_SPACE(8+sizeof(arg->stateid->data)); RESERVE_SPACE(4+NFS4_STATEID_SIZE+4);
WRITE32(OP_OPEN_CONFIRM); WRITE32(OP_OPEN_CONFIRM);
WRITEMEM(arg->stateid->data, sizeof(arg->stateid->data)); WRITEMEM(arg->stateid->data, NFS4_STATEID_SIZE);
WRITE32(arg->seqid->sequence->counter); WRITE32(arg->seqid->sequence->counter);
return 0; return 0;
@ -1008,9 +1008,9 @@ static int encode_open_downgrade(struct xdr_stream *xdr, const struct nfs_closea
{ {
__be32 *p; __be32 *p;
RESERVE_SPACE(8+sizeof(arg->stateid->data)); RESERVE_SPACE(4+NFS4_STATEID_SIZE+4);
WRITE32(OP_OPEN_DOWNGRADE); WRITE32(OP_OPEN_DOWNGRADE);
WRITEMEM(arg->stateid->data, sizeof(arg->stateid->data)); WRITEMEM(arg->stateid->data, NFS4_STATEID_SIZE);
WRITE32(arg->seqid->sequence->counter); WRITE32(arg->seqid->sequence->counter);
encode_share_access(xdr, arg->open_flags); encode_share_access(xdr, arg->open_flags);
return 0; return 0;
@ -1045,12 +1045,12 @@ static void encode_stateid(struct xdr_stream *xdr, const struct nfs_open_context
nfs4_stateid stateid; nfs4_stateid stateid;
__be32 *p; __be32 *p;
RESERVE_SPACE(16); RESERVE_SPACE(NFS4_STATEID_SIZE);
if (ctx->state != NULL) { if (ctx->state != NULL) {
nfs4_copy_stateid(&stateid, ctx->state, ctx->lockowner); nfs4_copy_stateid(&stateid, ctx->state, ctx->lockowner);
WRITEMEM(stateid.data, sizeof(stateid.data)); WRITEMEM(stateid.data, NFS4_STATEID_SIZE);
} else } else
WRITEMEM(zero_stateid.data, sizeof(zero_stateid.data)); WRITEMEM(zero_stateid.data, NFS4_STATEID_SIZE);
} }
static int encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args) static int encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args)
@ -1079,10 +1079,10 @@ static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg
int replen; int replen;
__be32 *p; __be32 *p;
RESERVE_SPACE(32+sizeof(nfs4_verifier)); RESERVE_SPACE(12+NFS4_VERIFIER_SIZE+20);
WRITE32(OP_READDIR); WRITE32(OP_READDIR);
WRITE64(readdir->cookie); WRITE64(readdir->cookie);
WRITEMEM(readdir->verifier.data, sizeof(readdir->verifier.data)); WRITEMEM(readdir->verifier.data, NFS4_VERIFIER_SIZE);
WRITE32(readdir->count >> 1); /* We're not doing readdirplus */ WRITE32(readdir->count >> 1); /* We're not doing readdirplus */
WRITE32(readdir->count); WRITE32(readdir->count);
WRITE32(2); WRITE32(2);
@ -1190,9 +1190,9 @@ encode_setacl(struct xdr_stream *xdr, struct nfs_setaclargs *arg)
{ {
__be32 *p; __be32 *p;
RESERVE_SPACE(4+sizeof(zero_stateid.data)); RESERVE_SPACE(4+NFS4_STATEID_SIZE);
WRITE32(OP_SETATTR); WRITE32(OP_SETATTR);
WRITEMEM(zero_stateid.data, sizeof(zero_stateid.data)); WRITEMEM(zero_stateid.data, NFS4_STATEID_SIZE);
RESERVE_SPACE(2*4); RESERVE_SPACE(2*4);
WRITE32(1); WRITE32(1);
WRITE32(FATTR4_WORD0_ACL); WRITE32(FATTR4_WORD0_ACL);
@ -1220,9 +1220,9 @@ static int encode_setattr(struct xdr_stream *xdr, const struct nfs_setattrargs *
int status; int status;
__be32 *p; __be32 *p;
RESERVE_SPACE(4+sizeof(arg->stateid.data)); RESERVE_SPACE(4+NFS4_STATEID_SIZE);
WRITE32(OP_SETATTR); WRITE32(OP_SETATTR);
WRITEMEM(arg->stateid.data, sizeof(arg->stateid.data)); WRITEMEM(arg->stateid.data, NFS4_STATEID_SIZE);
if ((status = encode_attrs(xdr, arg->iap, server))) if ((status = encode_attrs(xdr, arg->iap, server)))
return status; return status;
@ -1234,9 +1234,9 @@ static int encode_setclientid(struct xdr_stream *xdr, const struct nfs4_setclien
{ {
__be32 *p; __be32 *p;
RESERVE_SPACE(4 + sizeof(setclientid->sc_verifier->data)); RESERVE_SPACE(4 + NFS4_VERIFIER_SIZE);
WRITE32(OP_SETCLIENTID); WRITE32(OP_SETCLIENTID);
WRITEMEM(setclientid->sc_verifier->data, sizeof(setclientid->sc_verifier->data)); WRITEMEM(setclientid->sc_verifier->data, NFS4_VERIFIER_SIZE);
encode_string(xdr, setclientid->sc_name_len, setclientid->sc_name); encode_string(xdr, setclientid->sc_name_len, setclientid->sc_name);
RESERVE_SPACE(4); RESERVE_SPACE(4);
@ -1253,10 +1253,10 @@ static int encode_setclientid_confirm(struct xdr_stream *xdr, const struct nfs_c
{ {
__be32 *p; __be32 *p;
RESERVE_SPACE(12 + sizeof(client_state->cl_confirm.data)); RESERVE_SPACE(12 + NFS4_VERIFIER_SIZE);
WRITE32(OP_SETCLIENTID_CONFIRM); WRITE32(OP_SETCLIENTID_CONFIRM);
WRITE64(client_state->cl_clientid); WRITE64(client_state->cl_clientid);
WRITEMEM(client_state->cl_confirm.data, sizeof(client_state->cl_confirm.data)); WRITEMEM(client_state->cl_confirm.data, NFS4_VERIFIER_SIZE);
return 0; return 0;
} }
@ -1284,10 +1284,10 @@ static int encode_delegreturn(struct xdr_stream *xdr, const nfs4_stateid *statei
{ {
__be32 *p; __be32 *p;
RESERVE_SPACE(20); RESERVE_SPACE(4+NFS4_STATEID_SIZE);
WRITE32(OP_DELEGRETURN); WRITE32(OP_DELEGRETURN);
WRITEMEM(stateid->data, sizeof(stateid->data)); WRITEMEM(stateid->data, NFS4_STATEID_SIZE);
return 0; return 0;
} }
@ -2494,7 +2494,7 @@ static int decode_attr_fs_locations(struct xdr_stream *xdr, uint32_t *bitmap, st
int i; int i;
dprintk("%s: using first %d of %d servers returned for location %d\n", __FUNCTION__, NFS4_FS_LOCATION_MAXSERVERS, m, res->nlocations); dprintk("%s: using first %d of %d servers returned for location %d\n", __FUNCTION__, NFS4_FS_LOCATION_MAXSERVERS, m, res->nlocations);
for (i = loc->nservers; i < m; i++) { for (i = loc->nservers; i < m; i++) {
int len; unsigned int len;
char *data; char *data;
status = decode_opaque_inline(xdr, &len, &data); status = decode_opaque_inline(xdr, &len, &data);
if (unlikely(status != 0)) if (unlikely(status != 0))
@ -2642,7 +2642,7 @@ static int decode_attr_nlink(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t
return 0; return 0;
} }
static int decode_attr_owner(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_client *clp, int32_t *uid) static int decode_attr_owner(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_client *clp, uint32_t *uid)
{ {
uint32_t len; uint32_t len;
__be32 *p; __be32 *p;
@ -2667,7 +2667,7 @@ static int decode_attr_owner(struct xdr_stream *xdr, uint32_t *bitmap, struct nf
return 0; return 0;
} }
static int decode_attr_group(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_client *clp, int32_t *gid) static int decode_attr_group(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_client *clp, uint32_t *gid)
{ {
uint32_t len; uint32_t len;
__be32 *p; __be32 *p;
@ -2897,8 +2897,8 @@ static int decode_close(struct xdr_stream *xdr, struct nfs_closeres *res)
status = decode_op_hdr(xdr, OP_CLOSE); status = decode_op_hdr(xdr, OP_CLOSE);
if (status) if (status)
return status; return status;
READ_BUF(sizeof(res->stateid.data)); READ_BUF(NFS4_STATEID_SIZE);
COPYMEM(res->stateid.data, sizeof(res->stateid.data)); COPYMEM(res->stateid.data, NFS4_STATEID_SIZE);
return 0; return 0;
} }
@ -3186,8 +3186,8 @@ static int decode_lock(struct xdr_stream *xdr, struct nfs_lock_res *res)
status = decode_op_hdr(xdr, OP_LOCK); status = decode_op_hdr(xdr, OP_LOCK);
if (status == 0) { if (status == 0) {
READ_BUF(sizeof(res->stateid.data)); READ_BUF(NFS4_STATEID_SIZE);
COPYMEM(res->stateid.data, sizeof(res->stateid.data)); COPYMEM(res->stateid.data, NFS4_STATEID_SIZE);
} else if (status == -NFS4ERR_DENIED) } else if (status == -NFS4ERR_DENIED)
return decode_lock_denied(xdr, NULL); return decode_lock_denied(xdr, NULL);
return status; return status;
@ -3209,8 +3209,8 @@ static int decode_locku(struct xdr_stream *xdr, struct nfs_locku_res *res)
status = decode_op_hdr(xdr, OP_LOCKU); status = decode_op_hdr(xdr, OP_LOCKU);
if (status == 0) { if (status == 0) {
READ_BUF(sizeof(res->stateid.data)); READ_BUF(NFS4_STATEID_SIZE);
COPYMEM(res->stateid.data, sizeof(res->stateid.data)); COPYMEM(res->stateid.data, NFS4_STATEID_SIZE);
} }
return status; return status;
} }
@ -3251,8 +3251,8 @@ static int decode_delegation(struct xdr_stream *xdr, struct nfs_openres *res)
res->delegation_type = 0; res->delegation_type = 0;
return 0; return 0;
} }
READ_BUF(20); READ_BUF(NFS4_STATEID_SIZE+4);
COPYMEM(res->delegation.data, sizeof(res->delegation.data)); COPYMEM(res->delegation.data, NFS4_STATEID_SIZE);
READ32(res->do_recall); READ32(res->do_recall);
switch (delegation_type) { switch (delegation_type) {
case NFS4_OPEN_DELEGATE_READ: case NFS4_OPEN_DELEGATE_READ:
@ -3275,8 +3275,8 @@ static int decode_open(struct xdr_stream *xdr, struct nfs_openres *res)
status = decode_op_hdr(xdr, OP_OPEN); status = decode_op_hdr(xdr, OP_OPEN);
if (status) if (status)
return status; return status;
READ_BUF(sizeof(res->stateid.data)); READ_BUF(NFS4_STATEID_SIZE);
COPYMEM(res->stateid.data, sizeof(res->stateid.data)); COPYMEM(res->stateid.data, NFS4_STATEID_SIZE);
decode_change_info(xdr, &res->cinfo); decode_change_info(xdr, &res->cinfo);
@ -3302,8 +3302,8 @@ static int decode_open_confirm(struct xdr_stream *xdr, struct nfs_open_confirmre
status = decode_op_hdr(xdr, OP_OPEN_CONFIRM); status = decode_op_hdr(xdr, OP_OPEN_CONFIRM);
if (status) if (status)
return status; return status;
READ_BUF(sizeof(res->stateid.data)); READ_BUF(NFS4_STATEID_SIZE);
COPYMEM(res->stateid.data, sizeof(res->stateid.data)); COPYMEM(res->stateid.data, NFS4_STATEID_SIZE);
return 0; return 0;
} }
@ -3315,8 +3315,8 @@ static int decode_open_downgrade(struct xdr_stream *xdr, struct nfs_closeres *re
status = decode_op_hdr(xdr, OP_OPEN_DOWNGRADE); status = decode_op_hdr(xdr, OP_OPEN_DOWNGRADE);
if (status) if (status)
return status; return status;
READ_BUF(sizeof(res->stateid.data)); READ_BUF(NFS4_STATEID_SIZE);
COPYMEM(res->stateid.data, sizeof(res->stateid.data)); COPYMEM(res->stateid.data, NFS4_STATEID_SIZE);
return 0; return 0;
} }
@ -3590,9 +3590,9 @@ static int decode_setclientid(struct xdr_stream *xdr, struct nfs_client *clp)
} }
READ32(nfserr); READ32(nfserr);
if (nfserr == NFS_OK) { if (nfserr == NFS_OK) {
READ_BUF(8 + sizeof(clp->cl_confirm.data)); READ_BUF(8 + NFS4_VERIFIER_SIZE);
READ64(clp->cl_clientid); READ64(clp->cl_clientid);
COPYMEM(clp->cl_confirm.data, sizeof(clp->cl_confirm.data)); COPYMEM(clp->cl_confirm.data, NFS4_VERIFIER_SIZE);
} else if (nfserr == NFSERR_CLID_INUSE) { } else if (nfserr == NFSERR_CLID_INUSE) {
uint32_t len; uint32_t len;

View File

@ -79,7 +79,7 @@ void nfs_readdata_release(void *data)
static static
int nfs_return_empty_page(struct page *page) int nfs_return_empty_page(struct page *page)
{ {
memclear_highpage_flush(page, 0, PAGE_CACHE_SIZE); zero_user_page(page, 0, PAGE_CACHE_SIZE, KM_USER0);
SetPageUptodate(page); SetPageUptodate(page);
unlock_page(page); unlock_page(page);
return 0; return 0;
@ -103,10 +103,10 @@ static void nfs_readpage_truncate_uninitialised_page(struct nfs_read_data *data)
pglen = PAGE_CACHE_SIZE - base; pglen = PAGE_CACHE_SIZE - base;
for (;;) { for (;;) {
if (remainder <= pglen) { if (remainder <= pglen) {
memclear_highpage_flush(*pages, base, remainder); zero_user_page(*pages, base, remainder, KM_USER0);
break; break;
} }
memclear_highpage_flush(*pages, base, pglen); zero_user_page(*pages, base, pglen, KM_USER0);
pages++; pages++;
remainder -= pglen; remainder -= pglen;
pglen = PAGE_CACHE_SIZE; pglen = PAGE_CACHE_SIZE;
@ -130,7 +130,7 @@ static int nfs_readpage_async(struct nfs_open_context *ctx, struct inode *inode,
return PTR_ERR(new); return PTR_ERR(new);
} }
if (len < PAGE_CACHE_SIZE) if (len < PAGE_CACHE_SIZE)
memclear_highpage_flush(page, len, PAGE_CACHE_SIZE - len); zero_user_page(page, len, PAGE_CACHE_SIZE - len, KM_USER0);
nfs_list_add_request(new, &one_request); nfs_list_add_request(new, &one_request);
if (NFS_SERVER(inode)->rsize < PAGE_CACHE_SIZE) if (NFS_SERVER(inode)->rsize < PAGE_CACHE_SIZE)
@ -532,7 +532,7 @@ readpage_async_filler(void *data, struct page *page)
return PTR_ERR(new); return PTR_ERR(new);
} }
if (len < PAGE_CACHE_SIZE) if (len < PAGE_CACHE_SIZE)
memclear_highpage_flush(page, len, PAGE_CACHE_SIZE - len); zero_user_page(page, len, PAGE_CACHE_SIZE - len, KM_USER0);
nfs_pageio_add_request(desc->pgio, new); nfs_pageio_add_request(desc->pgio, new);
return 0; return 0;
} }

View File

@ -58,7 +58,7 @@ struct nfs_write_data *nfs_commit_alloc(void)
return p; return p;
} }
void nfs_commit_rcu_free(struct rcu_head *head) static void nfs_commit_rcu_free(struct rcu_head *head)
{ {
struct nfs_write_data *p = container_of(head, struct nfs_write_data, task.u.tk_rcu); struct nfs_write_data *p = container_of(head, struct nfs_write_data, task.u.tk_rcu);
if (p && (p->pagevec != &p->page_array[0])) if (p && (p->pagevec != &p->page_array[0]))
@ -168,7 +168,7 @@ static void nfs_mark_uptodate(struct page *page, unsigned int base, unsigned int
if (count != nfs_page_length(page)) if (count != nfs_page_length(page))
return; return;
if (count != PAGE_CACHE_SIZE) if (count != PAGE_CACHE_SIZE)
memclear_highpage_flush(page, count, PAGE_CACHE_SIZE - count); zero_user_page(page, count, PAGE_CACHE_SIZE - count, KM_USER0);
SetPageUptodate(page); SetPageUptodate(page);
} }
@ -922,7 +922,7 @@ static int nfs_flush_one(struct inode *inode, struct list_head *head, unsigned i
return 0; return 0;
out_bad: out_bad:
while (!list_empty(head)) { while (!list_empty(head)) {
struct nfs_page *req = nfs_list_entry(head->next); req = nfs_list_entry(head->next);
nfs_list_remove_request(req); nfs_list_remove_request(req);
nfs_redirty_request(req); nfs_redirty_request(req);
nfs_end_page_writeback(req->wb_page); nfs_end_page_writeback(req->wb_page);

View File

@ -42,5 +42,6 @@ int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
int nlmclt_encode_cancargs(struct rpc_rqst *, u32 *, struct nlm_args *); int nlmclt_encode_cancargs(struct rpc_rqst *, u32 *, struct nlm_args *);
int nlmclt_encode_unlockargs(struct rpc_rqst *, u32 *, struct nlm_args *); int nlmclt_encode_unlockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
*/ */
extern struct rpc_version nlm_version4;
#endif /* LOCKD_XDR4_H */ #endif /* LOCKD_XDR4_H */

View File

@ -16,6 +16,7 @@
#include <linux/types.h> #include <linux/types.h>
#define NFS4_VERIFIER_SIZE 8 #define NFS4_VERIFIER_SIZE 8
#define NFS4_STATEID_SIZE 16
#define NFS4_FHSIZE 128 #define NFS4_FHSIZE 128
#define NFS4_MAXPATHLEN PATH_MAX #define NFS4_MAXPATHLEN PATH_MAX
#define NFS4_MAXNAMLEN NAME_MAX #define NFS4_MAXNAMLEN NAME_MAX
@ -113,7 +114,7 @@ struct nfs4_acl {
}; };
typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier; typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier;
typedef struct { char data[16]; } nfs4_stateid; typedef struct { char data[NFS4_STATEID_SIZE]; } nfs4_stateid;
enum nfs_opnum4 { enum nfs_opnum4 {
OP_ACCESS = 3, OP_ACCESS = 3,

View File

@ -47,6 +47,8 @@ extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *, struct r
extern int rpc_unlink(struct dentry *); extern int rpc_unlink(struct dentry *);
extern struct vfsmount *rpc_get_mount(void); extern struct vfsmount *rpc_get_mount(void);
extern void rpc_put_mount(void); extern void rpc_put_mount(void);
extern int register_rpc_pipefs(void);
extern void unregister_rpc_pipefs(void);
#endif #endif
#endif #endif

View File

@ -244,6 +244,8 @@ void xprt_disconnect(struct rpc_xprt *xprt);
*/ */
struct rpc_xprt * xs_setup_udp(struct sockaddr *addr, size_t addrlen, struct rpc_timeout *to); struct rpc_xprt * xs_setup_udp(struct sockaddr *addr, size_t addrlen, struct rpc_timeout *to);
struct rpc_xprt * xs_setup_tcp(struct sockaddr *addr, size_t addrlen, struct rpc_timeout *to); struct rpc_xprt * xs_setup_tcp(struct sockaddr *addr, size_t addrlen, struct rpc_timeout *to);
int init_socket_xprt(void);
void cleanup_socket_xprt(void);
/* /*
* Reserved bit positions in xprt->state * Reserved bit positions in xprt->state

View File

@ -989,8 +989,6 @@ void rpc_killall_tasks(struct rpc_clnt *clnt)
spin_unlock(&rpc_sched_lock); spin_unlock(&rpc_sched_lock);
} }
static DECLARE_MUTEX_LOCKED(rpciod_running);
static void rpciod_killall(void) static void rpciod_killall(void)
{ {
unsigned long flags; unsigned long flags;

View File

@ -134,11 +134,7 @@ EXPORT_SYMBOL(nfsd_debug);
EXPORT_SYMBOL(nlm_debug); EXPORT_SYMBOL(nlm_debug);
#endif #endif
extern int register_rpc_pipefs(void);
extern void unregister_rpc_pipefs(void);
extern struct cache_detail ip_map_cache, unix_gid_cache; extern struct cache_detail ip_map_cache, unix_gid_cache;
extern int init_socket_xprt(void);
extern void cleanup_socket_xprt(void);
static int __init static int __init
init_sunrpc(void) init_sunrpc(void)