nfs3proc.c (011fff7239eb90e33e7bebba48bf596fced06eb9) | nfs3proc.c (aa49b4cf7dbf45438563f0ff6a2d23a68b70a7b9) |
---|---|
1/* 2 * linux/fs/nfs/nfs3proc.c 3 * 4 * Client-side NFSv3 procedures stubs. 5 * 6 * Copyright (C) 1997, Olaf Kirch 7 */ 8 --- 583 unchanged lines hidden (view full) --- 592 * Also note that this implementation handles both plain readdir and 593 * readdirplus. 594 */ 595static int 596nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, 597 u64 cookie, struct page *page, unsigned int count, int plus) 598{ 599 struct inode *dir = dentry->d_inode; | 1/* 2 * linux/fs/nfs/nfs3proc.c 3 * 4 * Client-side NFSv3 procedures stubs. 5 * 6 * Copyright (C) 1997, Olaf Kirch 7 */ 8 --- 583 unchanged lines hidden (view full) --- 592 * Also note that this implementation handles both plain readdir and 593 * readdirplus. 594 */ 595static int 596nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, 597 u64 cookie, struct page *page, unsigned int count, int plus) 598{ 599 struct inode *dir = dentry->d_inode; |
600 struct nfs_fattr dir_attr; | |
601 __be32 *verf = NFS_COOKIEVERF(dir); 602 struct nfs3_readdirargs arg = { 603 .fh = NFS_FH(dir), 604 .cookie = cookie, 605 .verf = {verf[0], verf[1]}, 606 .plus = plus, 607 .count = count, 608 .pages = &page 609 }; 610 struct nfs3_readdirres res = { | 600 __be32 *verf = NFS_COOKIEVERF(dir); 601 struct nfs3_readdirargs arg = { 602 .fh = NFS_FH(dir), 603 .cookie = cookie, 604 .verf = {verf[0], verf[1]}, 605 .plus = plus, 606 .count = count, 607 .pages = &page 608 }; 609 struct nfs3_readdirres res = { |
611 .dir_attr = &dir_attr, | |
612 .verf = verf, 613 .plus = plus 614 }; 615 struct rpc_message msg = { 616 .rpc_proc = &nfs3_procedures[NFS3PROC_READDIR], 617 .rpc_argp = &arg, 618 .rpc_resp = &res, 619 .rpc_cred = cred 620 }; | 610 .verf = verf, 611 .plus = plus 612 }; 613 struct rpc_message msg = { 614 .rpc_proc = &nfs3_procedures[NFS3PROC_READDIR], 615 .rpc_argp = &arg, 616 .rpc_resp = &res, 617 .rpc_cred = cred 618 }; |
621 int status; | 619 int status = -ENOMEM; |
622 623 if (plus) 624 msg.rpc_proc = &nfs3_procedures[NFS3PROC_READDIRPLUS]; 625 626 dprintk("NFS call readdir%s %d\n", 627 plus? "plus" : "", (unsigned int) cookie); 628 | 620 621 if (plus) 622 msg.rpc_proc = &nfs3_procedures[NFS3PROC_READDIRPLUS]; 623 624 dprintk("NFS call readdir%s %d\n", 625 plus? "plus" : "", (unsigned int) cookie); 626 |
629 nfs_fattr_init(&dir_attr); | 627 res.dir_attr = nfs_alloc_fattr(); 628 if (res.dir_attr == NULL) 629 goto out; 630 |
630 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); 631 632 nfs_invalidate_atime(dir); | 631 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); 632 633 nfs_invalidate_atime(dir); |
634 nfs_refresh_inode(dir, res.dir_attr); |
|
633 | 635 |
634 nfs_refresh_inode(dir, &dir_attr); | 636 nfs_free_fattr(res.dir_attr); 637out: |
635 dprintk("NFS reply readdir: %d\n", status); 636 return status; 637} 638 639static int 640nfs3_proc_mknod(struct inode *dir, struct dentry *dentry, struct iattr *sattr, 641 dev_t rdev) 642{ --- 204 unchanged lines hidden --- | 638 dprintk("NFS reply readdir: %d\n", status); 639 return status; 640} 641 642static int 643nfs3_proc_mknod(struct inode *dir, struct dentry *dentry, struct iattr *sattr, 644 dev_t rdev) 645{ --- 204 unchanged lines hidden --- |