inode->i_fop = &befs_file_operations; 
inode->i_fop = &generic_ro_fops; 
befs_read_inode(struct inode *inode){	struct buffer_head *bh = NULL;	befs_inode *raw_inode = NULL;	struct super_block *sb = inode->i_sb;	befs_sb_info *befs_sb = BEFS_SB(sb);	befs_inode_info *befs_ino = NULL;	befs_debug(sb, "---> befs_read_inode() " "inode = %lu", inode->i_ino);	befs_ino = BEFS_I(inode);	/* convert from vfs's inode number to befs's inode number */	befs_ino->i_inode_num = blockno2iaddr(sb, inode->i_ino);	befs_debug(sb, "  real inode number [%u, %hu, %hu]",		   befs_ino->i_inode_num.allocation_group,		   befs_ino->i_inode_num.start, befs_ino->i_inode_num.len);	bh = befs_bread(sb, inode->i_ino);	if (!bh) {		befs_error(sb, "unable to read inode block - "			   "inode = %lu", inode->i_ino);		goto unaquire_none;	}	raw_inode = (befs_inode *) bh->b_data;	befs_dump_inode(sb, raw_inode);	if (befs_check_inode(sb, raw_inode, inode->i_ino) != BEFS_OK) {		befs_error(sb, "Bad inode: %lu", inode->i_ino);		goto unaquire_bh;	}	inode->i_mode = (umode_t) fs32_to_cpu(sb, raw_inode->mode);	/*	 * set uid and gid.  But since current BeOS is single user OS, so	 * you can change by "uid" or "gid" options.	 */   	inode->i_uid = befs_sb->mount_opts.use_uid ?	    befs_sb->mount_opts.uid : (uid_t) fs32_to_cpu(sb, raw_inode->uid);	inode->i_gid = befs_sb->mount_opts.use_gid ?	    befs_sb->mount_opts.gid : (gid_t) fs32_to_cpu(sb, raw_inode->gid);	inode->i_nlink = 1;	/*	 * BEFS's time is 64 bits, but current VFS is 32 bits...	 * BEFS don't have access time. Nor inode change time. VFS	 * doesn't have creation time.	 * Also, the lower 16 bits of the last_modified_time and 	 * create_time are just a counter to help ensure uniqueness	 * for indexing purposes. (PFD, page 54)	 */	inode->i_mtime.tv_sec =	    fs64_to_cpu(sb, raw_inode->last_modified_time) >> 16;	inode->i_mtime.tv_nsec = 0;   /* lower 16 bits are not a time */		inode->i_ctime = inode->i_mtime;	inode->i_atime = inode->i_mtime;	inode->i_blksize = befs_sb->block_size;	befs_ino->i_inode_num = fsrun_to_cpu(sb, raw_inode->inode_num);	befs_ino->i_parent = fsrun_to_cpu(sb, raw_inode->parent);	befs_ino->i_attribute = fsrun_to_cpu(sb, raw_inode->attributes);	befs_ino->i_flags = fs32_to_cpu(sb, raw_inode->flags);	if (S_ISLNK(inode->i_mode) && !(befs_ino->i_flags & BEFS_LONG_SYMLINK)){		inode->i_size = 0;		inode->i_blocks = befs_sb->block_size / VFS_BLOCK_SIZE;		strncpy(befs_ino->i_data.symlink, raw_inode->data.symlink,			BEFS_SYMLINK_LEN);	} else {		int num_blks;		befs_ino->i_data.ds =		    fsds_to_cpu(sb, raw_inode->data.datastream);		num_blks = befs_count_blocks(sb, &befs_ino->i_data.ds);		inode->i_blocks =		    num_blks * (befs_sb->block_size / VFS_BLOCK_SIZE);		inode->i_size = befs_ino->i_data.ds.size;	}	inode->i_mapping->a_ops = &befs_aops;	if (S_ISREG(inode->i_mode)) {		inode->i_fop = &befs_file_operations;	} else if (S_ISDIR(inode->i_mode)) {		inode->i_op = &befs_dir_inode_operations;		inode->i_fop = &befs_dir_operations;	} else if (S_ISLNK(inode->i_mode)) {		inode->i_op = &befs_symlink_inode_operations;	} else {		befs_error(sb, "Inode %lu is not a regular file, "			   "directory or symlink. THAT IS WRONG! BeFS has no "			   "on disk special files", inode->i_ino);		goto unaquire_bh;	}	brelse(bh);	befs_debug(sb, "<--- befs_read_inode()");	return;      unaquire_bh:	brelse(bh);      unaquire_none:	make_bad_inode(inode);	befs_debug(sb, "<--- befs_read_inode() - Bad inode");	return;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/2cf06916217b5dcb2cc52a495e1f130cc8434ef5/linuxvfs.c/buggy/fs/befs/linuxvfs.c