Merge tag 'jfs-5.19' of https://github.com/kleikamp/linux-shaggy
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 27 May 2022 22:59:21 +0000 (15:59 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 27 May 2022 22:59:21 +0000 (15:59 -0700)
Pull jfs updates from David Kleikamp:
 "One bug fix and some code cleanup"

* tag 'jfs-5.19' of https://github.com/kleikamp/linux-shaggy:
  fs/jfs: Remove dead code
  fs: jfs: fix possible NULL pointer dereference in dbFree()

1  2 
fs/jfs/inode.c

diff --combined fs/jfs/inode.c
@@@ -224,18 -224,9 +224,9 @@@ int jfs_get_block(struct inode *ip, sec
                                 * this as a hole
                                 */
                                goto unlock;
- #ifdef _JFS_4K
                        XADoffset(&xad, lblock64);
                        XADlength(&xad, xlen);
                        XADaddress(&xad, xaddr);
- #else                         /* _JFS_4K */
-                       /*
-                        * As long as block size = 4K, this isn't a problem.
-                        * We should mark the whole page not ABNR, but how
-                        * will we know to mark the other blocks BH_New?
-                        */
-                       BUG();
- #endif                                /* _JFS_4K */
                        rc = extRecord(ip, &xad);
                        if (rc)
                                goto unlock;
        /*
         * Allocate a new block
         */
- #ifdef _JFS_4K
        if ((rc = extHint(ip, lblock64 << ip->i_sb->s_blocksize_bits, &xad)))
                goto unlock;
        rc = extAlloc(ip, xlen, lblock64, &xad, false);
        map_bh(bh_result, ip->i_sb, addressXAD(&xad));
        bh_result->b_size = lengthXAD(&xad) << ip->i_blkbits;
  
- #else                         /* _JFS_4K */
-       /*
-        * We need to do whatever it takes to keep all but the last buffers
-        * in 4K pages - see jfs_write.c
-        */
-       BUG();
- #endif                                /* _JFS_4K */
        unlock:
        /*
         * Release lock on inode
@@@ -293,9 -275,9 +275,9 @@@ static int jfs_writepages(struct addres
        return mpage_writepages(mapping, wbc, jfs_get_block);
  }
  
 -static int jfs_readpage(struct file *file, struct page *page)
 +static int jfs_read_folio(struct file *file, struct folio *folio)
  {
 -      return mpage_readpage(page, jfs_get_block);
 +      return mpage_read_folio(folio, jfs_get_block);
  }
  
  static void jfs_readahead(struct readahead_control *rac)
@@@ -314,12 -296,13 +296,12 @@@ static void jfs_write_failed(struct add
  }
  
  static int jfs_write_begin(struct file *file, struct address_space *mapping,
 -                              loff_t pos, unsigned len, unsigned flags,
 +                              loff_t pos, unsigned len,
                                struct page **pagep, void **fsdata)
  {
        int ret;
  
 -      ret = nobh_write_begin(mapping, pos, len, flags, pagep, fsdata,
 -                              jfs_get_block);
 +      ret = nobh_write_begin(mapping, pos, len, pagep, fsdata, jfs_get_block);
        if (unlikely(ret))
                jfs_write_failed(mapping, pos + len);
  
@@@ -359,7 -342,7 +341,7 @@@ static ssize_t jfs_direct_IO(struct kio
  const struct address_space_operations jfs_aops = {
        .dirty_folio    = block_dirty_folio,
        .invalidate_folio = block_invalidate_folio,
 -      .readpage       = jfs_readpage,
 +      .read_folio     = jfs_read_folio,
        .readahead      = jfs_readahead,
        .writepage      = jfs_writepage,
        .writepages     = jfs_writepages,