fix unused variable warnings

This commit is contained in:
christos 2013-10-18 19:56:55 +00:00
parent 0fbaa47180
commit 91b2f42c8c
7 changed files with 50 additions and 124 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: udf.h,v 1.45 2012/07/27 22:55:30 drochner Exp $ */
/* $NetBSD: udf.h,v 1.46 2013/10/18 19:56:55 christos Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@ -78,7 +78,7 @@ extern int udf_verbose;
/* initial value of udf_verbose */
#define UDF_DEBUGGING 0
#ifdef DEBUG
#ifdef UDF_DEBUG
#define DPRINTF(name, arg) { \
if (udf_verbose & UDF_DEBUG_##name) {\
printf arg;\

View File

@ -1,4 +1,4 @@
/* $NetBSD: udf_allocation.c,v 1.34 2013/08/09 20:13:18 reinoud Exp $ */
/* $NetBSD: udf_allocation.c,v 1.35 2013/10/18 19:56:55 christos Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef lint
__KERNEL_RCSID(0, "$NetBSD: udf_allocation.c,v 1.34 2013/08/09 20:13:18 reinoud Exp $");
__KERNEL_RCSID(0, "$NetBSD: udf_allocation.c,v 1.35 2013/10/18 19:56:55 christos Exp $");
#endif /* not lint */
@ -342,23 +342,15 @@ udf_node_sanity_check(struct udf_node *udf_node,
uint64_t *cnt_inflen, uint64_t *cnt_logblksrec) {
struct file_entry *fe;
struct extfile_entry *efe;
struct icb_tag *icbtag;
uint64_t inflen, logblksrec;
int dscr_size, lb_size;
lb_size = udf_rw32(udf_node->ump->logical_vol->lb_size);
fe = udf_node->fe;
efe = udf_node->efe;
if (fe) {
icbtag = &fe->icbtag;
inflen = udf_rw64(fe->inf_len);
dscr_size = sizeof(struct file_entry) -1;
logblksrec = udf_rw64(fe->logblks_rec);
} else {
icbtag = &efe->icbtag;
inflen = udf_rw64(efe->inf_len);
dscr_size = sizeof(struct extfile_entry) -1;
logblksrec = udf_rw64(efe->logblks_rec);
}
*cnt_logblksrec = logblksrec;
@ -1311,9 +1303,8 @@ udf_free_allocated_space(struct udf_mount *ump, uint32_t lb_num,
uint16_t vpart_num, uint32_t num_lb)
{
struct udf_bitmap *bitmap;
struct part_desc *pdesc;
struct logvol_int_desc *lvid;
uint32_t ptov, lb_map, udf_rw32_lbmap;
uint32_t lb_map, udf_rw32_lbmap;
uint32_t *freepos, free_lbs;
int phys_part;
int error;
@ -1327,14 +1318,10 @@ udf_free_allocated_space(struct udf_mount *ump, uint32_t lb_num,
mutex_enter(&ump->allocate_mutex);
/* get partition backing up this vpart_num */
pdesc = ump->partitions[ump->vtop[vpart_num]];
switch (ump->vtop_tp[vpart_num]) {
case UDF_VTOP_TYPE_PHYS :
case UDF_VTOP_TYPE_SPARABLE :
/* free space to freed or unallocated space bitmap */
ptov = udf_rw32(pdesc->start_loc);
phys_part = ump->vtop[vpart_num];
/* first try freed space bitmap */
@ -1653,7 +1640,7 @@ udf_late_allocate_buf(struct udf_mount *ump, struct buf *buf,
uint64_t *lmapping, struct long_ad *node_ad_cpy, uint16_t *vpart_nump)
{
struct udf_node *udf_node = VTOI(buf->b_vp);
int lb_size, blks, udf_c_type;
int lb_size, udf_c_type;
int vpart_num, num_lb;
int error, s;
@ -1666,7 +1653,6 @@ udf_late_allocate_buf(struct udf_mount *ump, struct buf *buf,
lb_size = udf_rw32(ump->logical_vol->lb_size);
num_lb = (buf->b_bcount + lb_size -1) / lb_size;
blks = lb_size / DEV_BSIZE;
udf_c_type = buf->b_udf_c_type;
KASSERT(lb_size == ump->discinfo.sector_size);
@ -1774,8 +1760,7 @@ udf_wipe_adslots(struct udf_node *udf_node)
struct file_entry *fe;
struct extfile_entry *efe;
struct alloc_ext_entry *ext;
uint64_t inflen, objsize;
uint32_t lb_size, dscr_size, l_ea, l_ad, max_l_ad, crclen;
uint32_t lb_size, dscr_size, l_ea, max_l_ad, crclen;
uint8_t *data_pos;
int extnr;
@ -1784,18 +1769,12 @@ udf_wipe_adslots(struct udf_node *udf_node)
fe = udf_node->fe;
efe = udf_node->efe;
if (fe) {
inflen = udf_rw64(fe->inf_len);
objsize = inflen;
dscr_size = sizeof(struct file_entry) -1;
l_ea = udf_rw32(fe->l_ea);
l_ad = udf_rw32(fe->l_ad);
data_pos = (uint8_t *) fe + dscr_size + l_ea;
} else {
inflen = udf_rw64(efe->inf_len);
objsize = udf_rw64(efe->obj_size);
dscr_size = sizeof(struct extfile_entry) -1;
l_ea = udf_rw32(efe->l_ea);
l_ad = udf_rw32(efe->l_ad);
data_pos = (uint8_t *) efe + dscr_size + l_ea;
}
max_l_ad = lb_size - dscr_size - l_ea;
@ -1840,13 +1819,10 @@ udf_get_adslot(struct udf_node *udf_node, int slot, struct long_ad *icb,
struct short_ad *short_ad;
struct long_ad *long_ad, l_icb;
uint32_t offset;
uint32_t lb_size, dscr_size, l_ea, l_ad, flags;
uint32_t dscr_size, l_ea, l_ad, flags;
uint8_t *data_pos;
int icbflags, addr_type, adlen, extnr;
/* determine what descriptor we are in */
lb_size = udf_rw32(udf_node->ump->logical_vol->lb_size);
fe = udf_node->fe;
efe = udf_node->efe;
if (fe) {
@ -2196,12 +2172,10 @@ udf_count_alloc_exts(struct udf_node *udf_node)
uint16_t vpart_num;
int slot, eof;
int num_extents, extnr;
int lb_size;
if (udf_node->num_extensions == 0)
return;
lb_size = udf_rw32(udf_node->ump->logical_vol->lb_size);
/* count number of allocation extents in use */
num_extents = 0;
slot = 0;
@ -2623,7 +2597,6 @@ out:
int
udf_grow_node(struct udf_node *udf_node, uint64_t new_size)
{
union dscrptr *dscr;
struct vnode *vp = udf_node->vnode;
struct udf_mount *ump = udf_node->ump;
struct file_entry *fe;
@ -2637,9 +2610,9 @@ udf_grow_node(struct udf_node *udf_node, uint64_t new_size)
uint32_t icbflags, len, flags, max_len;
uint32_t max_l_ad, l_ad, l_ea;
uint16_t my_part, dst_part;
uint8_t *data_pos, *evacuated_data;
uint8_t *evacuated_data;
int addr_type;
int slot, cpy_slot;
int slot;
int eof, error;
DPRINTF(ALLOC, ("udf_grow_node\n"));
@ -2658,7 +2631,6 @@ udf_grow_node(struct udf_node *udf_node, uint64_t new_size)
fe = udf_node->fe;
efe = udf_node->efe;
if (fe) {
dscr = (union dscrptr *) fe;
icbtag = &fe->icbtag;
inflen = udf_rw64(fe->inf_len);
objsize = inflen;
@ -2666,7 +2638,6 @@ udf_grow_node(struct udf_node *udf_node, uint64_t new_size)
l_ea = udf_rw32(fe->l_ea);
l_ad = udf_rw32(fe->l_ad);
} else {
dscr = (union dscrptr *) efe;
icbtag = &efe->icbtag;
inflen = udf_rw64(efe->inf_len);
objsize = udf_rw64(efe->obj_size);
@ -2674,7 +2645,6 @@ udf_grow_node(struct udf_node *udf_node, uint64_t new_size)
l_ea = udf_rw32(efe->l_ea);
l_ad = udf_rw32(efe->l_ad);
}
data_pos = (uint8_t *) dscr + dscr_size + l_ea;
max_l_ad = lb_size - dscr_size - l_ea;
icbflags = udf_rw16(icbtag->flags);
@ -2769,7 +2739,6 @@ udf_grow_node(struct udf_node *udf_node, uint64_t new_size)
} else {
/* goto the last entry (if any) */
slot = 0;
cpy_slot = 0;
foffset = 0;
memset(&c_ad, 0, sizeof(struct long_ad));
for (;;) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: udf_strat_direct.c,v 1.10 2009/05/20 15:30:26 reinoud Exp $ */
/* $NetBSD: udf_strat_direct.c,v 1.11 2013/10/18 19:56:55 christos Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef lint
__KERNEL_RCSID(0, "$NetBSD: udf_strat_direct.c,v 1.10 2009/05/20 15:30:26 reinoud Exp $");
__KERNEL_RCSID(0, "$NetBSD: udf_strat_direct.c,v 1.11 2013/10/18 19:56:55 christos Exp $");
#endif /* not lint */
@ -246,15 +246,15 @@ udf_queue_buf_direct(struct udf_strat_args *args)
struct buf *nestbuf;
struct desc_tag *tag;
struct long_ad *node_ad_cpy;
uint64_t *lmapping, *pmapping, *lmappos, blknr, run_start;
uint32_t our_sectornr, sectornr;
uint32_t lb_size, buf_offset, rbuflen, bpos;
uint64_t *lmapping, *pmapping, *lmappos, run_start;
uint32_t sectornr;
uint32_t buf_offset, rbuflen, bpos;
uint16_t vpart_num;
uint8_t *fidblk;
off_t rblk;
int sector_size = ump->discinfo.sector_size;
int blks = sector_size / DEV_BSIZE;
int len, buf_len, sector, sectors, run_length;
int blks = sector_size / DEV_BSIZE;
int what, class, queue;
KASSERT(ump);
@ -280,6 +280,9 @@ udf_queue_buf_direct(struct udf_strat_args *args)
(ump->discinfo.mmc_cur & MMC_CAP_HW_DEFECTFREE) ||
(ump->vfs_mountp->mnt_flag & MNT_RDONLY));
#ifndef UDF_DEBUG
__USE(blks);
#endif
if (queue == UDF_SHED_READING) {
DPRINTF(SHEDULE, ("\nudf_issue_buf READ %p : sector %d type %d,"
"b_resid %d, b_bcount %d, b_bufsize %d\n",
@ -289,10 +292,6 @@ udf_queue_buf_direct(struct udf_strat_args *args)
return;
}
/* (sectorsize == lb_size) for UDF */
lb_size = udf_rw32(ump->logical_vol->lb_size);
blknr = buf->b_blkno;
our_sectornr = blknr / blks;
if (queue == UDF_SHED_WRITING) {
DPRINTF(SHEDULE, ("\nudf_issue_buf WRITE %p : sector %d "

View File

@ -1,4 +1,4 @@
/* $NetBSD: udf_strat_rmw.c,v 1.22 2009/07/08 19:04:08 reinoud Exp $ */
/* $NetBSD: udf_strat_rmw.c,v 1.23 2013/10/18 19:56:55 christos Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef lint
__KERNEL_RCSID(0, "$NetBSD: udf_strat_rmw.c,v 1.22 2009/07/08 19:04:08 reinoud Exp $");
__KERNEL_RCSID(0, "$NetBSD: udf_strat_rmw.c,v 1.23 2013/10/18 19:56:55 christos Exp $");
#endif /* not lint */
@ -372,7 +372,7 @@ udf_geteccline(struct udf_mount *ump, uint32_t sector, int flags)
uint32_t start_sector, lb_size, blobsize;
uint8_t *eccline_blob;
int line, line_offset;
int num_busy, ret;
int num_busy;
mutex_enter(&priv->discstrat_mutex);
@ -406,7 +406,7 @@ retry:
DPRINTF(ECCLINE, ("\tallocating new eccline\n"));
num_busy = (priv->num_queued[UDF_SHED_SEQWRITING] + priv->num_floating);
if ((flags & ECC_SEQWRITING) && (num_busy > UDF_ECCLINE_MAXBUSY)) {
ret = cv_timedwait(&priv->discstrat_cv,
cv_timedwait(&priv->discstrat_cv,
&priv->discstrat_mutex, hz/8);
goto retry;
}
@ -1466,7 +1466,6 @@ udf_discstrat_finish_rmw(struct udf_strat_args *args)
{
struct udf_mount *ump = args->ump;
struct strat_private *priv = PRIV(ump);
int error;
if (ump == NULL)
return;
@ -1476,8 +1475,7 @@ udf_discstrat_finish_rmw(struct udf_strat_args *args)
priv->run_thread = 0;
wakeup(priv->queue_lwp);
while (!priv->thread_finished) {
error = tsleep(&priv->run_thread, PRIBIO+1,
"udfshedfin", hz);
tsleep(&priv->run_thread, PRIBIO + 1, "udfshedfin", hz);
}
/* kthread should be finished now */

View File

@ -1,4 +1,4 @@
/* $NetBSD: udf_strat_sequential.c,v 1.11 2011/01/03 13:12:40 drochner Exp $ */
/* $NetBSD: udf_strat_sequential.c,v 1.12 2013/10/18 19:56:55 christos Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef lint
__KERNEL_RCSID(0, "$NetBSD: udf_strat_sequential.c,v 1.11 2011/01/03 13:12:40 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: udf_strat_sequential.c,v 1.12 2013/10/18 19:56:55 christos Exp $");
#endif /* not lint */
@ -302,7 +302,6 @@ udf_VAT_mapping_update(struct udf_mount *ump, struct buf *buf, uint32_t lb_map)
union dscrptr *fdscr = (union dscrptr *) buf->b_data;
struct vnode *vp = buf->b_vp;
struct udf_node *udf_node = VTOI(vp);
uint32_t lb_size, blks;
uint32_t lb_num;
uint32_t udf_rw32_lbmap;
int c_type = buf->b_udf_c_type;
@ -317,10 +316,6 @@ udf_VAT_mapping_update(struct udf_mount *ump, struct buf *buf, uint32_t lb_map)
if (c_type != UDF_C_NODE)
return;
/* we now have an UDF FE/EFE node on media with VAT (or VAT itself) */
lb_size = udf_rw32(ump->logical_vol->lb_size);
blks = lb_size / DEV_BSIZE;
udf_rw32_lbmap = udf_rw32(lb_map);
/* if we're the VAT itself, only update our assigned sector number */
@ -362,8 +357,8 @@ udf_issue_buf(struct udf_mount *ump, int queue, struct buf *buf)
union dscrptr *dscr;
struct long_ad *node_ad_cpy;
struct part_desc *pdesc;
uint64_t *lmapping, *lmappos, blknr;
uint32_t our_sectornr, sectornr, bpos;
uint64_t *lmapping, *lmappos;
uint32_t sectornr, bpos;
uint32_t ptov;
uint16_t vpart_num;
uint8_t *fidblk;
@ -381,9 +376,6 @@ udf_issue_buf(struct udf_mount *ump, int queue, struct buf *buf)
return;
}
blknr = buf->b_blkno;
our_sectornr = blknr / blks;
if (queue == UDF_SHED_WRITING) {
DPRINTF(SHEDULE, ("\nudf_issue_buf WRITE %p : sector %d "
"type %d, b_resid %d, b_bcount %d, b_bufsize %d\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: udf_subr.c,v 1.120 2013/07/07 19:49:44 reinoud Exp $ */
/* $NetBSD: udf_subr.c,v 1.121 2013/10/18 19:56:55 christos Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@ -29,7 +29,7 @@
#include <sys/cdefs.h>
#ifndef lint
__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.120 2013/07/07 19:49:44 reinoud Exp $");
__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.121 2013/10/18 19:56:55 christos Exp $");
#endif /* not lint */
@ -438,7 +438,7 @@ udf_check_track_metadata_overlap(struct udf_mount *ump,
uint32_t phys_part_start, phys_part_end, part_start, part_end;
uint32_t sector_size, len, alloclen, plb_num;
uint8_t *pos;
int addr_type, icblen, icbflags, flags;
int addr_type, icblen, icbflags;
/* get our track extents */
track_start = trackinfo->track_start;
@ -492,7 +492,6 @@ udf_check_track_metadata_overlap(struct udf_mount *ump,
/* pvpart_num = udf_rw16(l_ad->loc.part_num); */
}
/* process extent */
flags = UDF_EXT_FLAGS(len);
len = UDF_EXT_LEN(len);
part_start = phys_part_start + plb_num;
@ -1280,7 +1279,7 @@ udf_loose_lvint_history(struct udf_mount *ump)
struct logvol_int_desc *lvint;
uint32_t in_ext, in_pos, in_len;
uint32_t out_ext, out_wpos, out_len;
uint32_t lb_size, packet_size, lb_num;
uint32_t lb_num;
uint32_t len, start;
int ext, minext, extlen, cnt, cpy_len, dscr_type;
int losing;
@ -1288,9 +1287,6 @@ udf_loose_lvint_history(struct udf_mount *ump)
DPRINTF(VOLUMES, ("need to lose some lvint history\n"));
lb_size = udf_rw32(ump->logical_vol->lb_size);
packet_size = ump->data_track.packet_size; /* XXX data track */
/* search smallest extent */
trace = &ump->lvint_trace[0];
minext = trace->end - trace->start;
@ -1795,7 +1791,7 @@ udf_write_metadata_partition_spacetable(struct udf_mount *ump, int waitfor)
{
struct udf_node *bitmap_node;
union dscrptr *dscr;
uint64_t inflen, new_inflen;
uint64_t new_inflen;
int dummy, error;
bitmap_node = ump->metadatabitmap_node;
@ -1804,11 +1800,8 @@ udf_write_metadata_partition_spacetable(struct udf_mount *ump, int waitfor)
if (bitmap_node == NULL)
return 0;
if (bitmap_node->fe) {
inflen = udf_rw64(bitmap_node->fe->inf_len);
} else {
if (!bitmap_node->fe) {
KASSERT(bitmap_node->efe);
inflen = udf_rw64(bitmap_node->efe->inf_len);
}
/* reduce length to zero */
@ -1855,7 +1848,7 @@ udf_process_vds(struct udf_mount *ump) {
/* struct udf_args *args = &ump->mount_args; */
struct logvol_int_desc *lvint;
struct udf_logvol_info *lvinfo;
uint32_t n_pm, mt_l;
uint32_t n_pm;
uint8_t *pmap_pos;
char *domain_name, *map_name;
const char *check_name;
@ -1863,7 +1856,7 @@ udf_process_vds(struct udf_mount *ump) {
int pmap_stype, pmap_size;
int pmap_type, log_part, phys_part, raw_phys_part, maps_on;
int n_phys, n_virt, n_spar, n_meta;
int len, error;
int len;
if (ump == NULL)
return ENOENT;
@ -1894,7 +1887,7 @@ udf_process_vds(struct udf_mount *ump) {
}
/* retrieve logical volume integrity sequence */
error = udf_retrieve_lvint(ump);
(void)udf_retrieve_lvint(ump);
/*
* We need at least one logvol integrity descriptor recorded. Note
@ -1919,7 +1912,6 @@ udf_process_vds(struct udf_mount *ump) {
*/
DPRINTF(VOLUMES, ("checking logvol mappings\n"));
n_pm = udf_rw32(ump->logical_vol->n_pm); /* num partmaps */
mt_l = udf_rw32(ump->logical_vol->mt_l); /* partmaps data length */
pmap_pos = ump->logical_vol->maps;
if (n_pm > UDF_PMAPS) {
@ -2812,7 +2804,6 @@ int
udf_writeout_vat(struct udf_mount *ump)
{
struct udf_node *vat_node = ump->vat_node;
uint32_t vat_length;
int error;
KASSERT(vat_node);
@ -2823,7 +2814,6 @@ udf_writeout_vat(struct udf_mount *ump)
udf_update_vat_descriptor(ump);
/* write out the VAT contents ; TODO intelligent writing */
vat_length = ump->vat_table_len;
error = vn_rdwr(UIO_WRITE, vat_node->vnode,
ump->vat_table, ump->vat_table_len, 0,
UIO_SYSSPACE, 0, FSCRED, NULL, NULL);
@ -3028,7 +3018,7 @@ udf_search_vat(struct udf_mount *ump, union udf_pmap *mapping)
{
struct udf_node *vat_node;
struct long_ad icb_loc;
uint32_t early_vat_loc, late_vat_loc, vat_loc;
uint32_t early_vat_loc, vat_loc;
int error;
/* mapping info not needed */
@ -3040,7 +3030,6 @@ udf_search_vat(struct udf_mount *ump, union udf_pmap *mapping)
DPRINTF(VOLUMES, ("1) last possible %d, early_vat_loc %d \n",
vat_loc, early_vat_loc));
early_vat_loc = MAX(early_vat_loc, ump->first_possible_vat_location);
late_vat_loc = vat_loc + 1024;
DPRINTF(VOLUMES, ("2) last possible %d, early_vat_loc %d \n",
vat_loc, early_vat_loc));
@ -3207,7 +3196,7 @@ udf_read_vds_tables(struct udf_mount *ump)
{
union udf_pmap *mapping;
/* struct udf_args *args = &ump->mount_args; */
uint32_t n_pm, mt_l;
uint32_t n_pm;
uint32_t log_part;
uint8_t *pmap_pos;
int pmap_size;
@ -3215,7 +3204,6 @@ udf_read_vds_tables(struct udf_mount *ump)
/* Iterate (again) over the part mappings for locations */
n_pm = udf_rw32(ump->logical_vol->n_pm); /* num partmaps */
mt_l = udf_rw32(ump->logical_vol->mt_l); /* partmaps data length */
pmap_pos = ump->logical_vol->maps;
for (log_part = 0; log_part < n_pm; log_part++) {
@ -4207,7 +4195,6 @@ unix_to_udf_name(char *result, uint8_t *result_len, char const *name, int name_l
outchp = raw_name;
bits = 8;
for (cnt = name_len, udf_chars = 0; cnt;) {
/*###3490 [cc] warning: passing argument 2 of 'wget_utf8' from incompatible pointer type%%%*/
*outchp = wget_utf8(&inchp, &cnt);
if (*outchp > 0xff)
bits=16;
@ -4780,7 +4767,7 @@ udf_dir_detach(struct udf_mount *ump, struct udf_node *dir_node,
struct extfile_entry *efe = dir_node->efe;
struct fileid_desc *fid;
struct dirent *dirent;
uint64_t file_size, diroffset;
uint64_t diroffset;
uint32_t lb_size, fidsize;
int found, error;
char const *name = cnp->cn_nameptr;
@ -4797,11 +4784,8 @@ udf_dir_detach(struct udf_mount *ump, struct udf_node *dir_node,
dirh = dir_node->dir_hash;
/* get directory filesize */
if (fe) {
file_size = udf_rw64(fe->inf_len);
} else {
if (!fe) {
assert(efe);
file_size = udf_rw64(efe->inf_len);
}
/* allocate temporary space for fid */
@ -4928,7 +4912,7 @@ udf_dir_update_rootentry(struct udf_mount *ump, struct udf_node *dir_node,
struct extfile_entry *efe;
struct fileid_desc *fid;
struct dirent *dirent;
uint64_t file_size, diroffset;
uint64_t diroffset;
uint64_t new_parent_unique_id;
uint32_t lb_size, fidsize;
int found, error;
@ -4958,11 +4942,8 @@ udf_dir_update_rootentry(struct udf_mount *ump, struct udf_node *dir_node,
/* get directory filesize */
fe = dir_node->fe;
efe = dir_node->efe;
if (fe) {
file_size = udf_rw64(fe->inf_len);
} else {
if (!fe) {
assert(efe);
file_size = udf_rw64(efe->inf_len);
}
/* allocate temporary space for fid */
@ -5307,7 +5288,6 @@ udf_get_node(struct udf_mount *ump, struct long_ad *node_icb_loc,
struct long_ad icb_loc, last_fe_icb_loc;
uint64_t file_size;
uint32_t lb_size, sector, dummy;
uint8_t *file_data;
int udf_file_type, dscr_type, strat, strat4096, needs_indirect;
int slot, eof, error;
@ -5390,7 +5370,6 @@ udf_get_node(struct udf_mount *ump, struct long_ad *node_icb_loc,
strat4096 = 0;
udf_file_type = UDF_ICB_FILETYPE_UNKNOWN;
file_size = 0;
file_data = NULL;
lb_size = udf_rw32(ump->logical_vol->lb_size);
DPRINTF(NODE, ("\tstart reading descriptors\n"));
@ -5432,7 +5411,6 @@ udf_get_node(struct udf_mount *ump, struct long_ad *node_icb_loc,
last_fe_icb_loc = icb_loc;
/* record and process/update (ext)fentry */
file_data = NULL;
if (dscr_type == TAGID_FENTRY) {
if (udf_node->fe)
udf_free_logvol_dscr(ump, &last_fe_icb_loc,
@ -5441,7 +5419,6 @@ udf_get_node(struct udf_mount *ump, struct long_ad *node_icb_loc,
strat = udf_rw16(udf_node->fe->icbtag.strat_type);
udf_file_type = udf_node->fe->icbtag.file_type;
file_size = udf_rw64(udf_node->fe->inf_len);
file_data = udf_node->fe->data;
} else {
if (udf_node->efe)
udf_free_logvol_dscr(ump, &last_fe_icb_loc,
@ -5450,7 +5427,6 @@ udf_get_node(struct udf_mount *ump, struct long_ad *node_icb_loc,
strat = udf_rw16(udf_node->efe->icbtag.strat_type);
udf_file_type = udf_node->efe->icbtag.file_type;
file_size = udf_rw64(udf_node->efe->inf_len);
file_data = udf_node->efe->data;
}
/* check recording strategy (structure) */
@ -6013,12 +5989,9 @@ void
udf_delete_node(struct udf_node *udf_node)
{
void *dscr;
struct udf_mount *ump;
struct long_ad *loc;
int extnr, lvint, dummy;
ump = udf_node->ump;
/* paranoia check on integrity; should be open!; we could panic */
lvint = udf_rw32(udf_node->ump->logvol_integrity->integrity_type);
if (lvint == UDF_INTEGRITY_CLOSED)

View File

@ -1,4 +1,4 @@
/* $NetBSD: udf_vnops.c,v 1.86 2013/10/04 08:35:08 hannken Exp $ */
/* $NetBSD: udf_vnops.c,v 1.87 2013/10/18 19:56:55 christos Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
__KERNEL_RCSID(0, "$NetBSD: udf_vnops.c,v 1.86 2013/10/04 08:35:08 hannken Exp $");
__KERNEL_RCSID(0, "$NetBSD: udf_vnops.c,v 1.87 2013/10/18 19:56:55 christos Exp $");
#endif /* not lint */
@ -464,8 +464,7 @@ udf_vfsstrategy(void *v)
struct vnode *vp = ap->a_vp;
struct buf *bp = ap->a_bp;
struct udf_node *udf_node = VTOI(vp);
uint32_t lb_size, from, sectors;
int error;
uint32_t lb_size, sectors;
DPRINTF(STRATEGY, ("udf_strategy called\n"));
@ -479,9 +478,6 @@ udf_vfsstrategy(void *v)
/* get sector size */
lb_size = udf_rw32(udf_node->ump->logical_vol->lb_size);
/* calculate sector to start from */
from = bp->b_blkno;
/* calculate length to fetch/store in sectors */
sectors = bp->b_bcount / lb_size;
assert(bp->b_bcount > 0);
@ -493,18 +489,17 @@ udf_vfsstrategy(void *v)
assert(sectors * lb_size == bp->b_bcount);
/* issue buffer */
error = 0;
if (bp->b_flags & B_READ) {
DPRINTF(STRATEGY, ("\tread vp %p buf %p (blk no %"PRIu64")"
", sector %d for %d sectors\n",
vp, bp, bp->b_blkno, from, sectors));
", for %d sectors\n",
vp, bp, bp->b_blkno, sectors));
/* read buffer from the udf_node, translate vtop on the way*/
udf_read_filebuf(udf_node, bp);
} else {
DPRINTF(STRATEGY, ("\twrite vp %p buf %p (blk no %"PRIu64")"
", sector %d for %d sectors\n",
vp, bp, bp->b_blkno, from, sectors));
", for %d sectors\n",
vp, bp, bp->b_blkno, sectors));
/* write buffer to the udf_node, translate vtop on the way*/
udf_write_filebuf(udf_node, bp);