/* * "Blessing" an HFS+ filesystem writes metadata to the superblock informing * the platform firmware which file to boot from
*/ staticint hfsplus_ioctl_bless(struct file *file, int __user *user_flags)
{ struct dentry *dentry = file->f_path.dentry; struct inode *inode = d_inode(dentry); struct hfsplus_sb_info *sbi = HFSPLUS_SB(inode->i_sb); struct hfsplus_vh *vh = sbi->s_vhdr; struct hfsplus_vh *bvh = sbi->s_backup_vhdr;
u32 cnid = (unsignedlong)dentry->d_fsdata;
if (!capable(CAP_SYS_ADMIN)) return -EPERM;
mutex_lock(&sbi->vh_mutex);
/* Directory containing the bootable system */
vh->finder_info[0] = bvh->finder_info[0] =
cpu_to_be32(d_parent_ino(dentry));
/* * Bootloader. Just using the inode here breaks in the case of * hard links - the firmware wants the ID of the hard link file, * but the inode points at the indirect inode
*/
vh->finder_info[1] = bvh->finder_info[1] = cpu_to_be32(cnid);
/* Per spec, the OS X system folder - same as finder_info[0] here */
vh->finder_info[5] = bvh->finder_info[5] =
cpu_to_be32(d_parent_ino(dentry));
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.