summaryrefslogtreecommitdiffstats
path: root/fs/hfs
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-02-15 02:15:32 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-02-15 02:15:32 +0000
commit86464aed71025541805e7b1515541aee89879e33 (patch)
treee01a457a4912a8553bc65524aa3125d51f29f810 /fs/hfs
parent88f99939ecc6a95a79614574cb7d95ffccfc3466 (diff)
Merge with Linux 2.2.1.
Diffstat (limited to 'fs/hfs')
-rw-r--r--fs/hfs/ChangeLog21
-rw-r--r--fs/hfs/bdelete.c9
-rw-r--r--fs/hfs/dir.c3
-rw-r--r--fs/hfs/extent.c9
-rw-r--r--fs/hfs/hfs.h2
-rw-r--r--fs/hfs/inode.c1
-rw-r--r--fs/hfs/mdb.c2
-rw-r--r--fs/hfs/sysdep.c19
8 files changed, 53 insertions, 13 deletions
diff --git a/fs/hfs/ChangeLog b/fs/hfs/ChangeLog
index 0bd14f24c..c0b077f47 100644
--- a/fs/hfs/ChangeLog
+++ b/fs/hfs/ChangeLog
@@ -1,3 +1,24 @@
+1998-12-20 a sun <asun@hecate.darksunrising.blah>
+
+ * bdelete.c (del_root): assign bthLNode and bthFNode only if the
+ root node becomes a leaf node. Disk First Aid no longer
+ complains. Norton Utilities, of course, has decided that it
+ doesn't like the root node number. bleah. i think that it might be
+ due to Norton Utilities not expecting the root node to have moved.
+
+1998-12-16 a sun <asun@hecate.darksunrising.blah>
+
+ * sysdep.c (hfs_revalidate_dentry): fix inode dates when there's a
+ timezone change.
+
+1998-12-15 root <root@hecate.darksunrising.blah>
+
+ * extent.c (new_extent): expand block size variables to handle
+ u32.
+
+ * mdb.c (hfs_mdb_get): AlBlkSiz shouldn't be capped at 65535. we
+ should be able to handle much larger volumes now.
+
1998-11-21 a sun <asun@hecate.darksunrising.blah>
* hfs_sysdep.h, hfs_fs.h: added hfs_from_utc/to_utc to deal with
diff --git a/fs/hfs/bdelete.c b/fs/hfs/bdelete.c
index 0e47c2737..c968c74b7 100644
--- a/fs/hfs/bdelete.c
+++ b/fs/hfs/bdelete.c
@@ -135,11 +135,16 @@ static int del_root(struct hfs_bnode_ref *root)
tree->bthRoot = child.bn->node;
tree->root = child.bn;
+
+ /* re-assign bthFNode and bthLNode if the new root is
+ a leaf node. */
+ if (child.bn->ndType == ndLeafNode) {
+ tree->bthFNode = node;
+ tree->bthLNode = node;
+ }
hfs_bnode_relse(&child);
tree->bthRoot = node;
- tree->bthFNode = node;
- tree->bthLNode = node;
--tree->bthDepth;
tree->dirt = 1;
if (!tree->bthDepth) {
diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c
index 4ef71500d..f8d89227d 100644
--- a/fs/hfs/dir.c
+++ b/fs/hfs/dir.c
@@ -337,9 +337,6 @@ int hfs_rmdir(struct inode * parent, struct dentry *dentry)
struct hfs_cat_key key;
int error;
- if (parent == inode) /* can't delete . */
- return -EPERM;
-
if (build_key(&key, parent, dentry->d_name.name,
dentry->d_name.len))
return -EPERM;
diff --git a/fs/hfs/extent.c b/fs/hfs/extent.c
index 1fc749f34..3c92e7def 100644
--- a/fs/hfs/extent.c
+++ b/fs/hfs/extent.c
@@ -354,7 +354,7 @@ static void delete_extent(struct hfs_fork *fork, struct hfs_extent *ext)
* hfs_u16 ablock: the number of allocation blocks in 'fork'.
* hfs_u16 start: first allocation block to add to 'fork'.
* hfs_u16 len: the number of allocation blocks to add to 'fork'.
- * hfs_u16 ablksz: number of sectors in an allocation block.
+ * hfs_u32 ablksz: number of sectors in an allocation block.
* Output Variable(s):
* NONE
* Returns:
@@ -471,7 +471,7 @@ static void shrink_fork(struct hfs_fork *fork, int ablocks)
struct hfs_mdb *mdb = fork->entry->mdb;
struct hfs_extent *ext;
int i, error, next, count;
- hfs_u16 ablksz = mdb->alloc_blksz;
+ hfs_u32 ablksz = mdb->alloc_blksz;
next = (fork->psize / ablksz) - 1;
ext = find_ext(fork, next);
@@ -530,7 +530,7 @@ static void grow_fork(struct hfs_fork *fork, int ablocks)
struct hfs_extent *ext;
int i, start, err;
hfs_u16 need, len=0;
- hfs_u16 ablksz = mdb->alloc_blksz;
+ hfs_u32 ablksz = mdb->alloc_blksz;
hfs_u32 blocks, clumpablks;
blocks = fork->psize;
@@ -681,8 +681,7 @@ int hfs_ext_compare(const struct hfs_ext_key *key1,
void hfs_extent_adj(struct hfs_fork *fork)
{
if (fork) {
- hfs_u32 blks, ablocks;
- hfs_u16 ablksz;
+ hfs_u32 blks, ablocks, ablksz;
if (fork->lsize > HFS_FORK_MAX) {
fork->lsize = HFS_FORK_MAX;
diff --git a/fs/hfs/hfs.h b/fs/hfs/hfs.h
index 06138ab2d..824e02be5 100644
--- a/fs/hfs/hfs.h
+++ b/fs/hfs/hfs.h
@@ -252,7 +252,7 @@ struct hfs_mdb {
hfs_u16 free_ablocks; /* The number of unused
allocation blocks
in the filesystem */
- hfs_u16 alloc_blksz; /* The number of
+ hfs_u32 alloc_blksz; /* The number of
512-byte blocks per
"allocation block" */
hfs_u16 attrib; /* Attribute word */
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
index 4d997baa8..d960b3da0 100644
--- a/fs/hfs/inode.c
+++ b/fs/hfs/inode.c
@@ -260,6 +260,7 @@ struct inode *hfs_iget(struct hfs_cat_entry *entry, ino_t type,
memset(HFS_I(inode), 0, sizeof(struct hfs_inode_info));
HFS_I(inode)->magic = HFS_INO_MAGIC;
HFS_I(inode)->entry = entry;
+ HFS_I(inode)->tz_secondswest = hfs_to_utc(0);
hsb->s_ifill(inode, type);
if (!hsb->s_afpd && (entry->type == HFS_CDR_FIL) &&
diff --git a/fs/hfs/mdb.c b/fs/hfs/mdb.c
index c72673731..61070b1d7 100644
--- a/fs/hfs/mdb.c
+++ b/fs/hfs/mdb.c
@@ -118,7 +118,7 @@ struct hfs_mdb *hfs_mdb_get(hfs_sysmdb sys_mdb, int readonly,
mdb->buf = buf;
bs = hfs_get_hl(raw->drAlBlkSiz);
- if (!bs || bs > HFS_USHRT_MAX || (bs & (HFS_SECTOR_SIZE-1))) {
+ if (!bs || (bs & (HFS_SECTOR_SIZE-1))) {
hfs_warn("hfs_fs: bad allocation block size %d != 512\n", bs);
hfs_buffer_put(buf);
HFS_DELETE(mdb);
diff --git a/fs/hfs/sysdep.c b/fs/hfs/sysdep.c
index c1fb812de..0524808f7 100644
--- a/fs/hfs/sysdep.c
+++ b/fs/hfs/sysdep.c
@@ -18,12 +18,13 @@
#include <linux/hfs_fs_i.h>
#include <linux/hfs_fs.h>
+static int hfs_revalidate_dentry(struct dentry *);
static int hfs_hash_dentry(struct dentry *, struct qstr *);
static int hfs_compare_dentry(struct dentry *, struct qstr *, struct qstr *);
static void hfs_dentry_iput(struct dentry *, struct inode *);
struct dentry_operations hfs_dentry_operations =
{
- NULL, /* d_validate(struct dentry *) */
+ hfs_revalidate_dentry, /* d_revalidate(struct dentry *) */
hfs_hash_dentry, /* d_hash */
hfs_compare_dentry, /* d_compare */
NULL, /* d_delete(struct dentry *) */
@@ -87,3 +88,19 @@ static void hfs_dentry_iput(struct dentry *dentry, struct inode *inode)
entry->sys_entry[HFS_ITYPE_TO_INT(HFS_ITYPE(inode->i_ino))] = NULL;
iput(inode);
}
+
+static int hfs_revalidate_dentry(struct dentry *dentry)
+{
+ struct inode *inode = dentry->d_inode;
+ int diff;
+
+ /* fix up inode on a timezone change */
+ if (inode &&
+ (diff = (hfs_to_utc(0) - HFS_I(inode)->tz_secondswest))) {
+ inode->i_ctime += diff;
+ inode->i_atime += diff;
+ inode->i_mtime += diff;
+ HFS_I(inode)->tz_secondswest += diff;
+ }
+ return 1;
+}