Skip to content

Commit

Permalink
fs/jfs: Remove dead code
Browse files Browse the repository at this point in the history
Since the JFS code was first added to Linux, there has been code hidden
in ifdefs  for some potential future features such as defragmentation
and supporting block sizes other than 4KB. There has been no ongoing
development on JFS for many years, so it's past time to remove this dead
code from the source.

Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
  • Loading branch information
Dave Kleikamp committed Apr 25, 2022
1 parent 0d4837f commit e471e59
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 1,651 deletions.
2 changes: 0 additions & 2 deletions fs/jfs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,3 @@ jfs-y := super.o file.o inode.o namei.o jfs_mount.o jfs_umount.o \
resize.o xattr.o ioctl.o

jfs-$(CONFIG_JFS_POSIX_ACL) += acl.o

ccflags-y := -D_JFS_4K
18 changes: 0 additions & 18 deletions fs/jfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,18 +224,9 @@ int jfs_get_block(struct inode *ip, sector_t lblock,
* 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;
Expand All @@ -252,7 +243,6 @@ int jfs_get_block(struct inode *ip, sector_t lblock,
/*
* 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);
Expand All @@ -263,14 +253,6 @@ int jfs_get_block(struct inode *ip, sector_t lblock,
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
Expand Down
68 changes: 0 additions & 68 deletions fs/jfs/jfs_dmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,74 +869,6 @@ int dbAlloc(struct inode *ip, s64 hint, s64 nblocks, s64 * results)
return (rc);
}

#ifdef _NOTYET
/*
* NAME: dbAllocExact()
*
* FUNCTION: try to allocate the requested extent;
*
* PARAMETERS:
* ip - pointer to in-core inode;
* blkno - extent address;
* nblocks - extent length;
*
* RETURN VALUES:
* 0 - success
* -ENOSPC - insufficient disk resources
* -EIO - i/o error
*/
int dbAllocExact(struct inode *ip, s64 blkno, int nblocks)
{
int rc;
struct inode *ipbmap = JFS_SBI(ip->i_sb)->ipbmap;
struct bmap *bmp = JFS_SBI(ip->i_sb)->bmap;
struct dmap *dp;
s64 lblkno;
struct metapage *mp;

IREAD_LOCK(ipbmap, RDWRLOCK_DMAP);

/*
* validate extent request:
*
* note: defragfs policy:
* max 64 blocks will be moved.
* allocation request size must be satisfied from a single dmap.
*/
if (nblocks <= 0 || nblocks > BPERDMAP || blkno >= bmp->db_mapsize) {
IREAD_UNLOCK(ipbmap);
return -EINVAL;
}

if (nblocks > ((s64) 1 << bmp->db_maxfreebud)) {
/* the free space is no longer available */
IREAD_UNLOCK(ipbmap);
return -ENOSPC;
}

/* read in the dmap covering the extent */
lblkno = BLKTODMAP(blkno, bmp->db_l2nbperpage);
mp = read_metapage(ipbmap, lblkno, PSIZE, 0);
if (mp == NULL) {
IREAD_UNLOCK(ipbmap);
return -EIO;
}
dp = (struct dmap *) mp->data;

/* try to allocate the requested extent */
rc = dbAllocNext(bmp, dp, blkno, nblocks);

IREAD_UNLOCK(ipbmap);

if (rc == 0)
mark_metapage_dirty(mp);

release_metapage(mp);

return (rc);
}
#endif /* _NOTYET */

/*
* NAME: dbReAlloc()
*
Expand Down
Loading

0 comments on commit e471e59

Please sign in to comment.