Deleted Added
full compact
nfs_clsubs.c (221973) nfs_clsubs.c (223280)
1/*-
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 19 unchanged lines hidden (view full) ---

28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * from nfs_subs.c 8.8 (Berkeley) 5/22/95
33 */
34
35#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 19 unchanged lines hidden (view full) ---

28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * from nfs_subs.c 8.8 (Berkeley) 5/22/95
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/fs/nfsclient/nfs_clsubs.c 221973 2011-05-15 20:52:43Z rmacklem $");
36__FBSDID("$FreeBSD: head/sys/fs/nfsclient/nfs_clsubs.c 223280 2011-06-18 23:02:53Z rmacklem $");
37
37
38#include "opt_kdtrace.h"
39
38/*
39 * These functions support the macros and help fiddle mbuf chains for
40 * the nfs op functions. They do things like create the rpc header and
41 * copy data between mbuf chains and uio lists.
42 */
43
44#include <sys/param.h>
45#include <sys/systm.h>

--- 17 unchanged lines hidden (view full) ---

63#include <vm/vm_object.h>
64#include <vm/vm_extern.h>
65#include <vm/uma.h>
66
67#include <fs/nfs/nfsport.h>
68#include <fs/nfsclient/nfsnode.h>
69#include <fs/nfsclient/nfsmount.h>
70#include <fs/nfsclient/nfs.h>
40/*
41 * These functions support the macros and help fiddle mbuf chains for
42 * the nfs op functions. They do things like create the rpc header and
43 * copy data between mbuf chains and uio lists.
44 */
45
46#include <sys/param.h>
47#include <sys/systm.h>

--- 17 unchanged lines hidden (view full) ---

65#include <vm/vm_object.h>
66#include <vm/vm_extern.h>
67#include <vm/uma.h>
68
69#include <fs/nfs/nfsport.h>
70#include <fs/nfsclient/nfsnode.h>
71#include <fs/nfsclient/nfsmount.h>
72#include <fs/nfsclient/nfs.h>
73#include <fs/nfsclient/nfs_kdtrace.h>
71
72#include <netinet/in.h>
73
74/*
75 * Note that stdarg.h and the ANSI style va_start macro is used for both
76 * ANSI and traditional C compilers.
77 */
78#include <machine/stdarg.h>

--- 154 unchanged lines hidden (view full) ---

233
234 if ((time_second - np->n_attrstamp) >= timeo &&
235 (mustflush != 0 || np->n_attrstamp == 0)) {
236 newnfsstats.attrcache_misses++;
237 mtx_unlock(&np->n_mtx);
238#ifdef NFS_ACDEBUG
239 mtx_unlock(&Giant); /* ncl_printf() */
240#endif
74
75#include <netinet/in.h>
76
77/*
78 * Note that stdarg.h and the ANSI style va_start macro is used for both
79 * ANSI and traditional C compilers.
80 */
81#include <machine/stdarg.h>

--- 154 unchanged lines hidden (view full) ---

236
237 if ((time_second - np->n_attrstamp) >= timeo &&
238 (mustflush != 0 || np->n_attrstamp == 0)) {
239 newnfsstats.attrcache_misses++;
240 mtx_unlock(&np->n_mtx);
241#ifdef NFS_ACDEBUG
242 mtx_unlock(&Giant); /* ncl_printf() */
243#endif
244 KDTRACE_NFS_ATTRCACHE_GET_MISS(vp);
241 return( ENOENT);
242 }
243 newnfsstats.attrcache_hits++;
244 if (vap->va_size != np->n_size) {
245 if (vap->va_type == VREG) {
246 if (np->n_flag & NMODIFIED) {
247 if (vap->va_size < np->n_size)
248 vap->va_size = np->n_size;

--- 13 unchanged lines hidden (view full) ---

262 vaper->va_atime = np->n_atim;
263 if (np->n_flag & NUPD)
264 vaper->va_mtime = np->n_mtim;
265 }
266 mtx_unlock(&np->n_mtx);
267#ifdef NFS_ACDEBUG
268 mtx_unlock(&Giant); /* ncl_printf() */
269#endif
245 return( ENOENT);
246 }
247 newnfsstats.attrcache_hits++;
248 if (vap->va_size != np->n_size) {
249 if (vap->va_type == VREG) {
250 if (np->n_flag & NMODIFIED) {
251 if (vap->va_size < np->n_size)
252 vap->va_size = np->n_size;

--- 13 unchanged lines hidden (view full) ---

266 vaper->va_atime = np->n_atim;
267 if (np->n_flag & NUPD)
268 vaper->va_mtime = np->n_mtim;
269 }
270 mtx_unlock(&np->n_mtx);
271#ifdef NFS_ACDEBUG
272 mtx_unlock(&Giant); /* ncl_printf() */
273#endif
274 KDTRACE_NFS_ATTRCACHE_GET_HIT(vp, vap);
270 return (0);
271}
272
273static nfsuint64 nfs_nullcookie = { { 0, 0 } };
274/*
275 * This function finds the directory cookie that corresponds to the
276 * logical byte offset given.
277 */

--- 131 unchanged lines hidden ---
275 return (0);
276}
277
278static nfsuint64 nfs_nullcookie = { { 0, 0 } };
279/*
280 * This function finds the directory cookie that corresponds to the
281 * logical byte offset given.
282 */

--- 131 unchanged lines hidden ---