Skip to content

Commit e471e59

Browse files
committed
fs/jfs: Remove dead code
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 <[email protected]>
1 parent 0d4837f commit e471e59

File tree

10 files changed

+1
-1651
lines changed

10 files changed

+1
-1651
lines changed

fs/jfs/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,3 @@ jfs-y := super.o file.o inode.o namei.o jfs_mount.o jfs_umount.o \
1313
resize.o xattr.o ioctl.o
1414

1515
jfs-$(CONFIG_JFS_POSIX_ACL) += acl.o
16-
17-
ccflags-y := -D_JFS_4K

fs/jfs/inode.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -224,18 +224,9 @@ int jfs_get_block(struct inode *ip, sector_t lblock,
224224
* this as a hole
225225
*/
226226
goto unlock;
227-
#ifdef _JFS_4K
228227
XADoffset(&xad, lblock64);
229228
XADlength(&xad, xlen);
230229
XADaddress(&xad, xaddr);
231-
#else /* _JFS_4K */
232-
/*
233-
* As long as block size = 4K, this isn't a problem.
234-
* We should mark the whole page not ABNR, but how
235-
* will we know to mark the other blocks BH_New?
236-
*/
237-
BUG();
238-
#endif /* _JFS_4K */
239230
rc = extRecord(ip, &xad);
240231
if (rc)
241232
goto unlock;
@@ -252,7 +243,6 @@ int jfs_get_block(struct inode *ip, sector_t lblock,
252243
/*
253244
* Allocate a new block
254245
*/
255-
#ifdef _JFS_4K
256246
if ((rc = extHint(ip, lblock64 << ip->i_sb->s_blocksize_bits, &xad)))
257247
goto unlock;
258248
rc = extAlloc(ip, xlen, lblock64, &xad, false);
@@ -263,14 +253,6 @@ int jfs_get_block(struct inode *ip, sector_t lblock,
263253
map_bh(bh_result, ip->i_sb, addressXAD(&xad));
264254
bh_result->b_size = lengthXAD(&xad) << ip->i_blkbits;
265255

266-
#else /* _JFS_4K */
267-
/*
268-
* We need to do whatever it takes to keep all but the last buffers
269-
* in 4K pages - see jfs_write.c
270-
*/
271-
BUG();
272-
#endif /* _JFS_4K */
273-
274256
unlock:
275257
/*
276258
* Release lock on inode

fs/jfs/jfs_dmap.c

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -869,74 +869,6 @@ int dbAlloc(struct inode *ip, s64 hint, s64 nblocks, s64 * results)
869869
return (rc);
870870
}
871871

872-
#ifdef _NOTYET
873-
/*
874-
* NAME: dbAllocExact()
875-
*
876-
* FUNCTION: try to allocate the requested extent;
877-
*
878-
* PARAMETERS:
879-
* ip - pointer to in-core inode;
880-
* blkno - extent address;
881-
* nblocks - extent length;
882-
*
883-
* RETURN VALUES:
884-
* 0 - success
885-
* -ENOSPC - insufficient disk resources
886-
* -EIO - i/o error
887-
*/
888-
int dbAllocExact(struct inode *ip, s64 blkno, int nblocks)
889-
{
890-
int rc;
891-
struct inode *ipbmap = JFS_SBI(ip->i_sb)->ipbmap;
892-
struct bmap *bmp = JFS_SBI(ip->i_sb)->bmap;
893-
struct dmap *dp;
894-
s64 lblkno;
895-
struct metapage *mp;
896-
897-
IREAD_LOCK(ipbmap, RDWRLOCK_DMAP);
898-
899-
/*
900-
* validate extent request:
901-
*
902-
* note: defragfs policy:
903-
* max 64 blocks will be moved.
904-
* allocation request size must be satisfied from a single dmap.
905-
*/
906-
if (nblocks <= 0 || nblocks > BPERDMAP || blkno >= bmp->db_mapsize) {
907-
IREAD_UNLOCK(ipbmap);
908-
return -EINVAL;
909-
}
910-
911-
if (nblocks > ((s64) 1 << bmp->db_maxfreebud)) {
912-
/* the free space is no longer available */
913-
IREAD_UNLOCK(ipbmap);
914-
return -ENOSPC;
915-
}
916-
917-
/* read in the dmap covering the extent */
918-
lblkno = BLKTODMAP(blkno, bmp->db_l2nbperpage);
919-
mp = read_metapage(ipbmap, lblkno, PSIZE, 0);
920-
if (mp == NULL) {
921-
IREAD_UNLOCK(ipbmap);
922-
return -EIO;
923-
}
924-
dp = (struct dmap *) mp->data;
925-
926-
/* try to allocate the requested extent */
927-
rc = dbAllocNext(bmp, dp, blkno, nblocks);
928-
929-
IREAD_UNLOCK(ipbmap);
930-
931-
if (rc == 0)
932-
mark_metapage_dirty(mp);
933-
934-
release_metapage(mp);
935-
936-
return (rc);
937-
}
938-
#endif /* _NOTYET */
939-
940872
/*
941873
* NAME: dbReAlloc()
942874
*

0 commit comments

Comments
 (0)