Deleted Added
full compact
null_vnops.c (189961) null_vnops.c (193092)
1/*-
2 * Copyright (c) 1992, 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 * John Heidemann of the UCLA Ficus project.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

31 *
32 * @(#)null_vnops.c 8.6 (Berkeley) 5/27/95
33 *
34 * Ancestors:
35 * @(#)lofs_vnops.c 1.2 (Berkeley) 6/18/92
36 * ...and...
37 * @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project
38 *
1/*-
2 * Copyright (c) 1992, 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 * John Heidemann of the UCLA Ficus project.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

31 *
32 * @(#)null_vnops.c 8.6 (Berkeley) 5/27/95
33 *
34 * Ancestors:
35 * @(#)lofs_vnops.c 1.2 (Berkeley) 6/18/92
36 * ...and...
37 * @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project
38 *
39 * $FreeBSD: head/sys/fs/nullfs/null_vnops.c 189961 2009-03-18 13:54:35Z pho $
39 * $FreeBSD: head/sys/fs/nullfs/null_vnops.c 193092 2009-05-30 13:59:05Z trasz $
40 */
41
42/*
43 * Null Layer
44 *
45 * (See mount_nullfs(8) for more information.)
46 *
47 * The null layer duplicates a portion of the filesystem

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

467 break;
468 default:
469 break;
470 }
471 }
472 return (null_bypass((struct vop_generic_args *)ap));
473}
474
40 */
41
42/*
43 * Null Layer
44 *
45 * (See mount_nullfs(8) for more information.)
46 *
47 * The null layer duplicates a portion of the filesystem

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

467 break;
468 default:
469 break;
470 }
471 }
472 return (null_bypass((struct vop_generic_args *)ap));
473}
474
475static int
476null_accessx(struct vop_accessx_args *ap)
477{
478 struct vnode *vp = ap->a_vp;
479 accmode_t accmode = ap->a_accmode;
480
481 /*
482 * Disallow write attempts on read-only layers;
483 * unless the file is a socket, fifo, or a block or
484 * character device resident on the filesystem.
485 */
486 if (accmode & VWRITE) {
487 switch (vp->v_type) {
488 case VDIR:
489 case VLNK:
490 case VREG:
491 if (vp->v_mount->mnt_flag & MNT_RDONLY)
492 return (EROFS);
493 break;
494 default:
495 break;
496 }
497 }
498 return (null_bypass((struct vop_generic_args *)ap));
499}
500
475/*
476 * We handle this to eliminate null FS to lower FS
477 * file moving. Don't know why we don't allow this,
478 * possibly we should.
479 */
480static int
481null_rename(struct vop_rename_args *ap)
482{

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

715}
716
717/*
718 * Global vfs data structures
719 */
720struct vop_vector null_vnodeops = {
721 .vop_bypass = null_bypass,
722 .vop_access = null_access,
501/*
502 * We handle this to eliminate null FS to lower FS
503 * file moving. Don't know why we don't allow this,
504 * possibly we should.
505 */
506static int
507null_rename(struct vop_rename_args *ap)
508{

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

741}
742
743/*
744 * Global vfs data structures
745 */
746struct vop_vector null_vnodeops = {
747 .vop_bypass = null_bypass,
748 .vop_access = null_access,
749 .vop_accessx = null_accessx,
723 .vop_bmap = VOP_EOPNOTSUPP,
724 .vop_getattr = null_getattr,
725 .vop_getwritemount = null_getwritemount,
726 .vop_inactive = null_inactive,
727 .vop_islocked = vop_stdislocked,
728 .vop_lock1 = null_lock,
729 .vop_lookup = null_lookup,
730 .vop_open = null_open,
731 .vop_print = null_print,
732 .vop_reclaim = null_reclaim,
733 .vop_rename = null_rename,
734 .vop_setattr = null_setattr,
735 .vop_strategy = VOP_EOPNOTSUPP,
736 .vop_unlock = null_unlock,
737 .vop_vptocnp = vop_stdvptocnp,
738 .vop_vptofh = null_vptofh,
739};
750 .vop_bmap = VOP_EOPNOTSUPP,
751 .vop_getattr = null_getattr,
752 .vop_getwritemount = null_getwritemount,
753 .vop_inactive = null_inactive,
754 .vop_islocked = vop_stdislocked,
755 .vop_lock1 = null_lock,
756 .vop_lookup = null_lookup,
757 .vop_open = null_open,
758 .vop_print = null_print,
759 .vop_reclaim = null_reclaim,
760 .vop_rename = null_rename,
761 .vop_setattr = null_setattr,
762 .vop_strategy = VOP_EOPNOTSUPP,
763 .vop_unlock = null_unlock,
764 .vop_vptocnp = vop_stdvptocnp,
765 .vop_vptofh = null_vptofh,
766};