nfs4proc.c (db985cbd67c45f875ef43cb5febfaa8cbd203c27) | nfs4proc.c (24bab491220faa446d945624086d838af41d616c) |
---|---|
1/* 2 * Server-side procedures for NFSv4. 3 * 4 * Copyright (c) 2002 The Regents of the University of Michigan. 5 * All rights reserved. 6 * 7 * Kendrick Smith <kmsmith@umich.edu> 8 * Andy Adamson <andros@umich.edu> --- 999 unchanged lines hidden (view full) --- 1008 if (filp) 1009 fput(filp); 1010 1011 write->wr_bytes_written = cnt; 1012 1013 return status; 1014} 1015 | 1/* 2 * Server-side procedures for NFSv4. 3 * 4 * Copyright (c) 2002 The Regents of the University of Michigan. 5 * All rights reserved. 6 * 7 * Kendrick Smith <kmsmith@umich.edu> 8 * Andy Adamson <andros@umich.edu> --- 999 unchanged lines hidden (view full) --- 1008 if (filp) 1009 fput(filp); 1010 1011 write->wr_bytes_written = cnt; 1012 1013 return status; 1014} 1015 |
1016static __be32 1017nfsd4_seek(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 1018 struct nfsd4_seek *seek) 1019{ 1020 int whence; 1021 __be32 status; 1022 struct file *file; 1023 1024 status = nfs4_preprocess_stateid_op(SVC_NET(rqstp), cstate, 1025 &seek->seek_stateid, 1026 RD_STATE, &file); 1027 if (status) { 1028 dprintk("NFSD: nfsd4_seek: couldn't process stateid!\n"); 1029 return status; 1030 } 1031 1032 switch (seek->seek_whence) { 1033 case NFS4_CONTENT_DATA: 1034 whence = SEEK_DATA; 1035 break; 1036 case NFS4_CONTENT_HOLE: 1037 whence = SEEK_HOLE; 1038 break; 1039 default: 1040 status = nfserr_union_notsupp; 1041 goto out; 1042 } 1043 1044 /* 1045 * Note: This call does change file->f_pos, but nothing in NFSD 1046 * should ever file->f_pos. 1047 */ 1048 seek->seek_pos = vfs_llseek(file, seek->seek_offset, whence); 1049 if (seek->seek_pos < 0) 1050 status = nfserrno(seek->seek_pos); 1051 else if (seek->seek_pos >= i_size_read(file_inode(file))) 1052 seek->seek_eof = true; 1053 1054out: 1055 fput(file); 1056 return status; 1057} 1058 |
|
1016/* This routine never returns NFS_OK! If there are no other errors, it 1017 * will return NFSERR_SAME or NFSERR_NOT_SAME depending on whether the 1018 * attributes matched. VERIFY is implemented by mapping NFSERR_SAME 1019 * to NFS_OK after the call; NVERIFY by mapping NFSERR_NOT_SAME to NFS_OK. 1020 */ 1021static __be32 1022_nfsd4_verify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 1023 struct nfsd4_verify *verify) --- 852 unchanged lines hidden (view full) --- 1876 }, 1877 [OP_FREE_STATEID] = { 1878 .op_func = (nfsd4op_func)nfsd4_free_stateid, 1879 .op_flags = ALLOWED_WITHOUT_FH | OP_MODIFIES_SOMETHING, 1880 .op_name = "OP_FREE_STATEID", 1881 .op_get_currentstateid = (stateid_getter)nfsd4_get_freestateid, 1882 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 1883 }, | 1059/* This routine never returns NFS_OK! If there are no other errors, it 1060 * will return NFSERR_SAME or NFSERR_NOT_SAME depending on whether the 1061 * attributes matched. VERIFY is implemented by mapping NFSERR_SAME 1062 * to NFS_OK after the call; NVERIFY by mapping NFSERR_NOT_SAME to NFS_OK. 1063 */ 1064static __be32 1065_nfsd4_verify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 1066 struct nfsd4_verify *verify) --- 852 unchanged lines hidden (view full) --- 1919 }, 1920 [OP_FREE_STATEID] = { 1921 .op_func = (nfsd4op_func)nfsd4_free_stateid, 1922 .op_flags = ALLOWED_WITHOUT_FH | OP_MODIFIES_SOMETHING, 1923 .op_name = "OP_FREE_STATEID", 1924 .op_get_currentstateid = (stateid_getter)nfsd4_get_freestateid, 1925 .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, 1926 }, |
1927 1928 /* NFSv4.2 operations */ 1929 [OP_SEEK] = { 1930 .op_func = (nfsd4op_func)nfsd4_seek, 1931 .op_name = "OP_SEEK", 1932 }, |
|
1884}; 1885 1886int nfsd4_max_reply(struct svc_rqst *rqstp, struct nfsd4_op *op) 1887{ 1888 struct nfsd4_operation *opdesc; 1889 nfsd4op_rsize estimator; 1890 1891 if (op->opnum == OP_ILLEGAL) --- 60 unchanged lines hidden --- | 1933}; 1934 1935int nfsd4_max_reply(struct svc_rqst *rqstp, struct nfsd4_op *op) 1936{ 1937 struct nfsd4_operation *opdesc; 1938 nfsd4op_rsize estimator; 1939 1940 if (op->opnum == OP_ILLEGAL) --- 60 unchanged lines hidden --- |