smbfs_io.c (321910) | smbfs_io.c (341074) |
---|---|
1/*- 2 * Copyright (c) 2000-2001 Boris Popov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2000-2001 Boris Popov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: stable/11/sys/fs/smbfs/smbfs_io.c 321910 2017-08-02 08:07:13Z kib $ | 26 * $FreeBSD: stable/11/sys/fs/smbfs/smbfs_io.c 341074 2018-11-27 16:51:18Z markj $ |
27 * 28 */ 29#include <sys/param.h> 30#include <sys/systm.h> 31#include <sys/kernel.h> 32#include <sys/fcntl.h> 33#include <sys/bio.h> 34#include <sys/buf.h> --- 64 unchanged lines hidden (view full) --- 99 de.d_reclen = DE_SIZE; 100 de.d_fileno = (offset == 0) ? np->n_ino : 101 (np->n_parent ? np->n_parentino : 2); 102 if (de.d_fileno == 0) 103 de.d_fileno = 0x7ffffffd + offset; 104 de.d_namlen = offset + 1; 105 de.d_name[0] = '.'; 106 de.d_name[1] = '.'; | 27 * 28 */ 29#include <sys/param.h> 30#include <sys/systm.h> 31#include <sys/kernel.h> 32#include <sys/fcntl.h> 33#include <sys/bio.h> 34#include <sys/buf.h> --- 64 unchanged lines hidden (view full) --- 99 de.d_reclen = DE_SIZE; 100 de.d_fileno = (offset == 0) ? np->n_ino : 101 (np->n_parent ? np->n_parentino : 2); 102 if (de.d_fileno == 0) 103 de.d_fileno = 0x7ffffffd + offset; 104 de.d_namlen = offset + 1; 105 de.d_name[0] = '.'; 106 de.d_name[1] = '.'; |
107 de.d_name[offset + 1] = '\0'; | |
108 de.d_type = DT_DIR; | 107 de.d_type = DT_DIR; |
108 dirent_terminate(&de); |
|
109 error = uiomove(&de, DE_SIZE, uio); 110 if (error) 111 goto out; 112 offset++; 113 uio->uio_offset += DE_SIZE; 114 } 115 if (limit == 0) { 116 error = 0; --- 32 unchanged lines hidden (view full) --- 149 break; 150 np->n_dirofs++; 151 bzero((caddr_t)&de, DE_SIZE); 152 de.d_reclen = DE_SIZE; 153 de.d_fileno = ctx->f_attr.fa_ino; 154 de.d_type = (ctx->f_attr.fa_attr & SMB_FA_DIR) ? DT_DIR : DT_REG; 155 de.d_namlen = ctx->f_nmlen; 156 bcopy(ctx->f_name, de.d_name, de.d_namlen); | 109 error = uiomove(&de, DE_SIZE, uio); 110 if (error) 111 goto out; 112 offset++; 113 uio->uio_offset += DE_SIZE; 114 } 115 if (limit == 0) { 116 error = 0; --- 32 unchanged lines hidden (view full) --- 149 break; 150 np->n_dirofs++; 151 bzero((caddr_t)&de, DE_SIZE); 152 de.d_reclen = DE_SIZE; 153 de.d_fileno = ctx->f_attr.fa_ino; 154 de.d_type = (ctx->f_attr.fa_attr & SMB_FA_DIR) ? DT_DIR : DT_REG; 155 de.d_namlen = ctx->f_nmlen; 156 bcopy(ctx->f_name, de.d_name, de.d_namlen); |
157 de.d_name[de.d_namlen] = '\0'; | 157 dirent_terminate(&de); |
158 if (smbfs_fastlookup) { 159 error = smbfs_nget(vp->v_mount, vp, ctx->f_name, 160 ctx->f_nmlen, &ctx->f_attr, &newvp); 161 if (!error) { 162 cn.cn_nameptr = de.d_name; 163 cn.cn_namelen = de.d_namlen; 164 cache_enter(vp, newvp, &cn); 165 vput(newvp); --- 513 unchanged lines hidden --- | 158 if (smbfs_fastlookup) { 159 error = smbfs_nget(vp->v_mount, vp, ctx->f_name, 160 ctx->f_nmlen, &ctx->f_attr, &newvp); 161 if (!error) { 162 cn.cn_nameptr = de.d_name; 163 cn.cn_namelen = de.d_namlen; 164 cache_enter(vp, newvp, &cn); 165 vput(newvp); --- 513 unchanged lines hidden --- |