Commit 13c0ce85 authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/home/hch/BK/xfs/linux-2.5

into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
parents 51a43a9a 41f84493
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/major.h> #include <linux/major.h>
#include <linux/pagemap.h>
#include <linux/vfs.h> #include <linux/vfs.h>
#include <asm/page.h> #include <asm/page.h>
...@@ -169,7 +170,6 @@ typedef struct xfs_dirent { /* data from readdir() */ ...@@ -169,7 +170,6 @@ typedef struct xfs_dirent { /* data from readdir() */
#define DEFAULT_PROJID 0 #define DEFAULT_PROJID 0
#define dfltprid DEFAULT_PROJID #define dfltprid DEFAULT_PROJID
#define MAXNAMELEN 256
#define MAXPATHLEN 1024 #define MAXPATHLEN 1024
#define FINVIS 0x0100 /* don't update timestamps - XFS */ #define FINVIS 0x0100 /* don't update timestamps - XFS */
......
...@@ -872,13 +872,12 @@ XFS_log_write_unmount_ro(bhv_desc_t *bdp) ...@@ -872,13 +872,12 @@ XFS_log_write_unmount_ro(bhv_desc_t *bdp)
int error; int error;
mp = XFS_BHVTOM(bdp); mp = XFS_BHVTOM(bdp);
xfs_binval(mp->m_ddev_targp); pagebuf_delwri_flush(mp->m_ddev_targp, PBDF_WAIT, &pincount);
xfs_finish_reclaim_all(mp);
do { do {
xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE | XFS_LOG_SYNC);
VFS_SYNC(XFS_MTOVFS(mp), SYNC_ATTR|SYNC_WAIT, NULL, error); VFS_SYNC(XFS_MTOVFS(mp), SYNC_ATTR|SYNC_WAIT, NULL, error);
pagebuf_delwri_flush(mp->m_ddev_targp, pagebuf_delwri_flush(mp->m_ddev_targp, PBDF_WAIT, &pincount);
PBDF_WAIT, &pincount);
if (pincount == 0) {delay(50); count++;} if (pincount == 0) {delay(50); count++;}
} while (count < 2); } while (count < 2);
......
...@@ -671,13 +671,14 @@ extern void vn_rele(struct vnode *); ...@@ -671,13 +671,14 @@ extern void vn_rele(struct vnode *);
#define VN_HOLD(vp) ((void)vn_hold(vp)) #define VN_HOLD(vp) ((void)vn_hold(vp))
#define VN_RELE(vp) (iput(LINVFS_GET_IP(vp))) #define VN_RELE(vp) (iput(LINVFS_GET_IP(vp)))
#endif /* ! (defined(CONFIG_XFS_VNODE_TRACING) */ #endif /* ! (defined(CONFIG_XFS_VNODE_TRACING)) */
/* /*
* Vname handling macros. * Vname handling macros.
*/ */
#define VNAME(dentry) ((char *) (dentry)->d_name.name) #define VNAME(dentry) ((char *) (dentry)->d_name.name)
#define VNAMELEN(dentry) ((dentry)->d_name.len) #define VNAMELEN(dentry) ((dentry)->d_name.len)
#define VNAME_TO_VNODE(dentry) (LINVFS_GET_VP((dentry)->d_inode))
/* /*
* Vnode spinlock manipulation. * Vnode spinlock manipulation.
......
...@@ -1108,7 +1108,7 @@ _pagebuf_wait_unpin( ...@@ -1108,7 +1108,7 @@ _pagebuf_wait_unpin(
* pagebuf_iodone * pagebuf_iodone
* *
* pagebuf_iodone marks a buffer for which I/O is in progress * pagebuf_iodone marks a buffer for which I/O is in progress
* done with respect to that I/O. The pb_done routine, if * done with respect to that I/O. The pb_iodone routine, if
* present, will be called as a side-effect. * present, will be called as a side-effect.
*/ */
void void
...@@ -1173,7 +1173,7 @@ pagebuf_ioerror( /* mark/clear buffer error flag */ ...@@ -1173,7 +1173,7 @@ pagebuf_ioerror( /* mark/clear buffer error flag */
* pagebuf_iostart initiates I/O on a buffer, based on the flags supplied. * pagebuf_iostart initiates I/O on a buffer, based on the flags supplied.
* If necessary, it will arrange for any disk space allocation required, * If necessary, it will arrange for any disk space allocation required,
* and it will break up the request if the block mappings require it. * and it will break up the request if the block mappings require it.
* An pb_iodone routine in the buffer supplied will only be called * The pb_iodone routine in the buffer supplied will only be called
* when all of the subsidiary I/O requests, if any, have been completed. * when all of the subsidiary I/O requests, if any, have been completed.
* pagebuf_iostart calls the pagebuf_ioinitiate routine or * pagebuf_iostart calls the pagebuf_ioinitiate routine or
* pagebuf_iorequest, if the former routine is not defined, to start * pagebuf_iorequest, if the former routine is not defined, to start
...@@ -1317,7 +1317,7 @@ pagebuf_iorequest( /* start real I/O */ ...@@ -1317,7 +1317,7 @@ pagebuf_iorequest( /* start real I/O */
/* Set the count to 1 initially, this will stop an I/O /* Set the count to 1 initially, this will stop an I/O
* completion callout which happens before we have started * completion callout which happens before we have started
* all the I/O from calling iodone too early * all the I/O from calling pagebuf_iodone too early.
*/ */
atomic_set(&pb->pb_io_remaining, 1); atomic_set(&pb->pb_io_remaining, 1);
......
...@@ -41,7 +41,10 @@ static char message[256]; /* keep it off the stack */ ...@@ -41,7 +41,10 @@ static char message[256]; /* keep it off the stack */
static spinlock_t xfs_err_lock = SPIN_LOCK_UNLOCKED; static spinlock_t xfs_err_lock = SPIN_LOCK_UNLOCKED;
/* Translate from CE_FOO to KERN_FOO, err_level(CE_FOO) == KERN_FOO */ /* Translate from CE_FOO to KERN_FOO, err_level(CE_FOO) == KERN_FOO */
static char *err_level[8] = {KERN_EMERG, KERN_ALERT, KERN_CRIT, #define XFS_MAX_ERR_LEVEL 7
#define XFS_ERR_MASK ((1 << 3) - 1)
static char *err_level[XFS_MAX_ERR_LEVEL+1] =
{KERN_EMERG, KERN_ALERT, KERN_CRIT,
KERN_ERR, KERN_WARNING, KERN_NOTICE, KERN_ERR, KERN_WARNING, KERN_NOTICE,
KERN_INFO, KERN_DEBUG}; KERN_INFO, KERN_DEBUG};
...@@ -82,15 +85,22 @@ void ...@@ -82,15 +85,22 @@ void
cmn_err(register int level, char *fmt, ...) cmn_err(register int level, char *fmt, ...)
{ {
char *fp = fmt; char *fp = fmt;
va_list ap; int len;
int flags;
va_list ap;
spin_lock(&xfs_err_lock); level &= XFS_ERR_MASK;
if (level > XFS_MAX_ERR_LEVEL)
level = XFS_MAX_ERR_LEVEL;
spin_lock_irqsave(&xfs_err_lock,flags);
va_start(ap, fmt); va_start(ap, fmt);
if (*fmt == '!') fp++; if (*fmt == '!') fp++;
vsprintf(message, fp, ap); len = vsprintf(message, fp, ap);
printk("%s%s\n", err_level[level], message); if (message[len-1] != '\n')
strcat(message, "\n");
printk("%s%s", err_level[level], message);
va_end(ap); va_end(ap);
spin_unlock(&xfs_err_lock); spin_unlock_irqrestore(&xfs_err_lock,flags);
if (level == CE_PANIC) if (level == CE_PANIC)
BUG(); BUG();
...@@ -100,10 +110,18 @@ cmn_err(register int level, char *fmt, ...) ...@@ -100,10 +110,18 @@ cmn_err(register int level, char *fmt, ...)
void void
icmn_err(register int level, char *fmt, va_list ap) icmn_err(register int level, char *fmt, va_list ap)
{ {
spin_lock(&xfs_err_lock); int len;
vsprintf(message, fmt, ap); int flags;
spin_unlock(&xfs_err_lock);
printk("%s%s\n", err_level[level], message); level &= XFS_ERR_MASK;
if(level > XFS_MAX_ERR_LEVEL)
level = XFS_MAX_ERR_LEVEL;
spin_lock_irqsave(&xfs_err_lock,flags);
len = vsprintf(message, fmt, ap);
if (message[len-1] != '\n')
strcat(message, "\n");
spin_unlock_irqrestore(&xfs_err_lock,flags);
printk("%s%s", err_level[level], message);
if (level == CE_PANIC) if (level == CE_PANIC)
BUG(); BUG();
} }
...@@ -386,9 +386,6 @@ xfs_dir_lookup(xfs_trans_t *trans, xfs_inode_t *dp, char *name, int namelen, ...@@ -386,9 +386,6 @@ xfs_dir_lookup(xfs_trans_t *trans, xfs_inode_t *dp, char *name, int namelen,
int retval; int retval;
ASSERT((dp->i_d.di_mode & IFMT) == IFDIR); ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
if (namelen >= MAXNAMELEN) {
return(XFS_ERROR(EINVAL));
}
XFS_STATS_INC(xfsstats.xs_dir_lookup); XFS_STATS_INC(xfsstats.xs_dir_lookup);
/* /*
...@@ -479,9 +476,6 @@ xfs_dir_replace(xfs_trans_t *trans, xfs_inode_t *dp, char *name, int namelen, ...@@ -479,9 +476,6 @@ xfs_dir_replace(xfs_trans_t *trans, xfs_inode_t *dp, char *name, int namelen,
int retval; int retval;
ASSERT((dp->i_d.di_mode & IFMT) == IFDIR); ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
if (namelen >= MAXNAMELEN) {
return(XFS_ERROR(EINVAL));
}
if ((retval = xfs_dir_ino_validate(trans->t_mountp, inum))) if ((retval = xfs_dir_ino_validate(trans->t_mountp, inum)))
return retval; return retval;
......
...@@ -232,10 +232,8 @@ xfs_dir2_lookup( ...@@ -232,10 +232,8 @@ xfs_dir2_lookup(
int v; /* type-checking value */ int v; /* type-checking value */
ASSERT((dp->i_d.di_mode & IFMT) == IFDIR); ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
if (namelen >= MAXNAMELEN) {
return XFS_ERROR(EINVAL);
}
XFS_STATS_INC(xfsstats.xs_dir_lookup); XFS_STATS_INC(xfsstats.xs_dir_lookup);
/* /*
* Fill in the arg structure for this request. * Fill in the arg structure for this request.
*/ */
...@@ -395,9 +393,7 @@ xfs_dir2_replace( ...@@ -395,9 +393,7 @@ xfs_dir2_replace(
int v; /* type-checking value */ int v; /* type-checking value */
ASSERT((dp->i_d.di_mode & IFMT) == IFDIR); ASSERT((dp->i_d.di_mode & IFMT) == IFDIR);
if (namelen >= MAXNAMELEN) {
return XFS_ERROR(EINVAL);
}
if ((rval = xfs_dir_ino_validate(tp->t_mountp, inum))) { if ((rval = xfs_dir_ino_validate(tp->t_mountp, inum))) {
return rval; return rval;
} }
......
...@@ -414,11 +414,9 @@ void xfs_ifork_next_set(xfs_inode_t *ip, int w, int n); ...@@ -414,11 +414,9 @@ void xfs_ifork_next_set(xfs_inode_t *ip, int w, int n);
* max file offset is 2^(31+PAGE_SHIFT) - 1 (due to linux page cache) * max file offset is 2^(31+PAGE_SHIFT) - 1 (due to linux page cache)
* *
* NOTE: XFS itself can handle 2^63 - 1 (largest positive value of xfs_fsize_t) * NOTE: XFS itself can handle 2^63 - 1 (largest positive value of xfs_fsize_t)
* but Linux can't go above 2^(31+PAGE_SHIFT)-1: the Linux VM uses a 32 bit * but this is the Linux limit.
* signed variable to index cache data, so 2^31 * PAGE_SIZE is as big as
* you can go.
*/ */
#define XFS_MAX_FILE_OFFSET ((long long)((1ULL<<(31+PAGE_SHIFT))-1ULL)) #define XFS_MAX_FILE_OFFSET MAX_LFS_FILESIZE
#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ITOV) #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ITOV)
struct vnode *xfs_itov(xfs_inode_t *ip); struct vnode *xfs_itov(xfs_inode_t *ip);
...@@ -483,6 +481,7 @@ void xfs_iunlock_map_shared(xfs_inode_t *, uint); ...@@ -483,6 +481,7 @@ void xfs_iunlock_map_shared(xfs_inode_t *, uint);
void xfs_ifunlock(xfs_inode_t *); void xfs_ifunlock(xfs_inode_t *);
void xfs_ireclaim(xfs_inode_t *); void xfs_ireclaim(xfs_inode_t *);
int xfs_finish_reclaim(xfs_inode_t *, int, int); int xfs_finish_reclaim(xfs_inode_t *, int, int);
int xfs_finish_reclaim_all(struct xfs_mount *);
/* /*
* xfs_inode.c prototypes. * xfs_inode.c prototypes.
......
...@@ -2952,7 +2952,6 @@ xlog_recover_process_iunlinks(xlog_t *log) ...@@ -2952,7 +2952,6 @@ xlog_recover_process_iunlinks(xlog_t *log)
if (!error) { if (!error) {
ASSERT(ip->i_d.di_nlink == 0); ASSERT(ip->i_d.di_nlink == 0);
ASSERT(ip->i_d.di_mode != 0);
/* setup for the next pass */ /* setup for the next pass */
agino = INT_GET(dip->di_next_unlinked, agino = INT_GET(dip->di_next_unlinked,
...@@ -2970,7 +2969,9 @@ xlog_recover_process_iunlinks(xlog_t *log) ...@@ -2970,7 +2969,9 @@ xlog_recover_process_iunlinks(xlog_t *log)
ip->i_d.di_dmevmask = 0; ip->i_d.di_dmevmask = 0;
/* /*
* Drop our reference to the * If this is a new inode, handle
* it specially. Otherwise,
* just drop our reference to the
* inode. If there are no * inode. If there are no
* other references, this will * other references, this will
* send the inode to * send the inode to
...@@ -2978,7 +2979,10 @@ xlog_recover_process_iunlinks(xlog_t *log) ...@@ -2978,7 +2979,10 @@ xlog_recover_process_iunlinks(xlog_t *log)
* truncate the file and free * truncate the file and free
* the inode. * the inode.
*/ */
VN_RELE(XFS_ITOV(ip)); if (ip->i_d.di_mode == 0)
xfs_iput_new(ip, 0);
else
VN_RELE(XFS_ITOV(ip));
} else { } else {
/* /*
* We can't read in the inode * We can't read in the inode
......
...@@ -72,14 +72,13 @@ int xfs_rename_skip, xfs_rename_nskip; ...@@ -72,14 +72,13 @@ int xfs_rename_skip, xfs_rename_nskip;
* We are renaming dp1/name1 to dp2/name2. * We are renaming dp1/name1 to dp2/name2.
* *
* Return ENOENT if dp1 does not exist, other lookup errors, or 0 for success. * Return ENOENT if dp1 does not exist, other lookup errors, or 0 for success.
* Return EAGAIN if the caller needs to try again.
*/ */
STATIC int STATIC int
xfs_lock_for_rename( xfs_lock_for_rename(
xfs_inode_t *dp1, /* old (source) directory inode */ xfs_inode_t *dp1, /* old (source) directory inode */
xfs_inode_t *dp2, /* new (target) directory inode */ xfs_inode_t *dp2, /* new (target) directory inode */
vname_t *dentry1, /* old entry name */ vname_t *vname1,/* old entry name */
vname_t *dentry2, /* new entry name */ vname_t *vname2,/* new entry name */
xfs_inode_t **ipp1, /* inode of old entry */ xfs_inode_t **ipp1, /* inode of old entry */
xfs_inode_t **ipp2, /* inode of new entry, if it xfs_inode_t **ipp2, /* inode of new entry, if it
already exists, NULL otherwise. */ already exists, NULL otherwise. */
...@@ -102,7 +101,7 @@ xfs_lock_for_rename( ...@@ -102,7 +101,7 @@ xfs_lock_for_rename(
* to see if we still have the right inodes, directories, etc. * to see if we still have the right inodes, directories, etc.
*/ */
lock_mode = xfs_ilock_map_shared(dp1); lock_mode = xfs_ilock_map_shared(dp1);
error = xfs_get_dir_entry(dentry1, &ip1); error = xfs_get_dir_entry(vname1, &ip1);
if (error) { if (error) {
xfs_iunlock_map_shared(dp1, lock_mode); xfs_iunlock_map_shared(dp1, lock_mode);
return error; return error;
...@@ -123,7 +122,7 @@ xfs_lock_for_rename( ...@@ -123,7 +122,7 @@ xfs_lock_for_rename(
} }
error = xfs_dir_lookup_int(XFS_ITOBHV(dp2), lock_mode, error = xfs_dir_lookup_int(XFS_ITOBHV(dp2), lock_mode,
dentry2, &inum2, &ip2); vname2, &inum2, &ip2);
if (error == ENOENT) { /* target does not need to exist. */ if (error == ENOENT) { /* target does not need to exist. */
inum2 = 0; inum2 = 0;
} else if (error) { } else if (error) {
...@@ -213,20 +212,15 @@ xfs_lock_for_rename( ...@@ -213,20 +212,15 @@ xfs_lock_for_rename(
int rename_which_error_return = 0; int rename_which_error_return = 0;
#ifdef DEBUG
int xfs_rename_agains;
int xfs_renames;
#endif
/* /*
* xfs_rename * xfs_rename
*/ */
int int
xfs_rename( xfs_rename(
bhv_desc_t *src_dir_bdp, bhv_desc_t *src_dir_bdp,
vname_t *src_dentry, vname_t *src_vname,
vnode_t *target_dir_vp, vnode_t *target_dir_vp,
vname_t *target_dentry, vname_t *target_vname,
cred_t *credp) cred_t *credp)
{ {
xfs_trans_t *tp; xfs_trans_t *tp;
...@@ -246,15 +240,11 @@ xfs_rename( ...@@ -246,15 +240,11 @@ xfs_rename(
int spaceres; int spaceres;
int target_link_zero = 0; int target_link_zero = 0;
int num_inodes; int num_inodes;
char *src_name = VNAME(src_dentry); char *src_name = VNAME(src_vname);
char *target_name = VNAME(target_dentry); char *target_name = VNAME(target_vname);
int src_namelen; int src_namelen = VNAMELEN(src_vname);
int target_namelen; int target_namelen = VNAMELEN(target_vname);
#ifdef DEBUG
int retries;
xfs_renames++;
#endif
src_dir_vp = BHV_TO_VNODE(src_dir_bdp); src_dir_vp = BHV_TO_VNODE(src_dir_bdp);
vn_trace_entry(src_dir_vp, "xfs_rename", (inst_t *)__return_address); vn_trace_entry(src_dir_vp, "xfs_rename", (inst_t *)__return_address);
vn_trace_entry(target_dir_vp, "xfs_rename", (inst_t *)__return_address); vn_trace_entry(target_dir_vp, "xfs_rename", (inst_t *)__return_address);
...@@ -268,14 +258,10 @@ xfs_rename( ...@@ -268,14 +258,10 @@ xfs_rename(
if (target_dir_bdp == NULL) { if (target_dir_bdp == NULL) {
return XFS_ERROR(EXDEV); return XFS_ERROR(EXDEV);
} }
src_namelen = VNAMELEN(src_dentry);
if (src_namelen >= MAXNAMELEN)
return XFS_ERROR(ENAMETOOLONG);
target_namelen = VNAMELEN(target_dentry);
if (target_namelen >= MAXNAMELEN)
return XFS_ERROR(ENAMETOOLONG);
src_dp = XFS_BHVTOI(src_dir_bdp); src_dp = XFS_BHVTOI(src_dir_bdp);
target_dp = XFS_BHVTOI(target_dir_bdp); target_dp = XFS_BHVTOI(target_dir_bdp);
if (DM_EVENT_ENABLED(src_dir_vp->v_vfsp, src_dp, DM_EVENT_RENAME) || if (DM_EVENT_ENABLED(src_dir_vp->v_vfsp, src_dp, DM_EVENT_RENAME) ||
DM_EVENT_ENABLED(target_dir_vp->v_vfsp, DM_EVENT_ENABLED(target_dir_vp->v_vfsp,
target_dp, DM_EVENT_RENAME)) { target_dp, DM_EVENT_RENAME)) {
...@@ -290,9 +276,6 @@ xfs_rename( ...@@ -290,9 +276,6 @@ xfs_rename(
} }
/* Return through std_return after this point. */ /* Return through std_return after this point. */
#ifdef DEBUG
retries = 0;
#endif
/* /*
* Lock all the participating inodes. Depending upon whether * Lock all the participating inodes. Depending upon whether
* the target_name exists in the target directory, and * the target_name exists in the target directory, and
...@@ -302,15 +285,9 @@ xfs_rename( ...@@ -302,15 +285,9 @@ xfs_rename(
* does not exist in the source directory. * does not exist in the source directory.
*/ */
tp = NULL; tp = NULL;
do { error = xfs_lock_for_rename(src_dp, target_dp, src_vname,
error = xfs_lock_for_rename(src_dp, target_dp, src_dentry, target_vname, &src_ip, &target_ip, inodes,
target_dentry, &src_ip, &target_ip, inodes, &num_inodes);
&num_inodes);
#ifdef DEBUG
if (error == EAGAIN)
xfs_rename_agains++;
#endif
} while (error == EAGAIN);
if (error) { if (error) {
rename_which_error_return = __LINE__; rename_which_error_return = __LINE__;
......
...@@ -47,9 +47,7 @@ xfs_get_dir_entry( ...@@ -47,9 +47,7 @@ xfs_get_dir_entry(
vnode_t *vp; vnode_t *vp;
bhv_desc_t *bdp; bhv_desc_t *bdp;
ASSERT(dentry->d_inode); vp = VNAME_TO_VNODE(dentry);
vp = LINVFS_GET_VP(dentry->d_inode);
bdp = vn_bhv_lookup_unlocked(VN_BHV_HEAD(vp), &xfs_vnodeops); bdp = vn_bhv_lookup_unlocked(VN_BHV_HEAD(vp), &xfs_vnodeops);
if (!bdp) { if (!bdp) {
*ipp = NULL; *ipp = NULL;
......
...@@ -926,7 +926,7 @@ xfs_syncsub( ...@@ -926,7 +926,7 @@ xfs_syncsub(
IPOINTER_CLR; \ IPOINTER_CLR; \
} }
#define PREEMPT_MASK 0x7f #define XFS_PREEMPT_MASK 0x7f
if (bypassed) if (bypassed)
*bypassed = 0; *bypassed = 0;
...@@ -1395,7 +1395,7 @@ xfs_syncsub( ...@@ -1395,7 +1395,7 @@ xfs_syncsub(
* if we have looped many times without dropping the * if we have looped many times without dropping the
* lock. * lock.
*/ */
if ((++preempt & PREEMPT_MASK) == 0) { if ((++preempt & XFS_PREEMPT_MASK) == 0) {
if (mount_locked) { if (mount_locked) {
IPOINTER_INSERT(ip, mp); IPOINTER_INSERT(ip, mp);
} }
......
...@@ -82,7 +82,7 @@ xfs_open( ...@@ -82,7 +82,7 @@ xfs_open(
/* /*
* xfs_getattr * xfs_getattr
*/ */
int STATIC int
xfs_getattr( xfs_getattr(
bhv_desc_t *bdp, bhv_desc_t *bdp,
vattr_t *vap, vattr_t *vap,
...@@ -1935,8 +1935,6 @@ xfs_create( ...@@ -1935,8 +1935,6 @@ xfs_create(
dm_di_mode = vap->va_mode|VTTOIF(vap->va_type); dm_di_mode = vap->va_mode|VTTOIF(vap->va_type);
namelen = VNAMELEN(dentry); namelen = VNAMELEN(dentry);
if (namelen >= MAXNAMELEN)
return XFS_ERROR(ENAMETOOLONG);
if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_CREATE)) { if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_CREATE)) {
error = dm_send_namesp_event(DM_EVENT_CREATE, error = dm_send_namesp_event(DM_EVENT_CREATE,
...@@ -2433,8 +2431,7 @@ xfs_remove( ...@@ -2433,8 +2431,7 @@ xfs_remove(
return XFS_ERROR(EIO); return XFS_ERROR(EIO);
namelen = VNAMELEN(dentry); namelen = VNAMELEN(dentry);
if (namelen >= MAXNAMELEN)
return XFS_ERROR(ENAMETOOLONG);
if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_REMOVE)) { if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_REMOVE)) {
error = dm_send_namesp_event(DM_EVENT_REMOVE, dir_bdp, DM_RIGHT_NULL, error = dm_send_namesp_event(DM_EVENT_REMOVE, dir_bdp, DM_RIGHT_NULL,
NULL, DM_RIGHT_NULL, NULL, DM_RIGHT_NULL,
...@@ -2668,8 +2665,6 @@ xfs_link( ...@@ -2668,8 +2665,6 @@ xfs_link(
vn_trace_entry(src_vp, __FUNCTION__, (inst_t *)__return_address); vn_trace_entry(src_vp, __FUNCTION__, (inst_t *)__return_address);
target_namelen = VNAMELEN(dentry); target_namelen = VNAMELEN(dentry);
if (target_namelen >= MAXNAMELEN)
return XFS_ERROR(ENAMETOOLONG);
if (src_vp->v_type == VDIR) if (src_vp->v_type == VDIR)
return XFS_ERROR(EPERM); return XFS_ERROR(EPERM);
...@@ -2857,8 +2852,6 @@ xfs_mkdir( ...@@ -2857,8 +2852,6 @@ xfs_mkdir(
return XFS_ERROR(EIO); return XFS_ERROR(EIO);
dir_namelen = VNAMELEN(dentry); dir_namelen = VNAMELEN(dentry);
if (dir_namelen >= MAXNAMELEN)
return XFS_ERROR(ENAMETOOLONG);
tp = NULL; tp = NULL;
dp_joined_to_trans = B_FALSE; dp_joined_to_trans = B_FALSE;
...@@ -3100,8 +3093,6 @@ xfs_rmdir( ...@@ -3100,8 +3093,6 @@ xfs_rmdir(
if (XFS_FORCED_SHUTDOWN(XFS_BHVTOI(dir_bdp)->i_mount)) if (XFS_FORCED_SHUTDOWN(XFS_BHVTOI(dir_bdp)->i_mount))
return XFS_ERROR(EIO); return XFS_ERROR(EIO);
namelen = VNAMELEN(dentry); namelen = VNAMELEN(dentry);
if (namelen >= MAXNAMELEN)
return XFS_ERROR(ENAMETOOLONG);
if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_REMOVE)) { if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_REMOVE)) {
error = dm_send_namesp_event(DM_EVENT_REMOVE, error = dm_send_namesp_event(DM_EVENT_REMOVE,
...@@ -3415,8 +3406,7 @@ xfs_symlink( ...@@ -3415,8 +3406,7 @@ xfs_symlink(
return XFS_ERROR(EIO); return XFS_ERROR(EIO);
link_namelen = VNAMELEN(dentry); link_namelen = VNAMELEN(dentry);
if (link_namelen >= MAXNAMELEN)
return XFS_ERROR(ENAMETOOLONG);
/* /*
* Check component lengths of the target path name. * Check component lengths of the target path name.
*/ */
...@@ -4070,6 +4060,49 @@ xfs_finish_reclaim( ...@@ -4070,6 +4060,49 @@ xfs_finish_reclaim(
return 0; return 0;
} }
int
xfs_finish_reclaim_all(xfs_mount_t *mp)
{
int purged;
xfs_inode_t *ip;
vnode_t *vp;
int done = 0;
while (!done) {
purged = 0;
XFS_MOUNT_ILOCK(mp);
ip = mp->m_inodes;
if (ip == NULL) {
break;
}
do {
/* Make sure we skip markers inserted by sync */
if (ip->i_mount == NULL) {
ip = ip->i_mnext;
continue;
}
/*
* It's up to our caller to purge the root
* and quota vnodes later.
*/
vp = XFS_ITOV_NULL(ip);
if (!vp) {
XFS_MOUNT_IUNLOCK(mp);
xfs_finish_reclaim(ip, 0, XFS_IFLUSH_ASYNC);
purged = 1;
break;
}
} while (ip != mp->m_inodes);
done = !purged;
}
XFS_MOUNT_IUNLOCK(mp);
return 0;
}
/* /*
* xfs_alloc_file_space() * xfs_alloc_file_space()
* This routine allocates disk space for the given file. * This routine allocates disk space for the given file.
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#define RTC_MINOR 135 #define RTC_MINOR 135
#define EFI_RTC_MINOR 136 /* EFI Time services */ #define EFI_RTC_MINOR 136 /* EFI Time services */
#define SUN_OPENPROM_MINOR 139 #define SUN_OPENPROM_MINOR 139
#define DMAPI_MINOR 140 /* DMAPI */
#define NVRAM_MINOR 144 #define NVRAM_MINOR 144
#define I2O_MINOR 166 #define I2O_MINOR 166
#define MICROCODE_MINOR 184 #define MICROCODE_MINOR 184
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
Extended attributes handling. Extended attributes handling.
Copyright (C) 2001 by Andreas Gruenbacher <a.gruenbacher@computer.org> Copyright (C) 2001 by Andreas Gruenbacher <a.gruenbacher@computer.org>
Copyright (C) 2001 SGI - Silicon Graphics, Inc <linux-xfs@oss.sgi.com> Copyright (c) 2001-2002 Silicon Graphics, Inc. All Rights Reserved.
*/ */
#ifndef _LINUX_XATTR_H #ifndef _LINUX_XATTR_H
#define _LINUX_XATTR_H #define _LINUX_XATTR_H
......
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