// SPDX-License-Identifier: GPL-2.0 /* * linux/fs/isofs/namei.c * * (C) 1992 Eric Youngdale Modified for ISO 9660 filesystem. * * (C) 1991 Linus Torvalds - minix filesystem
*/
#include <linux/gfp.h> #include"isofs.h"
/* * ok, we cannot use strncmp, as the name is not in our data space. * Thus we'll have to use isofs_match. No big problem. Match also makes * some sanity tests.
*/ staticint
isofs_cmp(struct dentry *dentry, constchar *compare, int dlen)
{ struct qstr qstr;
qstr.name = compare;
qstr.len = dlen; if (likely(!dentry->d_op)) return dentry->d_name.len != dlen || memcmp(dentry->d_name.name, compare, dlen); return dentry->d_op->d_compare(NULL, dentry->d_name.len, dentry->d_name.name, &qstr);
}
/* * isofs_find_entry() * * finds an entry in the specified directory with the wanted name. It * returns the inode number of the found entry, or 0 on error.
*/ staticunsignedlong
isofs_find_entry(struct inode *dir, struct dentry *dentry, unsignedlong *block_rv, unsignedlong *offset_rv, char *tmpname, struct iso_directory_record *tmpde)
{ unsignedlong bufsize = ISOFS_BUFFER_SIZE(dir); unsignedchar bufbits = ISOFS_BUFFER_BITS(dir); unsignedlong block, f_pos, offset, block_saved, offset_saved; struct buffer_head *bh = NULL; struct isofs_sb_info *sbi = ISOFS_SB(dir->i_sb);
if (!ISOFS_I(dir)->i_first_extent) return 0;
f_pos = 0;
offset = 0;
block = 0;
while (f_pos < dir->i_size) { struct iso_directory_record *de; int de_len, match, i, dlen; char *dpnt;
if (!bh) {
bh = isofs_bread(dir, block); if (!bh) return 0;
}
de = (struct iso_directory_record *) (bh->b_data + offset);
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.