mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
Restored ufs_pathconf() from rev.1.61. vop_stdpathconf() is too
general to be of much use. Using it here broke the _PC_NAME_MAX, _PC_NO_TRUNC and _PC_PATH_MAX cases, and weakened the _PC_MAX_CANON, _PC_MAX_INPUT and _PC_VDISABLE cases.
This commit is contained in:
parent
fa18377023
commit
2573d99c75
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=31699
1 changed files with 41 additions and 2 deletions
|
@ -36,7 +36,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95
|
||||
* $Id: ufs_vnops.c,v 1.69 1997/11/20 16:08:56 bde Exp $
|
||||
* $Id: ufs_vnops.c,v 1.70 1997/12/12 14:14:44 peter Exp $
|
||||
*/
|
||||
|
||||
#include "opt_quota.h"
|
||||
|
@ -50,6 +50,7 @@
|
|||
#include <sys/buf.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/unistd.h>
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/dirent.h>
|
||||
|
@ -79,6 +80,7 @@ static int ufs_mkdir __P((struct vop_mkdir_args *));
|
|||
static int ufs_mknod __P((struct vop_mknod_args *));
|
||||
static int ufs_mmap __P((struct vop_mmap_args *));
|
||||
static int ufs_open __P((struct vop_open_args *));
|
||||
static int ufs_pathconf __P((struct vop_pathconf_args *));
|
||||
static int ufs_print __P((struct vop_print_args *));
|
||||
static int ufs_readdir __P((struct vop_readdir_args *));
|
||||
static int ufs_readlink __P((struct vop_readlink_args *));
|
||||
|
@ -1851,6 +1853,43 @@ ufsfifo_close(ap)
|
|||
return (VOCALL (fifo_vnodeop_p, VOFFSET(vop_close), ap));
|
||||
}
|
||||
|
||||
/*
|
||||
* Return POSIX pathconf information applicable to ufs filesystems.
|
||||
*/
|
||||
int
|
||||
ufs_pathconf(ap)
|
||||
struct vop_pathconf_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_name;
|
||||
int *a_retval;
|
||||
} */ *ap;
|
||||
{
|
||||
|
||||
switch (ap->a_name) {
|
||||
case _PC_LINK_MAX:
|
||||
*ap->a_retval = LINK_MAX;
|
||||
return (0);
|
||||
case _PC_NAME_MAX:
|
||||
*ap->a_retval = NAME_MAX;
|
||||
return (0);
|
||||
case _PC_PATH_MAX:
|
||||
*ap->a_retval = PATH_MAX;
|
||||
return (0);
|
||||
case _PC_PIPE_BUF:
|
||||
*ap->a_retval = PIPE_BUF;
|
||||
return (0);
|
||||
case _PC_CHOWN_RESTRICTED:
|
||||
*ap->a_retval = 1;
|
||||
return (0);
|
||||
case _PC_NO_TRUNC:
|
||||
*ap->a_retval = 1;
|
||||
return (0);
|
||||
default:
|
||||
return (EINVAL);
|
||||
}
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
/*
|
||||
* Advisory record locking support
|
||||
*/
|
||||
|
@ -2092,7 +2131,7 @@ static struct vnodeopv_entry_desc ufs_vnodeop_entries[] = {
|
|||
{ &vop_mknod_desc, (vop_t *) ufs_mknod },
|
||||
{ &vop_mmap_desc, (vop_t *) ufs_mmap },
|
||||
{ &vop_open_desc, (vop_t *) ufs_open },
|
||||
{ &vop_pathconf_desc, (vop_t *) vop_stdpathconf },
|
||||
{ &vop_pathconf_desc, (vop_t *) ufs_pathconf },
|
||||
{ &vop_print_desc, (vop_t *) ufs_print },
|
||||
{ &vop_readdir_desc, (vop_t *) ufs_readdir },
|
||||
{ &vop_readlink_desc, (vop_t *) ufs_readlink },
|
||||
|
|
Loading…
Reference in a new issue