Print this page
7378 exported_lock held during nfs4 compound processing


2033 void
2034 rfs_rename(struct nfsrnmargs *args, enum nfsstat *status,
2035     struct exportinfo *exi, struct svc_req *req, cred_t *cr, bool_t ro)
2036 {
2037         int error = 0;
2038         vnode_t *fromvp;
2039         vnode_t *tovp;
2040         struct exportinfo *to_exi;
2041         fhandle_t *fh;
2042         vnode_t *srcvp;
2043         vnode_t *targvp;
2044         int in_crit = 0;
2045 
2046         fromvp = nfs_fhtovp(args->rna_from.da_fhandle, exi);
2047         if (fromvp == NULL) {
2048                 *status = NFSERR_STALE;
2049                 return;
2050         }
2051 
2052         fh = args->rna_to.da_fhandle;
2053         to_exi = checkexport(&fh->fh_fsid, (fid_t *)&fh->fh_xlen);
2054         if (to_exi == NULL) {
2055                 VN_RELE(fromvp);
2056                 *status = NFSERR_ACCES;
2057                 return;
2058         }
2059         exi_rele(to_exi);
2060 
2061         if (to_exi != exi) {
2062                 VN_RELE(fromvp);
2063                 *status = NFSERR_XDEV;
2064                 return;
2065         }
2066 
2067         tovp = nfs_fhtovp(args->rna_to.da_fhandle, exi);
2068         if (tovp == NULL) {
2069                 VN_RELE(fromvp);
2070                 *status = NFSERR_STALE;
2071                 return;
2072         }
2073 


2179  * Create a file (to) which is a hard link to the given file (from).
2180  */
2181 /* ARGSUSED */
2182 void
2183 rfs_link(struct nfslinkargs *args, enum nfsstat *status,
2184     struct exportinfo *exi, struct svc_req *req, cred_t *cr, bool_t ro)
2185 {
2186         int error;
2187         vnode_t *fromvp;
2188         vnode_t *tovp;
2189         struct exportinfo *to_exi;
2190         fhandle_t *fh;
2191 
2192         fromvp = nfs_fhtovp(args->la_from, exi);
2193         if (fromvp == NULL) {
2194                 *status = NFSERR_STALE;
2195                 return;
2196         }
2197 
2198         fh = args->la_to.da_fhandle;
2199         to_exi = checkexport(&fh->fh_fsid, (fid_t *)&fh->fh_xlen);
2200         if (to_exi == NULL) {
2201                 VN_RELE(fromvp);
2202                 *status = NFSERR_ACCES;
2203                 return;
2204         }
2205         exi_rele(to_exi);
2206 
2207         if (to_exi != exi) {
2208                 VN_RELE(fromvp);
2209                 *status = NFSERR_XDEV;
2210                 return;
2211         }
2212 
2213         tovp = nfs_fhtovp(args->la_to.da_fhandle, exi);
2214         if (tovp == NULL) {
2215                 VN_RELE(fromvp);
2216                 *status = NFSERR_STALE;
2217                 return;
2218         }
2219 




2033 void
2034 rfs_rename(struct nfsrnmargs *args, enum nfsstat *status,
2035     struct exportinfo *exi, struct svc_req *req, cred_t *cr, bool_t ro)
2036 {
2037         int error = 0;
2038         vnode_t *fromvp;
2039         vnode_t *tovp;
2040         struct exportinfo *to_exi;
2041         fhandle_t *fh;
2042         vnode_t *srcvp;
2043         vnode_t *targvp;
2044         int in_crit = 0;
2045 
2046         fromvp = nfs_fhtovp(args->rna_from.da_fhandle, exi);
2047         if (fromvp == NULL) {
2048                 *status = NFSERR_STALE;
2049                 return;
2050         }
2051 
2052         fh = args->rna_to.da_fhandle;
2053         to_exi = checkexport(&fh->fh_fsid, (fid_t *)&fh->fh_xlen, NULL);
2054         if (to_exi == NULL) {
2055                 VN_RELE(fromvp);
2056                 *status = NFSERR_ACCES;
2057                 return;
2058         }
2059         exi_rele(to_exi);
2060 
2061         if (to_exi != exi) {
2062                 VN_RELE(fromvp);
2063                 *status = NFSERR_XDEV;
2064                 return;
2065         }
2066 
2067         tovp = nfs_fhtovp(args->rna_to.da_fhandle, exi);
2068         if (tovp == NULL) {
2069                 VN_RELE(fromvp);
2070                 *status = NFSERR_STALE;
2071                 return;
2072         }
2073 


2179  * Create a file (to) which is a hard link to the given file (from).
2180  */
2181 /* ARGSUSED */
2182 void
2183 rfs_link(struct nfslinkargs *args, enum nfsstat *status,
2184     struct exportinfo *exi, struct svc_req *req, cred_t *cr, bool_t ro)
2185 {
2186         int error;
2187         vnode_t *fromvp;
2188         vnode_t *tovp;
2189         struct exportinfo *to_exi;
2190         fhandle_t *fh;
2191 
2192         fromvp = nfs_fhtovp(args->la_from, exi);
2193         if (fromvp == NULL) {
2194                 *status = NFSERR_STALE;
2195                 return;
2196         }
2197 
2198         fh = args->la_to.da_fhandle;
2199         to_exi = checkexport(&fh->fh_fsid, (fid_t *)&fh->fh_xlen, NULL);
2200         if (to_exi == NULL) {
2201                 VN_RELE(fromvp);
2202                 *status = NFSERR_ACCES;
2203                 return;
2204         }
2205         exi_rele(to_exi);
2206 
2207         if (to_exi != exi) {
2208                 VN_RELE(fromvp);
2209                 *status = NFSERR_XDEV;
2210                 return;
2211         }
2212 
2213         tovp = nfs_fhtovp(args->la_to.da_fhandle, exi);
2214         if (tovp == NULL) {
2215                 VN_RELE(fromvp);
2216                 *status = NFSERR_STALE;
2217                 return;
2218         }
2219