Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91867
b: refs/heads/master
c: 0d07a15
h: refs/heads/master
i:
  91865: a0eea92
  91863: 3c409cb
v: v3
  • Loading branch information
Linus Torvalds committed Apr 22, 2008
1 parent 2ba8619 commit 7a889c8
Show file tree
Hide file tree
Showing 28 changed files with 1,175 additions and 1,563 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: efa0f16b0d0e87ffbef311785fed0815b0240f46
refs/heads/master: 0d07a15bdb5a4ea6271b6e874d307c48151ef546
2 changes: 1 addition & 1 deletion trunk/drivers/block/brd.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static struct page *brd_insert_page(struct brd_device *brd, sector_t sector)
#ifndef CONFIG_BLK_DEV_XIP
gfp_flags |= __GFP_HIGHMEM;
#endif
page = alloc_page(GFP_NOIO | __GFP_HIGHMEM | __GFP_ZERO);
page = alloc_page(gfp_flags);
if (!page)
return NULL;

Expand Down
1 change: 1 addition & 0 deletions trunk/fs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ config ZISOFS

config UDF_FS
tristate "UDF file system support"
select CRC_ITU_T
help
This is the new file system used on some CD-ROMs and DVDs. Say Y if
you intend to mount DVD discs or CDRW's written in packet mode, or
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/udf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ obj-$(CONFIG_UDF_FS) += udf.o

udf-objs := balloc.o dir.o file.o ialloc.o inode.o lowlevel.o namei.o \
partition.o super.o truncate.o symlink.o fsync.o \
crc.o directory.o misc.o udftime.o unicode.o
directory.o misc.o udftime.o unicode.o
13 changes: 4 additions & 9 deletions trunk/fs/udf/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ static bool udf_add_free_space(struct udf_sb_info *sbi,
return false;

lvid = (struct logicalVolIntegrityDesc *)sbi->s_lvid_bh->b_data;
lvid->freeSpaceTable[partition] = cpu_to_le32(le32_to_cpu(
lvid->freeSpaceTable[partition]) + cnt);
le32_add_cpu(&lvid->freeSpaceTable[partition], cnt);
return true;
}

Expand Down Expand Up @@ -589,10 +588,8 @@ static void udf_table_free_blocks(struct super_block *sb,
sptr = oepos.bh->b_data + epos.offset;
aed = (struct allocExtDesc *)
oepos.bh->b_data;
aed->lengthAllocDescs =
cpu_to_le32(le32_to_cpu(
aed->lengthAllocDescs) +
adsize);
le32_add_cpu(&aed->lengthAllocDescs,
adsize);
} else {
sptr = iinfo->i_ext.i_data +
epos.offset;
Expand Down Expand Up @@ -645,9 +642,7 @@ static void udf_table_free_blocks(struct super_block *sb,
mark_inode_dirty(table);
} else {
aed = (struct allocExtDesc *)epos.bh->b_data;
aed->lengthAllocDescs =
cpu_to_le32(le32_to_cpu(
aed->lengthAllocDescs) + adsize);
le32_add_cpu(&aed->lengthAllocDescs, adsize);
udf_update_tag(epos.bh->b_data, epos.offset);
mark_buffer_dirty(epos.bh);
}
Expand Down
172 changes: 0 additions & 172 deletions trunk/fs/udf/crc.c

This file was deleted.

83 changes: 27 additions & 56 deletions trunk/fs/udf/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
static int do_udf_readdir(struct inode *dir, struct file *filp,
filldir_t filldir, void *dirent)
{
struct udf_fileident_bh fibh;
struct udf_fileident_bh fibh = { .sbh = NULL, .ebh = NULL};
struct fileIdentDesc *fi = NULL;
struct fileIdentDesc cfi;
int block, iblock;
loff_t nf_pos = (filp->f_pos - 1) << 2;
int flen;
char fname[UDF_NAME_LEN];
char *fname = NULL;
char *nameptr;
uint16_t liu;
uint8_t lfi;
Expand All @@ -54,23 +54,32 @@ static int do_udf_readdir(struct inode *dir, struct file *filp,
kernel_lb_addr eloc;
uint32_t elen;
sector_t offset;
int i, num;
int i, num, ret = 0;
unsigned int dt_type;
struct extent_position epos = { NULL, 0, {0, 0} };
struct udf_inode_info *iinfo;

if (nf_pos >= size)
return 0;
goto out;

fname = kmalloc(UDF_NAME_LEN, GFP_NOFS);
if (!fname) {
ret = -ENOMEM;
goto out;
}

if (nf_pos == 0)
nf_pos = udf_ext0_offset(dir);

fibh.soffset = fibh.eoffset = nf_pos & (dir->i_sb->s_blocksize - 1);
iinfo = UDF_I(dir);
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
fibh.sbh = fibh.ebh = NULL;
} else if (inode_bmap(dir, nf_pos >> dir->i_sb->s_blocksize_bits,
&epos, &eloc, &elen, &offset) == (EXT_RECORDED_ALLOCATED >> 30)) {
if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) {
if (inode_bmap(dir, nf_pos >> dir->i_sb->s_blocksize_bits,
&epos, &eloc, &elen, &offset)
!= (EXT_RECORDED_ALLOCATED >> 30)) {
ret = -ENOENT;
goto out;
}
block = udf_get_lb_pblock(dir->i_sb, eloc, offset);
if ((++offset << dir->i_sb->s_blocksize_bits) < elen) {
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
Expand All @@ -83,8 +92,8 @@ static int do_udf_readdir(struct inode *dir, struct file *filp,
}

if (!(fibh.sbh = fibh.ebh = udf_tread(dir->i_sb, block))) {
brelse(epos.bh);
return -EIO;
ret = -EIO;
goto out;
}

if (!(offset & ((16 >> (dir->i_sb->s_blocksize_bits - 9)) - 1))) {
Expand All @@ -105,23 +114,15 @@ static int do_udf_readdir(struct inode *dir, struct file *filp,
brelse(bha[i]);
}
}
} else {
brelse(epos.bh);
return -ENOENT;
}

while (nf_pos < size) {
filp->f_pos = (nf_pos >> 2) + 1;

fi = udf_fileident_read(dir, &nf_pos, &fibh, &cfi, &epos, &eloc,
&elen, &offset);
if (!fi) {
if (fibh.sbh != fibh.ebh)
brelse(fibh.ebh);
brelse(fibh.sbh);
brelse(epos.bh);
return 0;
}
if (!fi)
goto out;

liu = le16_to_cpu(cfi.lengthOfImpUse);
lfi = cfi.lengthFileIdent;
Expand Down Expand Up @@ -167,53 +168,23 @@ static int do_udf_readdir(struct inode *dir, struct file *filp,
dt_type = DT_UNKNOWN;
}

if (flen) {
if (filldir(dirent, fname, flen, filp->f_pos, iblock, dt_type) < 0) {
if (fibh.sbh != fibh.ebh)
brelse(fibh.ebh);
brelse(fibh.sbh);
brelse(epos.bh);
return 0;
}
}
if (flen && filldir(dirent, fname, flen, filp->f_pos,
iblock, dt_type) < 0)
goto out;
} /* end while */

filp->f_pos = (nf_pos >> 2) + 1;

out:
if (fibh.sbh != fibh.ebh)
brelse(fibh.ebh);
brelse(fibh.sbh);
brelse(epos.bh);
kfree(fname);

return 0;
return ret;
}

/*
* udf_readdir
*
* PURPOSE
* Read a directory entry.
*
* DESCRIPTION
* Optional - sys_getdents() will return -ENOTDIR if this routine is not
* available.
*
* Refer to sys_getdents() in fs/readdir.c
* sys_getdents() -> .
*
* PRE-CONDITIONS
* filp Pointer to directory file.
* buf Pointer to directory entry buffer.
* filldir Pointer to filldir function.
*
* POST-CONDITIONS
* <return> >=0 on success.
*
* HISTORY
* July 1, 1997 - Andrew E. Mileski
* Written, tested, and released.
*/

static int udf_readdir(struct file *filp, void *dirent, filldir_t filldir)
{
struct inode *dir = filp->f_path.dentry->d_inode;
Expand Down
Loading

0 comments on commit 7a889c8

Please sign in to comment.