X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Finclude%2Flinux%2Fobd_support.h;h=ba262a368c97c9e1c3508a30649b4e5c3d884755;hp=57163c5723416dcf8657e99a11cb39b7bd1b3d98;hb=906f38ee0bc23a1b153fde2e9bf1063ccb0f40c9;hpb=3146d280a803ae5f9749bab8cde36105de43fcb9 diff --git a/lustre/include/linux/obd_support.h b/lustre/include/linux/obd_support.h index 57163c5..ba262a3 100644 --- a/lustre/include/linux/obd_support.h +++ b/lustre/include/linux/obd_support.h @@ -1,9 +1,10 @@ + #ifndef _OBD_SUPPORT #define _OBD_SUPPORT #include #include -#define SIM_OBD_DEBUG +#define EXT2_OBD_DEBUG #define MIN(a,b) (((a)<(b)) ? (a): (b)) @@ -19,8 +20,8 @@ extern int obd_print_entry; /* debugging masks */ #define D_PSDEV 1 /* debug information from psdev.c */ #define D_INODE 2 -#define D_UNUSED2 4 -#define D_UNUSED3 8 +#define D_SUPER 4 +#define D_SNAP 8 #define D_UNUSED4 16 #define D_WARNING 32 /* misc warnings */ #define D_EXT2 64 /* anything from ext2_debug */ @@ -29,8 +30,9 @@ extern int obd_print_entry; #define D_INFO 512 /* general information, especially from interface.c */ #define D_IOCTL 1024 /* ioctl related information */ #define D_BLOCKS 2048 /* ext2 block allocation */ +#define D_RPC 4096 /* ext2 block allocation */ -#ifdef SIM_OBD_DEBUG +#ifdef EXT2_OBD_DEBUG #define CDEBUG(mask, format, a...) \ do { \ if (obd_debug_level & mask) { \ @@ -44,29 +46,38 @@ extern int obd_print_entry; #define EXIT \ if (obd_print_entry) \ - printk("Process %d leaving %s\n", current->pid, __FUNCTION__) + printk("Process %d leaving %s [%d]\n", current->pid, __FUNCTION__, __LINE__) -#else /* SIM_OBD_DEBUG */ +#else /* EXT2_OBD_DEBUG */ # define CDEBUG ; # define ENTRY ; # define EXIT ; -#endif /* SIM_OBD_DEBUG */ +#endif /* EXT2_OBD_DEBUG */ #define CMD(cmd) (( cmd == READ ) ? "read" : "write") +#define IDEBUG(inode) { \ + if ( !list_empty(&inode->i_data.pages) || inode->i_data.nrpages ) {\ + struct page * page;\ + printk("XXXXX: func %s line %d ino %ld list not empty, pages %ld\n", __FUNCTION__ , __LINE__,\ + inode->i_ino, inode->i_data.nrpages);\ + page = list_entry(inode->i_data.pages.next, struct page , list);\ + PDEBUG(page, "READ INODE");\ + }} + + #define PDEBUG(page,cmd) {if (page){\ char *uptodate = (Page_Uptodate(page)) ? "yes" : "no";\ char *locked = (PageLocked(page)) ? "yes" : "no";\ int count = page->count.counter;\ - long ino = (page->inode) ? page->inode->i_ino : -1;\ - long offset = page->offset / PAGE_SIZE;\ + long index = page->index;\ \ - CDEBUG(D_IOCTL, " ** %s, cmd: %s, ino: %ld, off %ld, uptodate: %s, "\ - "locked: %s, cnt %d page %p ** \n", __FUNCTION__,\ - cmd, ino, offset, uptodate, locked, count, page);\ + CDEBUG(D_IOCTL, " ** %s, cmd: %s, off %ld, uptodate: %s, "\ + "locked: %s, cnt %d page %p pages %ld** \n", __FUNCTION__,\ + cmd, index, uptodate, locked, count, page, (!page->mapping) ? -1 : page->mapping->nrpages);\ } else { CDEBUG(D_IOCTL, "** %s, no page\n", __FUNCTION__); }} @@ -112,7 +123,7 @@ static inline void inode_to_iattr(struct inode *inode, struct iattr *tmp) tmp->ia_atime = inode->i_atime; tmp->ia_mtime = inode->i_mtime; tmp->ia_ctime = inode->i_ctime; - tmp->ia_attr_flags = inode->i_flags; + /* tmp->ia_flags = inode->i_flags; */ tmp->ia_valid = ~0; } @@ -126,21 +137,16 @@ static inline void inode_cpy(struct inode *dest, struct inode *src) dest->i_atime = src->i_atime; dest->i_mtime = src->i_mtime; dest->i_ctime = src->i_ctime; - dest->i_attr_flags = src->i_flags; + dest->i_flags = src->i_flags; /* allocation of space */ dest->i_blocks = src->i_blocks; - - if ( !dest->i_blocks) - memcpy(&dest->u, &src->u, sizeof(src->u)); + if ( !dest->i_blocks) { + CDEBUG(D_IOCTL, "copying inline data: ino %ld\n", dest->i_ino); + memcpy(&dest->u.ext2_i.i_data, &src->u.ext2_i.i_data, + sizeof(src->u.ext2_i.i_data)); + } } - - - - - - - #endif