struct obdo *oa;
int err;
+ ENTRY;
oa = obdo_alloc();
if ( !oa ) {
EXIT;
}
#define ODEBUG(obdo) { \
- printk("]]%s line %d[[ id %Ld, atm %Ld, mtm %Ld, ctm %Ld, size %Ld, blocks %Ld\n",\
+ printk("]]%s line %d[[ id %ld, atm %ld, mtm %ld, ctm %ld, size %ld, blocks %ld\n",\
__FUNCTION__ , __LINE__, \
- obdo->o_id, obdo->o_atime, obdo->o_mtime,\
- obdo->o_ctime, obdo->o_size, obdo->o_blocks);\
+ (long)obdo->o_id, (long)obdo->o_atime,\
+ (long)obdo->o_mtime, (long)obdo->o_ctime,\
+ (long)obdo->o_size, (long)obdo->o_blocks);\
printk("]]%s line %d[[ mode %o, uid %d, gid %d, flg 0x%0x, obdflg 0x%0x, nlnk %d, valid 0x%0x\n", \
__FUNCTION__ , __LINE__, \
obdo->o_mode, obdo->o_uid, obdo->o_gid,\
CDEBUG(D_INODE, "inode %ld (%p)\n", inode->i_ino, inode);
obdo_to_inode(inode, oa);
+
if (obdo_has_inline(oa)) {
CDEBUG(D_INODE, "obdo has inline data\n");
memcpy(oinfo->oi_inline, oa->o_inline, OBD_INLINESZ);
*/
if (dir->i_size == 0)
{
- EXIT;
+ OIDEBUG(dir);
*err = -ENOENT;
+ EXIT;
return NULL;
}
page = obdfs_getpage(dir, 0, 0, LOCKED);
/* SYNCHRONOUS I/O for an inode */
static int obdfs_brw(int rw, struct inode *inode, struct page *page, int create)
{
- struct obdo *obdo;
+ struct obdo *oa;
obd_size count = PAGE_SIZE;
int err;
ENTRY;
- obdo = obdo_fromid(IID(inode), inode->i_ino, OBD_MD_FLNOTOBD);
- if ( IS_ERR(obdo) ) {
+ oa = obdo_fromid(IID(inode), inode->i_ino, OBD_MD_FLNOTOBD);
+ if ( IS_ERR(oa) ) {
EXIT;
- return PTR_ERR(obdo);
+ return PTR_ERR(oa);
}
+ obdfs_from_inode(oa, inode);
- err = IOPS(inode, brw)(rw, IID(inode), obdo, (char *)page_address(page),
+ err = IOPS(inode, brw)(rw, IID(inode), oa, (char *)page_address(page),
&count, (page->index) >> PAGE_SHIFT, create);
if ( !err )
- obdfs_to_inode(inode, obdo); /* copy o_blocks to i_blocks */
+ obdfs_to_inode(inode, oa); /* copy o_blocks to i_blocks */
- obdo_free(obdo);
+ obdo_free(oa);
EXIT;
return err;
obdo_free(oa);
OIDEBUG(inode);
- if (S_ISREG(inode->i_mode))
+ if (S_ISREG(inode->i_mode)) {
inode->i_op = &obdfs_file_inode_operations;
- else if (S_ISDIR(inode->i_mode))
+ EXIT;
+ } else if (S_ISDIR(inode->i_mode)) {
inode->i_op = &obdfs_dir_inode_operations;
- else if (S_ISLNK(inode->i_mode))
+ EXIT;
+ } else if (S_ISLNK(inode->i_mode)) {
inode->i_op = &obdfs_symlink_inode_operations;
- else
+ EXIT;
+ } else {
init_special_inode(inode, inode->i_mode,
/* XXX need to fill in the ext2 side */
((long *)OBDFS_INFO(inode)->oi_inline)[0]);
+ }
- EXIT;
return;
} /* obdfs_read_inode */