Commit 8d7d9915 authored by Dave Kleikamp's avatar Dave Kleikamp

Merge jfs@jfs.bkbits.net:linux-2.5

into austin.ibm.com:/shaggy/bk/jfs-2.5
parents d456c644 16ecfdb9
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "jfs_xattr.h" #include "jfs_xattr.h"
#include "jfs_acl.h" #include "jfs_acl.h"
struct posix_acl *jfs_get_acl(struct inode *inode, int type) static struct posix_acl *jfs_get_acl(struct inode *inode, int type)
{ {
struct posix_acl *acl; struct posix_acl *acl;
char *ea_name; char *ea_name;
...@@ -74,7 +74,7 @@ struct posix_acl *jfs_get_acl(struct inode *inode, int type) ...@@ -74,7 +74,7 @@ struct posix_acl *jfs_get_acl(struct inode *inode, int type)
return acl; return acl;
} }
int jfs_set_acl(struct inode *inode, int type, struct posix_acl *acl) static int jfs_set_acl(struct inode *inode, int type, struct posix_acl *acl)
{ {
char *ea_name; char *ea_name;
struct jfs_inode_info *ji = JFS_IP(inode); struct jfs_inode_info *ji = JFS_IP(inode);
...@@ -247,7 +247,7 @@ int jfs_init_acl(struct inode *inode, struct inode *dir) ...@@ -247,7 +247,7 @@ int jfs_init_acl(struct inode *inode, struct inode *dir)
return rc; return rc;
} }
int jfs_acl_chmod(struct inode *inode) static int jfs_acl_chmod(struct inode *inode)
{ {
struct posix_acl *acl, *clone; struct posix_acl *acl, *clone;
int rc; int rc;
......
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
#include <linux/xattr_acl.h> #include <linux/xattr_acl.h>
struct posix_acl *jfs_get_acl(struct inode *, int);
int jfs_set_acl(struct inode *, int, struct posix_acl *);
int jfs_permission(struct inode *, int, struct nameidata *); int jfs_permission(struct inode *, int, struct nameidata *);
int jfs_init_acl(struct inode *, struct inode *); int jfs_init_acl(struct inode *, struct inode *);
int jfs_setattr(struct dentry *, struct iattr *); int jfs_setattr(struct dentry *, struct iattr *);
......
...@@ -124,7 +124,7 @@ static int dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, ...@@ -124,7 +124,7 @@ static int dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb,
s64 * results); s64 * results);
static int dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno, static int dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno,
s64 * results); s64 * results);
int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks); static int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks);
static int dbFindBits(u32 word, int l2nb); static int dbFindBits(u32 word, int l2nb);
static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno); static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno);
static int dbFindLeaf(dmtree_t * tp, int l2nb, int *leafidx); static int dbFindLeaf(dmtree_t * tp, int l2nb, int *leafidx);
...@@ -134,10 +134,10 @@ static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno, ...@@ -134,10 +134,10 @@ static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno,
int nblocks); int nblocks);
static int dbMaxBud(u8 * cp); static int dbMaxBud(u8 * cp);
s64 dbMapFileSizeToMapSize(struct inode *ipbmap); s64 dbMapFileSizeToMapSize(struct inode *ipbmap);
int blkstol2(s64 nb); static int blkstol2(s64 nb);
int cntlz(u32 value); static int cntlz(u32 value);
int cnttz(u32 word); static int cnttz(u32 word);
static int dbAllocDmapBU(struct bmap * bmp, struct dmap * dp, s64 blkno, static int dbAllocDmapBU(struct bmap * bmp, struct dmap * dp, s64 blkno,
int nblocks); int nblocks);
...@@ -155,7 +155,7 @@ static int dbGetL2AGSize(s64 nblocks); ...@@ -155,7 +155,7 @@ static int dbGetL2AGSize(s64 nblocks);
* into the table, with the table elements yielding the maximum * into the table, with the table elements yielding the maximum
* binary buddy of free bits within the character. * binary buddy of free bits within the character.
*/ */
signed char budtab[256] = { static s8 budtab[256] = {
3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
...@@ -942,7 +942,7 @@ int dbAlloc(struct inode *ip, s64 hint, s64 nblocks, s64 * results) ...@@ -942,7 +942,7 @@ int dbAlloc(struct inode *ip, s64 hint, s64 nblocks, s64 * results)
return (rc); return (rc);
} }
#ifdef _NOTYET
/* /*
* NAME: dbAllocExact() * NAME: dbAllocExact()
* *
...@@ -1009,7 +1009,7 @@ int dbAllocExact(struct inode *ip, s64 blkno, int nblocks) ...@@ -1009,7 +1009,7 @@ int dbAllocExact(struct inode *ip, s64 blkno, int nblocks)
return (rc); return (rc);
} }
#endif /* _NOTYET */
/* /*
* NAME: dbReAlloc() * NAME: dbReAlloc()
...@@ -1092,7 +1092,7 @@ dbReAlloc(struct inode *ip, ...@@ -1092,7 +1092,7 @@ dbReAlloc(struct inode *ip,
* -ENOSPC - insufficient disk resources * -ENOSPC - insufficient disk resources
* -EIO - i/o error * -EIO - i/o error
*/ */
int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks) static int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks)
{ {
struct jfs_sb_info *sbi = JFS_SBI(ip->i_sb); struct jfs_sb_info *sbi = JFS_SBI(ip->i_sb);
s64 lblkno, lastblkno, extblkno; s64 lblkno, lastblkno, extblkno;
...@@ -3022,7 +3022,7 @@ static int dbMaxBud(u8 * cp) ...@@ -3022,7 +3022,7 @@ static int dbMaxBud(u8 * cp)
* RETURN VALUES: * RETURN VALUES:
* count of trailing zeros * count of trailing zeros
*/ */
int cnttz(u32 word) static int cnttz(u32 word)
{ {
int n; int n;
...@@ -3047,7 +3047,7 @@ int cnttz(u32 word) ...@@ -3047,7 +3047,7 @@ int cnttz(u32 word)
* RETURN VALUES: * RETURN VALUES:
* count of leading zeros * count of leading zeros
*/ */
int cntlz(u32 value) static int cntlz(u32 value)
{ {
int n; int n;
......
...@@ -286,8 +286,6 @@ extern int dbNextAG(struct inode *ipbmap); ...@@ -286,8 +286,6 @@ extern int dbNextAG(struct inode *ipbmap);
extern int dbAlloc(struct inode *ipbmap, s64 hint, s64 nblocks, s64 * results); extern int dbAlloc(struct inode *ipbmap, s64 hint, s64 nblocks, s64 * results);
extern int dbAllocExact(struct inode *ip, s64 blkno, int nblocks);
extern int dbReAlloc(struct inode *ipbmap, extern int dbReAlloc(struct inode *ipbmap,
s64 blkno, s64 nblocks, s64 addnblocks, s64 * results); s64 blkno, s64 nblocks, s64 addnblocks, s64 * results);
......
...@@ -162,9 +162,6 @@ static int dtSplitRoot(tid_t tid, struct inode *ip, ...@@ -162,9 +162,6 @@ static int dtSplitRoot(tid_t tid, struct inode *ip,
static int dtDeleteUp(tid_t tid, struct inode *ip, struct metapage * fmp, static int dtDeleteUp(tid_t tid, struct inode *ip, struct metapage * fmp,
dtpage_t * fp, struct btstack * btstack); dtpage_t * fp, struct btstack * btstack);
static int dtSearchNode(struct inode *ip,
s64 lmxaddr, pxd_t * kpxd, struct btstack * btstack);
static int dtRelink(tid_t tid, struct inode *ip, dtpage_t * p); static int dtRelink(tid_t tid, struct inode *ip, dtpage_t * p);
static int dtReadFirst(struct inode *ip, struct btstack * btstack); static int dtReadFirst(struct inode *ip, struct btstack * btstack);
...@@ -2380,7 +2377,7 @@ static int dtDeleteUp(tid_t tid, struct inode *ip, ...@@ -2380,7 +2377,7 @@ static int dtDeleteUp(tid_t tid, struct inode *ip,
return 0; return 0;
} }
#ifdef _NOTYET
/* /*
* NAME: dtRelocate() * NAME: dtRelocate()
* *
...@@ -2575,7 +2572,6 @@ int dtRelocate(tid_t tid, struct inode *ip, s64 lmxaddr, pxd_t * opxd, ...@@ -2575,7 +2572,6 @@ int dtRelocate(tid_t tid, struct inode *ip, s64 lmxaddr, pxd_t * opxd,
return rc; return rc;
} }
/* /*
* NAME: dtSearchNode() * NAME: dtSearchNode()
* *
...@@ -2677,7 +2673,7 @@ static int dtSearchNode(struct inode *ip, s64 lmxaddr, pxd_t * kpxd, ...@@ -2677,7 +2673,7 @@ static int dtSearchNode(struct inode *ip, s64 lmxaddr, pxd_t * kpxd,
goto loop; goto loop;
} }
#endif /* _NOTYET */
/* /*
* dtRelink() * dtRelink()
...@@ -2933,7 +2929,7 @@ struct jfs_dirent { ...@@ -2933,7 +2929,7 @@ struct jfs_dirent {
/* /*
* function to determine next variable-sized jfs_dirent in buffer * function to determine next variable-sized jfs_dirent in buffer
*/ */
inline struct jfs_dirent *next_jfs_dirent(struct jfs_dirent *dirent) static inline struct jfs_dirent *next_jfs_dirent(struct jfs_dirent *dirent)
{ {
return (struct jfs_dirent *) return (struct jfs_dirent *)
((char *)dirent + ((char *)dirent +
......
...@@ -265,9 +265,6 @@ extern int dtInsert(tid_t tid, struct inode *ip, struct component_name * key, ...@@ -265,9 +265,6 @@ extern int dtInsert(tid_t tid, struct inode *ip, struct component_name * key,
extern int dtDelete(tid_t tid, struct inode *ip, struct component_name * key, extern int dtDelete(tid_t tid, struct inode *ip, struct component_name * key,
ino_t * data, int flag); ino_t * data, int flag);
extern int dtRelocate(tid_t tid,
struct inode *ip, s64 lmxaddr, pxd_t * opxd, s64 nxaddr);
extern int dtModify(tid_t tid, struct inode *ip, struct component_name * key, extern int dtModify(tid_t tid, struct inode *ip, struct component_name * key,
ino_t * orig_ino, ino_t new_ino, int flag); ino_t * orig_ino, ino_t new_ino, int flag);
......
...@@ -35,7 +35,6 @@ static s64 extRoundDown(s64 nb); ...@@ -35,7 +35,6 @@ static s64 extRoundDown(s64 nb);
/* /*
* external references * external references
*/ */
extern int dbExtend(struct inode *, s64, s64, s64);
extern int jfs_commit_inode(struct inode *, int); extern int jfs_commit_inode(struct inode *, int);
......
...@@ -114,7 +114,6 @@ struct jfs_inode_info { ...@@ -114,7 +114,6 @@ struct jfs_inode_info {
* cflag * cflag
*/ */
enum cflags { enum cflags {
COMMIT_New, /* never committed inode */
COMMIT_Nolink, /* inode committed with zero link count */ COMMIT_Nolink, /* inode committed with zero link count */
COMMIT_Inlineea, /* commit inode inline EA */ COMMIT_Inlineea, /* commit inode inline EA */
COMMIT_Freewmap, /* free WMAP at iClose() */ COMMIT_Freewmap, /* free WMAP at iClose() */
......
...@@ -72,7 +72,6 @@ struct inode *ialloc(struct inode *parent, umode_t mode) ...@@ -72,7 +72,6 @@ struct inode *ialloc(struct inode *parent, umode_t mode)
inode->i_generation = JFS_SBI(sb)->gengen++; inode->i_generation = JFS_SBI(sb)->gengen++;
jfs_inode->cflag = 0; jfs_inode->cflag = 0;
set_cflag(COMMIT_New, inode);
/* Zero remaining fields */ /* Zero remaining fields */
memset(&jfs_inode->acl, 0, sizeof(dxd_t)); memset(&jfs_inode->acl, 0, sizeof(dxd_t));
......
...@@ -196,6 +196,7 @@ static int lbmIOWait(struct lbuf * bp, int flag); ...@@ -196,6 +196,7 @@ static int lbmIOWait(struct lbuf * bp, int flag);
static bio_end_io_t lbmIODone; static bio_end_io_t lbmIODone;
static void lbmStartIO(struct lbuf * bp); static void lbmStartIO(struct lbuf * bp);
static void lmGCwrite(struct jfs_log * log, int cant_block); static void lmGCwrite(struct jfs_log * log, int cant_block);
static int lmLogSync(struct jfs_log * log, int nosyncwait);
...@@ -810,7 +811,7 @@ static void lmGCwrite(struct jfs_log * log, int cant_write) ...@@ -810,7 +811,7 @@ static void lmGCwrite(struct jfs_log * log, int cant_write)
* NOTE: * NOTE:
* This routine is called a interrupt time by lbmIODone * This routine is called a interrupt time by lbmIODone
*/ */
void lmPostGC(struct lbuf * bp) static void lmPostGC(struct lbuf * bp)
{ {
unsigned long flags; unsigned long flags;
struct jfs_log *log = bp->l_log; struct jfs_log *log = bp->l_log;
...@@ -933,7 +934,7 @@ void lmPostGC(struct lbuf * bp) ...@@ -933,7 +934,7 @@ void lmPostGC(struct lbuf * bp)
* *
* serialization: LOG_LOCK() held on entry/exit * serialization: LOG_LOCK() held on entry/exit
*/ */
int lmLogSync(struct jfs_log * log, int nosyncwait) static int lmLogSync(struct jfs_log * log, int nosyncwait)
{ {
int logsize; int logsize;
int written; /* written since last syncpt */ int written; /* written since last syncpt */
......
...@@ -505,7 +505,6 @@ struct logsyncblk { ...@@ -505,7 +505,6 @@ struct logsyncblk {
extern int lmLogOpen(struct super_block *sb); extern int lmLogOpen(struct super_block *sb);
extern int lmLogClose(struct super_block *sb); extern int lmLogClose(struct super_block *sb);
extern int lmLogSync(struct jfs_log * log, int nosyncwait);
extern int lmLogShutdown(struct jfs_log * log); extern int lmLogShutdown(struct jfs_log * log);
extern int lmLogInit(struct jfs_log * log); extern int lmLogInit(struct jfs_log * log);
extern int lmLogFormat(struct jfs_log *log, s64 logAddress, int logSize); extern int lmLogFormat(struct jfs_log *log, s64 logAddress, int logSize);
......
...@@ -168,25 +168,23 @@ extern struct completion jfsIOwait; ...@@ -168,25 +168,23 @@ extern struct completion jfsIOwait;
/* /*
* forward references * forward references
*/ */
int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck, struct commit * cd); struct tlock * tlck, struct commit * cd);
int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck); struct tlock * tlck);
void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck); struct tlock * tlck);
void inlineLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck);
void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck); struct tlock * tlck);
static void txAbortCommit(struct commit * cd); static void txAbortCommit(struct commit * cd);
static void txAllocPMap(struct inode *ip, struct maplock * maplock, static void txAllocPMap(struct inode *ip, struct maplock * maplock,
struct tblock * tblk); struct tblock * tblk);
void txForce(struct tblock * tblk); static void txForce(struct tblock * tblk);
static int txLog(struct jfs_log * log, struct tblock * tblk, struct commit * cd); static int txLog(struct jfs_log * log, struct tblock * tblk,
int txMoreLock(void); struct commit * cd);
static void txUpdateMap(struct tblock * tblk); static void txUpdateMap(struct tblock * tblk);
static void txRelease(struct tblock * tblk); static void txRelease(struct tblock * tblk);
void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck); struct tlock * tlck);
static void LogSyncRelease(struct metapage * mp); static void LogSyncRelease(struct metapage * mp);
...@@ -1240,8 +1238,8 @@ int txCommit(tid_t tid, /* transaction identifier */ ...@@ -1240,8 +1238,8 @@ int txCommit(tid_t tid, /* transaction identifier */
* Ensure that inode isn't reused before * Ensure that inode isn't reused before
* lazy commit thread finishes processing * lazy commit thread finishes processing
*/ */
if (tblk->xflag & (COMMIT_CREATE | COMMIT_DELETE)) { if (tblk->xflag & COMMIT_DELETE) {
atomic_inc(&tblk->ip->i_count); atomic_inc(&tblk->u.ip->i_count);
/* /*
* Avoid a rare deadlock * Avoid a rare deadlock
* *
...@@ -1252,13 +1250,13 @@ int txCommit(tid_t tid, /* transaction identifier */ ...@@ -1252,13 +1250,13 @@ int txCommit(tid_t tid, /* transaction identifier */
* commit the transaction synchronously, so the last iput * commit the transaction synchronously, so the last iput
* will be done by the calling thread (or later) * will be done by the calling thread (or later)
*/ */
if (tblk->ip->i_state & I_LOCK) if (tblk->u.ip->i_state & I_LOCK)
tblk->xflag &= ~COMMIT_LAZY; tblk->xflag &= ~COMMIT_LAZY;
} }
ASSERT((!(tblk->xflag & COMMIT_DELETE)) || ASSERT((!(tblk->xflag & COMMIT_DELETE)) ||
((tblk->ip->i_nlink == 0) && ((tblk->u.ip->i_nlink == 0) &&
!test_cflag(COMMIT_Nolink, tblk->ip))); !test_cflag(COMMIT_Nolink, tblk->u.ip)));
/* /*
* write COMMIT log record * write COMMIT log record
...@@ -1399,7 +1397,7 @@ static int txLog(struct jfs_log * log, struct tblock * tblk, struct commit * cd) ...@@ -1399,7 +1397,7 @@ static int txLog(struct jfs_log * log, struct tblock * tblk, struct commit * cd)
* *
* function: log inode tlock and format maplock to update bmap; * function: log inode tlock and format maplock to update bmap;
*/ */
int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck, struct commit * cd) struct tlock * tlck, struct commit * cd)
{ {
int rc = 0; int rc = 0;
...@@ -1514,7 +1512,7 @@ int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, ...@@ -1514,7 +1512,7 @@ int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
* *
* function: log data tlock * function: log data tlock
*/ */
int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck) struct tlock * tlck)
{ {
struct metapage *mp; struct metapage *mp;
...@@ -1560,7 +1558,7 @@ int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, ...@@ -1560,7 +1558,7 @@ int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
* *
* function: log dtree tlock and format maplock to update bmap; * function: log dtree tlock and format maplock to update bmap;
*/ */
void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck) struct tlock * tlck)
{ {
struct metapage *mp; struct metapage *mp;
...@@ -1665,7 +1663,7 @@ void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, ...@@ -1665,7 +1663,7 @@ void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
* *
* function: log xtree tlock and format maplock to update bmap; * function: log xtree tlock and format maplock to update bmap;
*/ */
void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck) struct tlock * tlck)
{ {
struct inode *ip; struct inode *ip;
...@@ -2360,23 +2358,17 @@ static void txUpdateMap(struct tblock * tblk) ...@@ -2360,23 +2358,17 @@ static void txUpdateMap(struct tblock * tblk)
* unlock mapper/write lock * unlock mapper/write lock
*/ */
if (tblk->xflag & COMMIT_CREATE) { if (tblk->xflag & COMMIT_CREATE) {
ip = tblk->ip; diUpdatePMap(ipimap, tblk->ino, FALSE, tblk);
ASSERT(test_cflag(COMMIT_New, ip));
clear_cflag(COMMIT_New, ip);
diUpdatePMap(ipimap, ip->i_ino, FALSE, tblk);
ipimap->i_state |= I_DIRTY; ipimap->i_state |= I_DIRTY;
/* update persistent block allocation map /* update persistent block allocation map
* for the allocation of inode extent; * for the allocation of inode extent;
*/ */
pxdlock.flag = mlckALLOCPXD; pxdlock.flag = mlckALLOCPXD;
pxdlock.pxd = JFS_IP(ip)->ixpxd; pxdlock.pxd = tblk->u.ixpxd;
pxdlock.index = 1; pxdlock.index = 1;
txAllocPMap(ip, (struct maplock *) & pxdlock, tblk); txAllocPMap(ipimap, (struct maplock *) & pxdlock, tblk);
iput(ip);
} else if (tblk->xflag & COMMIT_DELETE) { } else if (tblk->xflag & COMMIT_DELETE) {
ip = tblk->ip; ip = tblk->u.ip;
diUpdatePMap(ipimap, ip->i_ino, TRUE, tblk); diUpdatePMap(ipimap, ip->i_ino, TRUE, tblk);
ipimap->i_state |= I_DIRTY; ipimap->i_state |= I_DIRTY;
iput(ip); iput(ip);
...@@ -2725,7 +2717,7 @@ static void txAbortCommit(struct commit * cd) ...@@ -2725,7 +2717,7 @@ static void txAbortCommit(struct commit * cd)
* allocation maps are updated in order. For synchronous transactions, * allocation maps are updated in order. For synchronous transactions,
* let the user thread finish processing after txUpdateMap() is called. * let the user thread finish processing after txUpdateMap() is called.
*/ */
void txLazyCommit(struct tblock * tblk) static void txLazyCommit(struct tblock * tblk)
{ {
struct jfs_log *log; struct jfs_log *log;
......
...@@ -62,7 +62,11 @@ struct tblock { ...@@ -62,7 +62,11 @@ struct tblock {
* ready transactions wait on this * ready transactions wait on this
* event for group commit completion. * event for group commit completion.
*/ */
struct inode *ip; /* inode being created or deleted */ union {
struct inode *ip; /* inode being deleted */
pxd_t ixpxd; /* pxd of inode extent for created inode */
} u;
u32 ino; /* inode number being created */
}; };
extern struct tblock *TxBlock; /* transaction block table */ extern struct tblock *TxBlock; /* transaction block table */
......
...@@ -34,6 +34,8 @@ int jfs_strfromUCS_le(char *to, const wchar_t * from, /* LITTLE ENDIAN */ ...@@ -34,6 +34,8 @@ int jfs_strfromUCS_le(char *to, const wchar_t * from, /* LITTLE ENDIAN */
{ {
int i; int i;
int outlen = 0; int outlen = 0;
static int warn_again = 5; /* Only warn up to 5 times total */
int warn = !!warn_again; /* once per string */
if (codepage) { if (codepage) {
for (i = 0; (i < len) && from[i]; i++) { for (i = 0; (i < len) && from[i]; i++) {
...@@ -48,8 +50,22 @@ int jfs_strfromUCS_le(char *to, const wchar_t * from, /* LITTLE ENDIAN */ ...@@ -48,8 +50,22 @@ int jfs_strfromUCS_le(char *to, const wchar_t * from, /* LITTLE ENDIAN */
to[outlen++] = '?'; to[outlen++] = '?';
} }
} else { } else {
for (i = 0; (i < len) && from[i]; i++) for (i = 0; (i < len) && from[i]; i++) {
if (le16_to_cpu(from[i]) & 0xff00) {
if (warn) {
warn--;
warn_again--;
printk(KERN_ERR
"non-latin1 character 0x%x found in JFS file name\n",
le16_to_cpu(from[i]));
printk(KERN_ERR
"mount with iocharset=utf8 to access\n");
}
to[i] = '?';
}
else
to[i] = (char) (le16_to_cpu(from[i])); to[i] = (char) (le16_to_cpu(from[i]));
}
outlen = i; outlen = i;
} }
to[outlen] = 0; to[outlen] = 0;
...@@ -62,8 +78,8 @@ int jfs_strfromUCS_le(char *to, const wchar_t * from, /* LITTLE ENDIAN */ ...@@ -62,8 +78,8 @@ int jfs_strfromUCS_le(char *to, const wchar_t * from, /* LITTLE ENDIAN */
* FUNCTION: Convert character string to unicode string * FUNCTION: Convert character string to unicode string
* *
*/ */
int jfs_strtoUCS(wchar_t * to, static int jfs_strtoUCS(wchar_t * to, const char *from, int len,
const char *from, int len, struct nls_table *codepage) struct nls_table *codepage)
{ {
int charlen; int charlen;
int i; int i;
......
...@@ -1736,7 +1736,7 @@ int xtExtend(tid_t tid, /* transaction id */ ...@@ -1736,7 +1736,7 @@ int xtExtend(tid_t tid, /* transaction id */
return rc; return rc;
} }
#ifdef _NOTYET
/* /*
* xtTailgate() * xtTailgate()
* *
...@@ -1918,7 +1918,7 @@ printf("xtTailgate: xoff:0x%lx xlen:0x%x xaddr:0x%lx\n", ...@@ -1918,7 +1918,7 @@ printf("xtTailgate: xoff:0x%lx xlen:0x%x xaddr:0x%lx\n",
return rc; return rc;
} }
#endif /* _NOTYET */
/* /*
* xtUpdate() * xtUpdate()
......
...@@ -117,8 +117,10 @@ extern int xtInsert(tid_t tid, struct inode *ip, ...@@ -117,8 +117,10 @@ extern int xtInsert(tid_t tid, struct inode *ip,
int xflag, s64 xoff, int xlen, s64 * xaddrp, int flag); int xflag, s64 xoff, int xlen, s64 * xaddrp, int flag);
extern int xtExtend(tid_t tid, struct inode *ip, s64 xoff, int xlen, extern int xtExtend(tid_t tid, struct inode *ip, s64 xoff, int xlen,
int flag); int flag);
#ifdef _NOTYET
extern int xtTailgate(tid_t tid, struct inode *ip, extern int xtTailgate(tid_t tid, struct inode *ip,
s64 xoff, int xlen, s64 xaddr, int flag); s64 xoff, int xlen, s64 xaddr, int flag);
#endif
extern int xtUpdate(tid_t tid, struct inode *ip, struct xad *nxad); extern int xtUpdate(tid_t tid, struct inode *ip, struct xad *nxad);
extern int xtDelete(tid_t tid, struct inode *ip, s64 xoff, int xlen, extern int xtDelete(tid_t tid, struct inode *ip, s64 xoff, int xlen,
int flag); int flag);
......
...@@ -44,7 +44,7 @@ extern int jfs_init_acl(struct inode *, struct inode *); ...@@ -44,7 +44,7 @@ extern int jfs_init_acl(struct inode *, struct inode *);
struct inode_operations jfs_dir_inode_operations; struct inode_operations jfs_dir_inode_operations;
struct file_operations jfs_dir_operations; struct file_operations jfs_dir_operations;
s64 commitZeroLink(tid_t, struct inode *); static s64 commitZeroLink(tid_t, struct inode *);
/* /*
* NAME: jfs_create(dip, dentry, mode) * NAME: jfs_create(dip, dentry, mode)
...@@ -60,7 +60,7 @@ s64 commitZeroLink(tid_t, struct inode *); ...@@ -60,7 +60,7 @@ s64 commitZeroLink(tid_t, struct inode *);
* RETURN: Errors from subroutines * RETURN: Errors from subroutines
* *
*/ */
int jfs_create(struct inode *dip, struct dentry *dentry, int mode, static int jfs_create(struct inode *dip, struct dentry *dentry, int mode,
struct nameidata *nd) struct nameidata *nd)
{ {
int rc = 0; int rc = 0;
...@@ -104,7 +104,8 @@ int jfs_create(struct inode *dip, struct dentry *dentry, int mode, ...@@ -104,7 +104,8 @@ int jfs_create(struct inode *dip, struct dentry *dentry, int mode,
tblk = tid_to_tblock(tid); tblk = tid_to_tblock(tid);
tblk->xflag |= COMMIT_CREATE; tblk->xflag |= COMMIT_CREATE;
tblk->ip = ip; tblk->ino = ip->i_ino;
tblk->u.ixpxd = JFS_IP(ip)->ixpxd;
iplist[0] = dip; iplist[0] = dip;
iplist[1] = ip; iplist[1] = ip;
...@@ -181,7 +182,7 @@ int jfs_create(struct inode *dip, struct dentry *dentry, int mode, ...@@ -181,7 +182,7 @@ int jfs_create(struct inode *dip, struct dentry *dentry, int mode,
* note: * note:
* EACCESS: user needs search+write permission on the parent directory * EACCESS: user needs search+write permission on the parent directory
*/ */
int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode) static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode)
{ {
int rc = 0; int rc = 0;
tid_t tid; /* transaction id */ tid_t tid; /* transaction id */
...@@ -230,7 +231,8 @@ int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode) ...@@ -230,7 +231,8 @@ int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode)
tblk = tid_to_tblock(tid); tblk = tid_to_tblock(tid);
tblk->xflag |= COMMIT_CREATE; tblk->xflag |= COMMIT_CREATE;
tblk->ip = ip; tblk->ino = ip->i_ino;
tblk->u.ixpxd = JFS_IP(ip)->ixpxd;
iplist[0] = dip; iplist[0] = dip;
iplist[1] = ip; iplist[1] = ip;
...@@ -314,7 +316,7 @@ int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode) ...@@ -314,7 +316,7 @@ int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode)
* but the directory is not removed until the last reference to * but the directory is not removed until the last reference to
* the directory is released (cf.unlink() of regular file). * the directory is released (cf.unlink() of regular file).
*/ */
int jfs_rmdir(struct inode *dip, struct dentry *dentry) static int jfs_rmdir(struct inode *dip, struct dentry *dentry)
{ {
int rc; int rc;
tid_t tid; /* transaction id */ tid_t tid; /* transaction id */
...@@ -346,7 +348,7 @@ int jfs_rmdir(struct inode *dip, struct dentry *dentry) ...@@ -346,7 +348,7 @@ int jfs_rmdir(struct inode *dip, struct dentry *dentry)
tblk = tid_to_tblock(tid); tblk = tid_to_tblock(tid);
tblk->xflag |= COMMIT_DELETE; tblk->xflag |= COMMIT_DELETE;
tblk->ip = ip; tblk->u.ip = ip;
/* /*
* delete the entry of target directory from parent directory * delete the entry of target directory from parent directory
...@@ -437,7 +439,7 @@ int jfs_rmdir(struct inode *dip, struct dentry *dentry) ...@@ -437,7 +439,7 @@ int jfs_rmdir(struct inode *dip, struct dentry *dentry)
* JFS does NOT support unlink() on directories. * JFS does NOT support unlink() on directories.
* *
*/ */
int jfs_unlink(struct inode *dip, struct dentry *dentry) static int jfs_unlink(struct inode *dip, struct dentry *dentry)
{ {
int rc; int rc;
tid_t tid; /* transaction id */ tid_t tid; /* transaction id */
...@@ -505,7 +507,7 @@ int jfs_unlink(struct inode *dip, struct dentry *dentry) ...@@ -505,7 +507,7 @@ int jfs_unlink(struct inode *dip, struct dentry *dentry)
} }
tblk = tid_to_tblock(tid); tblk = tid_to_tblock(tid);
tblk->xflag |= COMMIT_DELETE; tblk->xflag |= COMMIT_DELETE;
tblk->ip = ip; tblk->u.ip = ip;
} }
/* /*
...@@ -590,7 +592,7 @@ int jfs_unlink(struct inode *dip, struct dentry *dentry) ...@@ -590,7 +592,7 @@ int jfs_unlink(struct inode *dip, struct dentry *dentry)
* *
* RETURN: Errors from subroutines * RETURN: Errors from subroutines
*/ */
s64 commitZeroLink(tid_t tid, struct inode *ip) static s64 commitZeroLink(tid_t tid, struct inode *ip)
{ {
int filetype; int filetype;
struct tblock *tblk; struct tblock *tblk;
...@@ -758,7 +760,7 @@ int freeZeroLink(struct inode *ip) ...@@ -758,7 +760,7 @@ int freeZeroLink(struct inode *ip)
* EXDEV: target object and new link are on different file systems and * EXDEV: target object and new link are on different file systems and
* implementation does not support links between file systems [XPG4.2]. * implementation does not support links between file systems [XPG4.2].
*/ */
int jfs_link(struct dentry *old_dentry, static int jfs_link(struct dentry *old_dentry,
struct inode *dir, struct dentry *dentry) struct inode *dir, struct dentry *dentry)
{ {
int rc; int rc;
...@@ -838,7 +840,8 @@ int jfs_link(struct dentry *old_dentry, ...@@ -838,7 +840,8 @@ int jfs_link(struct dentry *old_dentry,
* an intermediate result whose length exceeds PATH_MAX [XPG4.2] * an intermediate result whose length exceeds PATH_MAX [XPG4.2]
*/ */
int jfs_symlink(struct inode *dip, struct dentry *dentry, const char *name) static int jfs_symlink(struct inode *dip, struct dentry *dentry,
const char *name)
{ {
int rc; int rc;
tid_t tid; tid_t tid;
...@@ -889,7 +892,8 @@ int jfs_symlink(struct inode *dip, struct dentry *dentry, const char *name) ...@@ -889,7 +892,8 @@ int jfs_symlink(struct inode *dip, struct dentry *dentry, const char *name)
tblk = tid_to_tblock(tid); tblk = tid_to_tblock(tid);
tblk->xflag |= COMMIT_CREATE; tblk->xflag |= COMMIT_CREATE;
tblk->ip = ip; tblk->ino = ip->i_ino;
tblk->u.ixpxd = JFS_IP(ip)->ixpxd;
/* /*
* create entry for symbolic link in parent directory * create entry for symbolic link in parent directory
...@@ -1042,7 +1046,7 @@ int jfs_symlink(struct inode *dip, struct dentry *dentry, const char *name) ...@@ -1042,7 +1046,7 @@ int jfs_symlink(struct inode *dip, struct dentry *dentry, const char *name)
* *
* FUNCTION: rename a file or directory * FUNCTION: rename a file or directory
*/ */
int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry) struct inode *new_dir, struct dentry *new_dentry)
{ {
struct btstack btstack; struct btstack btstack;
...@@ -1151,7 +1155,7 @@ int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1151,7 +1155,7 @@ int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
} }
tblk = tid_to_tblock(tid); tblk = tid_to_tblock(tid);
tblk->xflag |= COMMIT_DELETE; tblk->xflag |= COMMIT_DELETE;
tblk->ip = new_ip; tblk->u.ip = new_ip;
} else if (new_ip->i_nlink == 0) { } else if (new_ip->i_nlink == 0) {
assert(!test_cflag(COMMIT_Nolink, new_ip)); assert(!test_cflag(COMMIT_Nolink, new_ip));
/* free block resources */ /* free block resources */
...@@ -1162,7 +1166,7 @@ int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1162,7 +1166,7 @@ int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
} }
tblk = tid_to_tblock(tid); tblk = tid_to_tblock(tid);
tblk->xflag |= COMMIT_DELETE; tblk->xflag |= COMMIT_DELETE;
tblk->ip = new_ip; tblk->u.ip = new_ip;
} else { } else {
new_ip->i_ctime = CURRENT_TIME; new_ip->i_ctime = CURRENT_TIME;
mark_inode_dirty(new_ip); mark_inode_dirty(new_ip);
...@@ -1310,7 +1314,8 @@ int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1310,7 +1314,8 @@ int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
* *
* FUNCTION: Create a special file (device) * FUNCTION: Create a special file (device)
*/ */
int jfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev) static int jfs_mknod(struct inode *dir, struct dentry *dentry,
int mode, dev_t rdev)
{ {
struct jfs_inode_info *jfs_ip; struct jfs_inode_info *jfs_ip;
struct btstack btstack; struct btstack btstack;
...@@ -1347,7 +1352,8 @@ int jfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev) ...@@ -1347,7 +1352,8 @@ int jfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev)
tblk = tid_to_tblock(tid); tblk = tid_to_tblock(tid);
tblk->xflag |= COMMIT_CREATE; tblk->xflag |= COMMIT_CREATE;
tblk->ip = ip; tblk->ino = ip->i_ino;
tblk->u.ixpxd = JFS_IP(ip)->ixpxd;
ino = ip->i_ino; ino = ip->i_ino;
if ((rc = dtInsert(tid, dir, &dname, &ino, &btstack))) if ((rc = dtInsert(tid, dir, &dname, &ino, &btstack)))
......
...@@ -321,7 +321,7 @@ static int parse_options(char *options, struct super_block *sb, s64 *newLVSize, ...@@ -321,7 +321,7 @@ static int parse_options(char *options, struct super_block *sb, s64 *newLVSize,
return 0; return 0;
} }
int jfs_remount(struct super_block *sb, int *flags, char *data) static int jfs_remount(struct super_block *sb, int *flags, char *data)
{ {
s64 newLVSize = 0; s64 newLVSize = 0;
int rc = 0; int rc = 0;
......
...@@ -640,6 +640,7 @@ static int ea_put(struct inode *inode, struct ea_buffer *ea_buf, int new_size) ...@@ -640,6 +640,7 @@ static int ea_put(struct inode *inode, struct ea_buffer *ea_buf, int new_size)
} }
inode->i_blocks += LBLK2PBLK(inode->i_sb, new_blocks - old_blocks); inode->i_blocks += LBLK2PBLK(inode->i_sb, new_blocks - old_blocks);
inode->i_ctime = CURRENT_TIME;
rc = txCommit(tid, 1, &inode, 0); rc = txCommit(tid, 1, &inode, 0);
txEnd(tid); txEnd(tid);
up(&ji->commit_sem); up(&ji->commit_sem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment