summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ext2fs/ext2fs_inode.c
diff options
context:
space:
mode:
authornatano <natano@openbsd.org>2016-02-27 18:50:38 +0000
committernatano <natano@openbsd.org>2016-02-27 18:50:38 +0000
commit3484f39e521e2cbedf2e0a8b8c025df31c8e8ab1 (patch)
treebebca404106d53c4f1804ce526f8029ab43b7189 /sys/ufs/ext2fs/ext2fs_inode.c
parentFix STANDARDS: use the appropriate .St argument and add the information (diff)
downloadwireguard-openbsd-3484f39e521e2cbedf2e0a8b8c025df31c8e8ab1.tar.xz
wireguard-openbsd-3484f39e521e2cbedf2e0a8b8c025df31c8e8ab1.zip
Move mnt_maxsymlink from struct mount to struct ufsmount.
The concept of differentiating between "short" and "long" symlinks is specific to ufs/, so it shouldn't creep into the generic fs layer. Inspired by a similar commit to NetBSD. While there replace all references to mnt_maxsymlinklen in ufs/ext2fs with EXT2_MAXSYMLINKLEN, which is the constant max short symlink len for ext2fs. This allows to get rid of some (mnt_maxsymlinklen == 0) checks there, which is always false for ext2fs. input and ok stefan@ ok millert@
Diffstat (limited to 'sys/ufs/ext2fs/ext2fs_inode.c')
-rw-r--r--sys/ufs/ext2fs/ext2fs_inode.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_inode.c b/sys/ufs/ext2fs/ext2fs_inode.c
index 97349af5fcd..c3edcad6ad2 100644
--- a/sys/ufs/ext2fs/ext2fs_inode.c
+++ b/sys/ufs/ext2fs/ext2fs_inode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_inode.c,v 1.56 2015/03/14 03:38:52 jsg Exp $ */
+/* $OpenBSD: ext2fs_inode.c,v 1.57 2016/02/27 18:50:38 natano Exp $ */
/* $NetBSD: ext2fs_inode.c,v 1.24 2001/06/19 12:59:18 wiz Exp $ */
/*
@@ -227,10 +227,7 @@ ext2fs_truncate(struct inode *oip, off_t length, int flags, struct ucred *cred)
ovp->v_type != VLNK)
return (0);
- if (ovp->v_type == VLNK &&
- (ext2fs_size(oip) < ovp->v_mount->mnt_maxsymlinklen ||
- (ovp->v_mount->mnt_maxsymlinklen == 0 &&
- oip->i_e2fs_nblock == 0))) {
+ if (ovp->v_type == VLNK && ext2fs_size(oip) < EXT2_MAXSYMLINKLEN) {
#ifdef DIAGNOSTIC
if (length != 0)
panic("ext2fs_truncate: partial truncate of symlink");