* [PATCH 1/7] SQUASHME: nfs41: remove ifdefs around nfs_client_initdata.minorversion
2009-03-30 13:59 [PATCH 0/7] nfs41-for-2.6.30 cleanup patches Benny Halevy
@ 2009-03-30 14:00 ` Benny Halevy
2009-03-30 14:00 ` [PATCH 2/7] SQUASHME: nfs41: use kcalloc to allocate slot table Benny Halevy
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Benny Halevy @ 2009-03-30 14:00 UTC (permalink / raw)
To: Trond Myklebust; +Cc: linux-nfs, pnfs, andros
Trond Myklebust <Trond.Myklebust@netapp.com> wrote:
> This is really ugly and unnecessary. Please just remove those ifdefs,
> and have clp->cl_minorversion data->minorversion always defined, and set
> to 0.
squash intto "nfs41: Use mount minorversion option"
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
fs/nfs/client.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index bce02da..870742e 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -102,9 +102,7 @@ struct nfs_client_initdata {
size_t addrlen;
const struct nfs_rpc_ops *rpc_ops;
int proto;
-#ifdef CONFIG_NFS_V4
u32 minorversion;
-#endif
};
/*
@@ -451,11 +449,9 @@ static struct nfs_client *nfs_match_client(const struct nfs_client_initdata *dat
if (clp->cl_proto != data->proto)
continue;
-#ifdef CONFIG_NFS_V4
- /* Match minorversion */
+ /* Match nfsv4 minorversion */
if (clp->cl_minorversion != data->minorversion)
continue;
-#endif
/* Match the full socket address */
if (!nfs_sockaddr_cmp(sap, clap))
continue;
--
1.6.2.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 2/7] SQUASHME: nfs41: use kcalloc to allocate slot table
2009-03-30 13:59 [PATCH 0/7] nfs41-for-2.6.30 cleanup patches Benny Halevy
2009-03-30 14:00 ` [PATCH 1/7] SQUASHME: nfs41: remove ifdefs around nfs_client_initdata.minorversion Benny Halevy
@ 2009-03-30 14:00 ` Benny Halevy
2009-03-30 14:00 ` [PATCH 3/7] SQUASHME: nfs41: alloc session with GFP_KERNEL Benny Halevy
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Benny Halevy @ 2009-03-30 14:00 UTC (permalink / raw)
To: Trond Myklebust; +Cc: linux-nfs, pnfs, andros
Also, change gfp flags to GFP_KERNEL.
FIXME: move nfs4_init_slot_table's definition
from "nfs41: sessions client infrastructure"
to "nfs41: create_session operation"
and squash this patch there.
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
fs/nfs/nfs4proc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 7a96e17..e51622a 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4470,7 +4470,7 @@ static int nfs4_init_slot_table(struct nfs4_slot_table *tbl,
dprintk("--> %s: max_reqs=%u\n", __func__, max_slots);
- slot = kzalloc(max_slots * sizeof(struct nfs4_slot), GFP_ATOMIC);
+ slot = kcalloc(max_slots, sizeof(struct nfs4_slot), GFP_KERNEL);
if (!slot)
goto out;
for (i = 0; i < max_slots; ++i)
--
1.6.2.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 3/7] SQUASHME: nfs41: alloc session with GFP_KERNEL
2009-03-30 13:59 [PATCH 0/7] nfs41-for-2.6.30 cleanup patches Benny Halevy
2009-03-30 14:00 ` [PATCH 1/7] SQUASHME: nfs41: remove ifdefs around nfs_client_initdata.minorversion Benny Halevy
2009-03-30 14:00 ` [PATCH 2/7] SQUASHME: nfs41: use kcalloc to allocate slot table Benny Halevy
@ 2009-03-30 14:00 ` Benny Halevy
2009-03-30 14:00 ` [PATCH 4/7] SQUASHME: nfs41: embed resp_len in nfs_getaclres Benny Halevy
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Benny Halevy @ 2009-03-30 14:00 UTC (permalink / raw)
To: Trond Myklebust; +Cc: linux-nfs, pnfs, andros
No reason for using GFP_ATOMIC.
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
fs/nfs/nfs4proc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index e51622a..5e7e95c 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4525,7 +4525,7 @@ struct nfs4_session *nfs4_alloc_session(struct nfs_client *clp)
struct nfs4_session *session;
struct nfs4_slot_table *tbl;
- session = kzalloc(sizeof(struct nfs4_session), GFP_ATOMIC);
+ session = kzalloc(sizeof(struct nfs4_session), GFP_KERNEL);
if (!session)
return NULL;
--
1.6.2.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 4/7] SQUASHME: nfs41: embed resp_len in nfs_getaclres
2009-03-30 13:59 [PATCH 0/7] nfs41-for-2.6.30 cleanup patches Benny Halevy
` (2 preceding siblings ...)
2009-03-30 14:00 ` [PATCH 3/7] SQUASHME: nfs41: alloc session with GFP_KERNEL Benny Halevy
@ 2009-03-30 14:00 ` Benny Halevy
2009-03-30 14:00 ` [PATCH 5/7] SQUASHME: Revert "NFS: fix decode_fs_locations_maxsz" Benny Halevy
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Benny Halevy @ 2009-03-30 14:00 UTC (permalink / raw)
To: Trond Myklebust; +Cc: linux-nfs, pnfs, andros
As per Trond's review comment.
squash into "nfs41: use nfs4_getaclres"
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
fs/nfs/nfs4proc.c | 17 ++++++++---------
fs/nfs/nfs4xdr.c | 2 +-
include/linux/nfs_xdr.h | 2 +-
3 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 5e7e95c..788238a 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3192,14 +3192,13 @@ out:
static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t buflen)
{
struct page *pages[NFS4ACL_MAXPAGES];
- size_t resp_len = buflen;
struct nfs_getaclargs args = {
.fh = NFS_FH(inode),
.acl_pages = pages,
.acl_len = buflen,
};
struct nfs_getaclres res = {
- .acl_len = &resp_len,
+ .acl_len = buflen,
};
void *resp_buf;
struct rpc_message msg = {
@@ -3219,7 +3218,7 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t bu
return -ENOMEM;
args.acl_pages[0] = localpage;
args.acl_pgbase = 0;
- resp_len = args.acl_len = PAGE_SIZE;
+ args.acl_len = PAGE_SIZE;
} else {
resp_buf = buf;
buf_to_pages(buf, buflen, args.acl_pages, &args.acl_pgbase);
@@ -3227,18 +3226,18 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t bu
ret = nfs4_call_sync(NFS_SERVER(inode), &msg, &args, &res, 0);
if (ret)
goto out_free;
- if (resp_len > args.acl_len)
- nfs4_write_cached_acl(inode, NULL, resp_len);
+ if (res.acl_len > args.acl_len)
+ nfs4_write_cached_acl(inode, NULL, res.acl_len);
else
- nfs4_write_cached_acl(inode, resp_buf, resp_len);
+ nfs4_write_cached_acl(inode, resp_buf, res.acl_len);
if (buf) {
ret = -ERANGE;
- if (resp_len > buflen)
+ if (res.acl_len > buflen)
goto out_free;
if (localpage)
- memcpy(buf, resp_buf, resp_len);
+ memcpy(buf, resp_buf, res.acl_len);
}
- ret = resp_len;
+ ret = res.acl_len;
out_free:
if (localpage)
__free_page(localpage);
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index ae01d82..66922dc 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -4599,7 +4599,7 @@ nfs4_xdr_dec_getacl(struct rpc_rqst *rqstp, __be32 *p,
status = decode_putfh(&xdr);
if (status)
goto out;
- status = decode_getacl(&xdr, rqstp, res->acl_len);
+ status = decode_getacl(&xdr, rqstp, &res->acl_len);
out:
return status;
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 4feacc6..36972c8 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -431,7 +431,7 @@ struct nfs_getaclargs {
};
struct nfs_getaclres {
- size_t *acl_len;
+ size_t acl_len;
struct nfs4_sequence_res seq_res;
};
--
1.6.2.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 5/7] SQUASHME: Revert "NFS: fix decode_fs_locations_maxsz"
2009-03-30 13:59 [PATCH 0/7] nfs41-for-2.6.30 cleanup patches Benny Halevy
` (3 preceding siblings ...)
2009-03-30 14:00 ` [PATCH 4/7] SQUASHME: nfs41: embed resp_len in nfs_getaclres Benny Halevy
@ 2009-03-30 14:00 ` Benny Halevy
2009-03-30 14:00 ` [PATCH 6/7] SQUASHME: nfs41: get fs_locations replen before encoding the GETATTR Benny Halevy
2009-03-30 14:00 ` [PATCH 7/7] SQUASHME: nfs41: get getacl " Benny Halevy
6 siblings, 0 replies; 8+ messages in thread
From: Benny Halevy @ 2009-03-30 14:00 UTC (permalink / raw)
To: Trond Myklebust; +Cc: linux-nfs, pnfs, andros
This reverts commit d3a269cdeb581e688dce0eab4684fbe294b99b93.
Conflicts:
fs/nfs/nfs4xdr.c
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
fs/nfs/nfs4xdr.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 66922dc..358efe2 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -243,7 +243,7 @@ static int nfs4_stat_to_errno(int);
#define encode_fs_locations_maxsz \
(encode_getattr_maxsz)
#define decode_fs_locations_maxsz \
- (decode_getattr_maxsz)
+ (0)
#if defined(CONFIG_NFS_V4_1)
#define NFS4_MAX_MACHINE_NAME_LEN (64)
--
1.6.2.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 6/7] SQUASHME: nfs41: get fs_locations replen before encoding the GETATTR
2009-03-30 13:59 [PATCH 0/7] nfs41-for-2.6.30 cleanup patches Benny Halevy
` (4 preceding siblings ...)
2009-03-30 14:00 ` [PATCH 5/7] SQUASHME: Revert "NFS: fix decode_fs_locations_maxsz" Benny Halevy
@ 2009-03-30 14:00 ` Benny Halevy
2009-03-30 14:00 ` [PATCH 7/7] SQUASHME: nfs41: get getacl " Benny Halevy
6 siblings, 0 replies; 8+ messages in thread
From: Benny Halevy @ 2009-03-30 14:00 UTC (permalink / raw)
To: Trond Myklebust; +Cc: linux-nfs, pnfs, andros
squash into "NFS: use dynamically computed compound_hdr.replen for xdr_inline_pages offset"
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
fs/nfs/nfs4xdr.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 358efe2..ff847fa 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -2356,15 +2356,17 @@ static int nfs4_xdr_enc_fs_locations(struct rpc_rqst *req, __be32 *p, struct nfs
struct compound_hdr hdr = {
.minorversion = nfs4_xdr_minorversion(&args->seq_args),
};
+ uint32_t replen;
xdr_init_encode(&xdr, &req->rq_snd_buf, p);
encode_compound_hdr(&xdr, req, &hdr);
encode_sequence(&xdr, &args->seq_args, &hdr);
encode_putfh(&xdr, args->dir_fh, &hdr);
encode_lookup(&xdr, args->name, &hdr);
+ replen = hdr.replen; /* get the attribute into args->page */
encode_fs_locations(&xdr, args->bitmask, &hdr);
- xdr_inline_pages(&req->rq_rcv_buf, hdr.replen << 2, &args->page,
+ xdr_inline_pages(&req->rq_rcv_buf, replen << 2, &args->page,
0, PAGE_SIZE);
encode_nops(&hdr);
return 0;
--
1.6.2.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 7/7] SQUASHME: nfs41: get getacl replen before encoding the GETATTR
2009-03-30 13:59 [PATCH 0/7] nfs41-for-2.6.30 cleanup patches Benny Halevy
` (5 preceding siblings ...)
2009-03-30 14:00 ` [PATCH 6/7] SQUASHME: nfs41: get fs_locations replen before encoding the GETATTR Benny Halevy
@ 2009-03-30 14:00 ` Benny Halevy
6 siblings, 0 replies; 8+ messages in thread
From: Benny Halevy @ 2009-03-30 14:00 UTC (permalink / raw)
To: Trond Myklebust; +Cc: linux-nfs, pnfs, andros
squash into "NFS: use dynamically computed compound_hdr.replen for xdr_inline_pages offset"
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
fs/nfs/nfs4xdr.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index ff847fa..302bf47 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -2137,14 +2137,16 @@ nfs4_xdr_enc_getacl(struct rpc_rqst *req, __be32 *p,
struct compound_hdr hdr = {
.minorversion = nfs4_xdr_minorversion(&args->seq_args),
};
+ uint32_t replen;
xdr_init_encode(&xdr, &req->rq_snd_buf, p);
encode_compound_hdr(&xdr, req, &hdr);
encode_sequence(&xdr, &args->seq_args, &hdr);
encode_putfh(&xdr, args->fh, &hdr);
+ replen = hdr.replen + nfs4_fattr_bitmap_maxsz + 1;
encode_getattr_two(&xdr, FATTR4_WORD0_ACL, 0, &hdr);
- xdr_inline_pages(&req->rq_rcv_buf, hdr.replen << 2,
+ xdr_inline_pages(&req->rq_rcv_buf, replen << 2,
args->acl_pages, args->acl_pgbase, args->acl_len);
encode_nops(&hdr);
return 0;
--
1.6.2.1
^ permalink raw reply related [flat|nested] 8+ messages in thread