From: Andy P. <at...@us...> - 2002-04-09 15:13:54
|
Update of /cvsroot/linux-vax/kernel-2.4/fs/hfs In directory usw-pr-cvs1:/tmp/cvs-serv27691/hfs Modified Files: catalog.c file.c file_cap.c file_hdr.c inode.c Log Message: sync 2.4.15 commit 11 Index: catalog.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/fs/hfs/catalog.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- catalog.c 25 Feb 2001 23:14:47 -0000 1.1.1.2 +++ catalog.c 9 Apr 2002 13:11:18 -0000 1.2 @@ -100,7 +100,7 @@ static LIST_HEAD(entry_unused); static struct list_head hash_table[C_HASHSIZE]; -spinlock_t entry_lock = SPIN_LOCK_UNLOCKED; +static spinlock_t entry_lock = SPIN_LOCK_UNLOCKED; static struct { int nr_entries; Index: file.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/fs/hfs/file.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- file.c 25 Feb 2001 23:14:47 -0000 1.1.1.2 +++ file.c 9 Apr 2002 13:11:18 -0000 1.2 @@ -32,6 +32,7 @@ /*================ Global variables ================*/ struct file_operations hfs_file_operations = { + llseek: generic_file_llseek, read: hfs_file_read, write: hfs_file_write, mmap: generic_file_mmap, Index: file_cap.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/fs/hfs/file_cap.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- file_cap.c 25 Feb 2001 23:14:47 -0000 1.1.1.2 +++ file_cap.c 9 Apr 2002 13:11:18 -0000 1.2 @@ -26,7 +26,8 @@ #include <linux/hfs_fs.h> /*================ Forward declarations ================*/ - +static loff_t cap_info_llseek(struct file *, loff_t, + int); static hfs_rwret_t cap_info_read(struct file *, char *, hfs_rwarg_t, loff_t *); static hfs_rwret_t cap_info_write(struct file *, const char *, @@ -45,6 +46,7 @@ /*================ Global variables ================*/ struct file_operations hfs_cap_info_operations = { + llseek: cap_info_llseek, read: cap_info_read, write: cap_info_write, fsync: file_fsync, @@ -83,6 +85,29 @@ hfs_put_nl(hfs_m_to_htime(entry->create_date), meta->fi_ctime); hfs_put_nl(hfs_m_to_htime(entry->modify_date), meta->fi_mtime); hfs_put_nl(CURRENT_TIME, meta->fi_utime); +} + +static loff_t cap_info_llseek(struct file *file, loff_t offset, int origin) +{ + long long retval; + + switch (origin) { + case 2: + offset += file->f_dentry->d_inode->i_size; + break; + case 1: + offset += file->f_pos; + } + retval = -EINVAL; + if (offset>=0 && offset<=HFS_FORK_MAX) { + if (offset != file->f_pos) { + file->f_pos = offset; + file->f_reada = 0; + file->f_version = ++event; + } + retval = offset; + } + return retval; } /* Index: file_hdr.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/fs/hfs/file_hdr.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- file_hdr.c 25 Feb 2001 23:14:47 -0000 1.1.1.2 +++ file_hdr.c 9 Apr 2002 13:11:18 -0000 1.2 @@ -39,13 +39,14 @@ #define PRODOSI_AUXTYPE_DIR 0x0200 /*================ Forward declarations ================*/ - +static loff_t hdr_llseek(struct file *, loff_t, int); static hfs_rwret_t hdr_read(struct file *, char *, hfs_rwarg_t, loff_t *); static hfs_rwret_t hdr_write(struct file *, const char *, hfs_rwarg_t, loff_t *); /*================ Global variables ================*/ struct file_operations hfs_hdr_operations = { + llseek: hdr_llseek, read: hdr_read, write: hdr_write, fsync: file_fsync, @@ -340,6 +341,29 @@ entry->backup_date = tmp; hfs_cat_mark_dirty(entry); } +} + +loff_t hdr_llseek(struct file *file, loff_t offset, int origin) +{ + long long retval; + + switch (origin) { + case 2: + offset += file->f_dentry->d_inode->i_size; + break; + case 1: + offset += file->f_pos; + } + retval = -EINVAL; + if (offset>=0 && offset<file->f_dentry->d_inode->i_size) { + if (offset != file->f_pos) { + file->f_pos = offset; + file->f_reada = 0; + file->f_version = ++event; + } + retval = offset; + } + return retval; } /* Index: inode.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/fs/hfs/inode.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- inode.c 25 Feb 2001 23:14:47 -0000 1.1.1.2 +++ inode.c 9 Apr 2002 13:11:18 -0000 1.2 @@ -38,7 +38,7 @@ struct hfs_fork *fk; struct hfs_cat_entry *entry = HFS_I(inode)->entry; - if (!IS_NOEXEC(inode) && (fork == HFS_FK_DATA)) { + if (fork == HFS_FK_DATA) { inode->i_mode = S_IRWXUGO | S_IFREG; } else { inode->i_mode = S_IRUGO | S_IWUGO | S_IFREG; @@ -169,7 +169,9 @@ attr->ia_valid &= ~ATTR_SIZE; } } - inode_setattr(inode, attr); + error = inode_setattr(inode, attr); + if (error) + return error; /* We wouldn't want to mess with the sizes of the other fork */ attr->ia_valid &= ~ATTR_SIZE; |