X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=mm%2Fswapfile.c;h=a15def63f28f19e8e9d0e9f550177b80b033526e;hb=46c43db1eabcdc46ad9a3d711edff1d698ecd21f;hp=e70d6c6d6fee6f626a0c247c53f213413454cd0e;hpb=a8c4c20dfa8b28a3c99e33c639d9c2ea5657741e;p=linux-2.6-omap-h63xx.git diff --git a/mm/swapfile.c b/mm/swapfile.c index e70d6c6d6fe..a15def63f28 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -442,11 +442,12 @@ int swap_type_of(dev_t device) if (!(swap_info[i].flags & SWP_WRITEOK)) continue; + if (!device) { spin_unlock(&swap_lock); return i; } - inode = swap_info->swap_file->f_dentry->d_inode; + inode = swap_info[i].swap_file->f_dentry->d_inode; if (S_ISBLK(inode->i_mode) && device == MKDEV(imajor(inode), iminor(inode))) { spin_unlock(&swap_lock); @@ -1722,13 +1723,14 @@ get_swap_info_struct(unsigned type) */ int valid_swaphandles(swp_entry_t entry, unsigned long *offset) { - int ret = 0, i = 1 << page_cluster; + int our_page_cluster = page_cluster; + int ret = 0, i = 1 << our_page_cluster; unsigned long toff; struct swap_info_struct *swapdev = swp_type(entry) + swap_info; - if (!page_cluster) /* no readahead */ + if (!our_page_cluster) /* no readahead */ return 0; - toff = (swp_offset(entry) >> page_cluster) << page_cluster; + toff = (swp_offset(entry) >> our_page_cluster) << our_page_cluster; if (!toff) /* first page is swap header */ toff++, i--; *offset = toff;