if (inode && generation && (inode->i_generation != generation)) {
iput(inode);
inode = NULL;
} if (inode == NULL && MSDOS_SB(sb)->options.nfs == FAT_NFS_NOSTALE_RO) { struct buffer_head *bh = NULL; struct msdos_dir_entry *de ;
sector_t blocknr; int offset;
fat_get_blknr_offset(MSDOS_SB(sb), i_pos, &blocknr, &offset);
bh = sb_bread(sb, blocknr); if (!bh) {
fat_msg(sb, KERN_ERR, "unable to read block(%llu) for building NFS inode",
(llu)blocknr); return inode;
}
de = (struct msdos_dir_entry *)bh->b_data; /* If a file is deleted on server and client is not updated * yet, we must not build the inode upon a lookup call.
*/ if (IS_FREE(de[offset].name))
inode = NULL; else
inode = fat_build_inode(sb, &de[offset], i_pos);
brelse(bh);
}
staticint
fat_encode_fh_nostale(struct inode *inode, __u32 *fh, int *lenp, struct inode *parent)
{ int len = *lenp; struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); struct fat_fid *fid = (struct fat_fid *) fh;
loff_t i_pos; int type = FILEID_FAT_WITHOUT_PARENT;
if (parent) { if (len < FAT_FID_SIZE_WITH_PARENT) {
*lenp = FAT_FID_SIZE_WITH_PARENT; return FILEID_INVALID;
}
} else { if (len < FAT_FID_SIZE_WITHOUT_PARENT) {
*lenp = FAT_FID_SIZE_WITHOUT_PARENT; return FILEID_INVALID;
}
}
i_pos = fat_i_pos_read(sbi, inode);
*lenp = FAT_FID_SIZE_WITHOUT_PARENT;
fid->i_gen = inode->i_generation;
fid->i_pos_low = i_pos & 0xFFFFFFFF;
fid->i_pos_hi = (i_pos >> 32) & 0xFFFF; if (parent) {
i_pos = fat_i_pos_read(sbi, parent);
fid->parent_i_pos_hi = (i_pos >> 32) & 0xFFFF;
fid->parent_i_pos_low = i_pos & 0xFFFFFFFF;
fid->parent_i_gen = parent->i_generation;
type = FILEID_FAT_WITH_PARENT;
*lenp = FAT_FID_SIZE_WITH_PARENT;
} else { /* * We need to initialize this field because the fh is actually * 12 bytes long
*/
fid->parent_i_pos_hi = 0;
}
return type;
}
/* * Map a NFS file handle to a corresponding dentry. * The dentry may or may not be connected to the filesystem root.
*/ staticstruct dentry *fat_fh_to_dentry(struct super_block *sb, struct fid *fid, int fh_len, int fh_type)
{ return generic_fh_to_dentry(sb, fid, fh_len, fh_type,
fat_nfs_get_inode);
}
/* * Find the parent for a file specified by NFS handle. * This requires that the handle contain the i_ino of the parent.
*/ staticstruct dentry *fat_fh_to_parent(struct super_block *sb, struct fid *fid, int fh_len, int fh_type)
{ return generic_fh_to_parent(sb, fid, fh_len, fh_type,
fat_nfs_get_inode);
}
¤ 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.0.1Bemerkung:
(vorverarbeitet)
¤
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.