diff options
author | pav <pav@FreeBSD.org> | 2006-12-23 18:53:22 +0000 |
---|---|---|
committer | pav <pav@FreeBSD.org> | 2006-12-23 18:53:22 +0000 |
commit | 0fd460000c37ab211fa7155cce13392e9c7b8eb2 (patch) | |
tree | 105d5666a16ff9369fa8df6ce1efdbd2a2c4fc50 /sys/fs | |
parent | f3b0f3c65da4281656f97049f4bd4f6bdbab83b3 (diff) | |
download | FreeBSD-src-0fd460000c37ab211fa7155cce13392e9c7b8eb2.zip FreeBSD-src-0fd460000c37ab211fa7155cce13392e9c7b8eb2.tar.gz |
Call vnode_create_vobject() in VOP_OPEN. Makes mmap work on UDF filesystem.
PR: kern/92040
Approved by: scottl
MFC after: 1 week
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/udf/udf_vnops.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/fs/udf/udf_vnops.c b/sys/fs/udf/udf_vnops.c index 07bd561..676f46d 100644 --- a/sys/fs/udf/udf_vnops.c +++ b/sys/fs/udf/udf_vnops.c @@ -57,6 +57,7 @@ extern struct iconv_functions *udf_iconv; static vop_access_t udf_access; static vop_getattr_t udf_getattr; +static vop_open_t udf_open; static vop_ioctl_t udf_ioctl; static vop_pathconf_t udf_pathconf; static vop_read_t udf_read; @@ -80,6 +81,7 @@ static struct vop_vector udf_vnodeops = { .vop_getattr = udf_getattr, .vop_ioctl = udf_ioctl, .vop_lookup = vfs_cache_lookup, + .vop_open = udf_open, .vop_pathconf = udf_pathconf, .vop_read = udf_read, .vop_readdir = udf_readdir, @@ -159,6 +161,16 @@ udf_access(struct vop_access_args *a) a_mode, a->a_cred, NULL)); } +static int +udf_open(struct vop_open_args *ap) { + struct udf_node *np = VTON(ap->a_vp); + off_t fsize; + + fsize = le64toh(np->fentry->inf_len); + vnode_create_vobject(ap->a_vp, fsize, ap->a_td); + return 0; +} + static int mon_lens[2][12] = { {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} |