Whamcloud - gitweb
include/obd_support.h: removed printk() of long long values (sometimes does
authoradilger <adilger>
Tue, 18 Jan 2000 18:34:06 +0000 (18:34 +0000)
committeradilger <adilger>
Tue, 18 Jan 2000 18:34:06 +0000 (18:34 +0000)
  not print properly)
obdfs/rw.c: added obdo_from_inode() call in obdfs_brw(), as inode was not
  properly being copied into obdo, causing occasional confusion
snap/snap.c: always copy obdo data back to primary from disk obdo
obdsync/*: removed from CVS

lustre/include/linux/obd_class.h
lustre/include/linux/obd_support.h
lustre/include/linux/obdfs.h
lustre/obdfs/namei.c
lustre/obdfs/rw.c
lustre/obdfs/super.c

index 5e29768..34389ce 100644 (file)
@@ -214,6 +214,7 @@ static __inline__ struct obdo *obdo_fromid(struct obd_conn *conn, obd_id id,
        struct obdo *oa;
        int err;
 
+       ENTRY;
        oa = obdo_alloc();
        if ( !oa ) {
                EXIT;
index 9c5df5f..5aba383 100644 (file)
@@ -86,10 +86,11 @@ extern int obd_print_entry;
        }
 
 #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,\
index a369ea0..34f3adb 100644 (file)
@@ -123,6 +123,7 @@ static void inline obdfs_to_inode(struct inode *inode, struct obdo *oa)
 
        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);
index 7a4960f..0b91c0f 100644 (file)
@@ -233,8 +233,9 @@ static struct page *obdfs_add_entry (struct inode * dir,
         */
        if (dir->i_size == 0)
        {
-               EXIT;
+               OIDEBUG(dir);
                *err = -ENOENT;
+               EXIT;
                return NULL;
        }
        page = obdfs_getpage(dir, 0, 0, LOCKED);
index 68d8465..fa6ce07 100644 (file)
@@ -38,24 +38,25 @@ int console_loglevel;
 /* 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;
index e8e94bd..6a30cea 100644 (file)
@@ -306,18 +306,21 @@ void obdfs_read_inode(struct inode *inode)
        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 */