aboutsummaryrefslogtreecommitdiff
path: root/sys/fs
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-06-17 00:14:54 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-06-17 00:14:54 +0000
commit4198293b2568c3fa287e7bde71162e9d442f4305 (patch)
tree8cfbc1a406237f68a9a68a544eb0b3129d6312ea /sys/fs
parent24d58133b7f7836aa02c66016f62b2a8d452ea18 (diff)
parentf2eb97b2cded8209e6d0d35930507dcfcf5bc794 (diff)
Merge ^/head r319801 through r320041.
Notes
Notes: svn path=/projects/clang500-import/; revision=320042
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/ext2fs/ext2_acl.c4
-rw-r--r--sys/fs/ext2fs/ext2_extattr.c2
-rw-r--r--sys/fs/ext2fs/ext2_vnops.c14
-rw-r--r--sys/fs/msdosfs/denode.h8
-rw-r--r--sys/fs/msdosfs/direntry.h4
-rw-r--r--sys/fs/msdosfs/fat.h7
-rw-r--r--sys/fs/nfs/nfsproto.h16
7 files changed, 47 insertions, 8 deletions
diff --git a/sys/fs/ext2fs/ext2_acl.c b/sys/fs/ext2fs/ext2_acl.c
index 0f47c2981f94..fdf71214cb45 100644
--- a/sys/fs/ext2fs/ext2_acl.c
+++ b/sys/fs/ext2fs/ext2_acl.c
@@ -49,6 +49,8 @@
#include <fs/ext2fs/ext2_dinode.h>
#include <fs/ext2fs/ext2_mount.h>
+#ifdef UFS_ACL
+
void
ext2_sync_acl_from_inode(struct inode *ip, struct acl *acl)
{
@@ -522,3 +524,5 @@ ext2_aclcheck(struct vop_aclcheck_args *ap)
return (acl_posix1e_check(ap->a_aclp));
}
+
+#endif /* UFS_ACL */
diff --git a/sys/fs/ext2fs/ext2_extattr.c b/sys/fs/ext2fs/ext2_extattr.c
index 9c821949b550..d19d4a0daf6e 100644
--- a/sys/fs/ext2fs/ext2_extattr.c
+++ b/sys/fs/ext2fs/ext2_extattr.c
@@ -89,7 +89,7 @@ ext2_extattr_name_to_bsd(int attrnamespace, const char *name, int* name_len)
*/
#ifdef EXT2FS_DEBUG
printf("can not convert ext2fs name to bsd: namespace=%d\n", attrnamespace);
-#endif /* DEBUG */
+#endif
return (NULL);
}
diff --git a/sys/fs/ext2fs/ext2_vnops.c b/sys/fs/ext2fs/ext2_vnops.c
index 68d49827b3f2..a2d89e4b9ca3 100644
--- a/sys/fs/ext2fs/ext2_vnops.c
+++ b/sys/fs/ext2fs/ext2_vnops.c
@@ -164,9 +164,11 @@ struct vop_vector ext2_vnodeops = {
.vop_getextattr = ext2_getextattr,
.vop_listextattr = ext2_listextattr,
.vop_setextattr = ext2_setextattr,
+#ifdef UFS_ACL
.vop_getacl = ext2_getacl,
.vop_setacl = ext2_setacl,
.vop_aclcheck = ext2_aclcheck,
+#endif /* UFS_ACL */
.vop_vptofh = ext2_vptofh,
};
@@ -1087,6 +1089,7 @@ out:
return (error);
}
+#ifdef UFS_ACL
static int
ext2_do_posix1e_acl_inheritance_dir(struct vnode *dvp, struct vnode *tvp,
mode_t dmode, struct ucred *cred, struct thread *td)
@@ -1231,6 +1234,8 @@ out:
return (error);
}
+#endif /* UFS_ACL */
+
/*
* Mkdir system call
*/
@@ -1340,6 +1345,7 @@ ext2_mkdir(struct vop_mkdir_args *ap)
ip->i_flag |= IN_CHANGE;
}
+#ifdef UFS_ACL
if (dvp->v_mount->mnt_flag & MNT_ACLS) {
error = ext2_do_posix1e_acl_inheritance_dir(dvp, tvp, dmode,
cnp->cn_cred, cnp->cn_thread);
@@ -1347,6 +1353,8 @@ ext2_mkdir(struct vop_mkdir_args *ap)
goto bad;
}
+#endif /* UFS_ACL */
+
/* Directory set up, now install its entry in the parent directory. */
error = ext2_direnter(ip, dvp, cnp);
if (error) {
@@ -1601,6 +1609,8 @@ ext2_pathconf(struct vop_pathconf_args *ap)
case _PC_NO_TRUNC:
*ap->a_retval = 1;
break;
+
+#ifdef UFS_ACL
case _PC_ACL_EXTENDED:
if (ap->a_vp->v_mount->mnt_flag & MNT_ACLS)
*ap->a_retval = 1;
@@ -1613,6 +1623,8 @@ ext2_pathconf(struct vop_pathconf_args *ap)
else
*ap->a_retval = 3;
break;
+#endif /* UFS_ACL */
+
case _PC_MIN_HOLE_SIZE:
*ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize;
break;
@@ -1927,12 +1939,14 @@ ext2_makeinode(int mode, struct vnode *dvp, struct vnode **vpp,
if (error)
goto bad;
+#ifdef UFS_ACL
if (dvp->v_mount->mnt_flag & MNT_ACLS) {
error = ext2_do_posix1e_acl_inheritance_file(dvp, tvp, mode,
cnp->cn_cred, cnp->cn_thread);
if (error)
goto bad;
}
+#endif /* UFS_ACL */
error = ext2_direnter(ip, dvp, cnp);
if (error)
diff --git a/sys/fs/msdosfs/denode.h b/sys/fs/msdosfs/denode.h
index 7960f20ddf22..1c7fd5e1db1f 100644
--- a/sys/fs/msdosfs/denode.h
+++ b/sys/fs/msdosfs/denode.h
@@ -47,6 +47,8 @@
*
* October 1992
*/
+#ifndef _FS_MSDOSFS_DENODE_H_
+#define _FS_MSDOSFS_DENODE_H_
/*
* This is the pc filesystem specific portion of the vnode structure.
@@ -207,7 +209,7 @@ struct denode {
((dep)->de_Attributes & ATTR_DIRECTORY) ? 0 : (dep)->de_FileSize), \
putushort((dp)->deHighClust, (dep)->de_StartCluster >> 16))
-#ifdef _KERNEL
+#if defined(_KERNEL) || defined(MAKEFS)
#define VTODE(vp) ((struct denode *)(vp)->v_data)
#define DETOV(de) ((de)->de_vnode)
@@ -277,4 +279,6 @@ int deupdat(struct denode *dep, int waitfor);
int removede(struct denode *pdep, struct denode *dep);
int detrunc(struct denode *dep, u_long length, int flags, struct ucred *cred);
int doscheckpath( struct denode *source, struct denode *target);
-#endif /* _KERNEL */
+#endif /* _KERNEL || MAKEFS */
+#endif /* !_FS_MSDOSFS_DENODE_H_ */
+
diff --git a/sys/fs/msdosfs/direntry.h b/sys/fs/msdosfs/direntry.h
index 6ff18eb4a9ca..e36e8e80137f 100644
--- a/sys/fs/msdosfs/direntry.h
+++ b/sys/fs/msdosfs/direntry.h
@@ -133,7 +133,7 @@ struct winentry {
#define DD_YEAR_MASK 0xFE00 /* year - 1980 */
#define DD_YEAR_SHIFT 9
-#ifdef _KERNEL
+#if defined(_KERNEL) || defined(MAKEFS)
struct mbnambuf {
size_t nb_len;
int nb_last_id;
@@ -159,5 +159,5 @@ int win2unixfn(struct mbnambuf *nbp, struct winentry *wep, int chksum,
uint8_t winChksum(uint8_t *name);
int winSlotCnt(const u_char *un, size_t unlen, struct msdosfsmount *pmp);
size_t winLenFixup(const u_char *un, size_t unlen);
-#endif /* _KERNEL */
+#endif /* _KERNEL || MAKEFS */
#endif /* !_FS_MSDOSFS_DIRENTRY_H_ */
diff --git a/sys/fs/msdosfs/fat.h b/sys/fs/msdosfs/fat.h
index ff8566e82d09..46e7af4f7550 100644
--- a/sys/fs/msdosfs/fat.h
+++ b/sys/fs/msdosfs/fat.h
@@ -48,6 +48,8 @@
* October 1992
*/
+#ifndef _FS_MSDOSFS_FAT_H_
+#define _FS_MSDOSFS_FAT_H_
/*
* Some useful cluster numbers.
*/
@@ -78,7 +80,7 @@
#define MSDOSFSEOF(pmp, cn) ((((cn) | ~(pmp)->pm_fatmask) & CLUST_EOFS) == CLUST_EOFS)
-#ifdef _KERNEL
+#if defined(_KERNEL) || defined(MAKEFS)
/*
* These are the values for the function argument to the function
* fatentry().
@@ -101,4 +103,5 @@ int extendfile(struct denode *dep, u_long count, struct buf **bpp, u_long *ncp,
void fc_purge(struct denode *dep, u_int frcn);
int markvoldirty(struct msdosfsmount *pmp, int dirty);
-#endif /* _KERNEL */
+#endif /* _KERNEL || MAKEFS */
+#endif /* !_FS_MSDOSFS_FAT_H_ */
diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h
index 420f44223960..9c724357d132 100644
--- a/sys/fs/nfs/nfsproto.h
+++ b/sys/fs/nfs/nfsproto.h
@@ -56,8 +56,22 @@
#define NFS_MAXDGRAMDATA 16384
#define NFS_MAXPATHLEN 1024
#define NFS_MAXNAMLEN 255
+/*
+ * Calculating the maximum XDR overhead for an NFS RPC isn't easy.
+ * NFS_MAXPKTHDR is antiquated and assumes AUTH_SYS over UDP.
+ * NFS_MAXXDR should be sufficient for all NFS versions over TCP.
+ * It includes:
+ * - Maximum RPC message header. It can include 2 400byte authenticators plus
+ * a machine name of unlimited length, although it is usually relatively
+ * small.
+ * - XDR overheads for the NFSv4 compound. This can include Owner and
+ * Owner_group strings, which are usually fairly small, but are allowed
+ * to be up to 1024 bytes each.
+ * 4096 is overkill, but should always be sufficient.
+ */
#define NFS_MAXPKTHDR 404
-#define NFS_MAXPACKET (NFS_SRVMAXIO + 2048)
+#define NFS_MAXXDR 4096
+#define NFS_MAXPACKET (NFS_SRVMAXIO + NFS_MAXXDR)
#define NFS_MINPACKET 20
#define NFS_FABLKSIZE 512 /* Size in bytes of a block wrt fa_blocks */
#define NFSV4_MINORVERSION 0 /* V4 Minor version */