| To: | "xfs@xxxxxxxxxxx" <xfs@xxxxxxxxxxx> |
|---|---|
| Subject: | REVIEW: Enhance xfs_repair -P option to disable libxfs xfs_buf_t locking |
| From: | "Barry Naujok" <bnaujok@xxxxxxx> |
| Date: | Fri, 30 May 2008 10:49:18 +1000 |
| Organization: | SGI |
| Sender: | xfs-bounce@xxxxxxxxxxx |
| User-agent: | Opera Mail/9.24 (Win32) |
I hope the subject is explanation enough :) Tested successfully by Sebastian on his filesystem reported in http://oss.sgi.com/archives/xfs/2008-05/msg00410.html =========================================================================== xfsprogs/include/libxfs.h =========================================================================== --- a/xfsprogs/include/libxfs.h 2008-05-28 18:10:03.000000000 +1000 +++ b/xfsprogs/include/libxfs.h 2008-05-28 17:47:13.956576883 +1000 @@ -69,11 +69,14 @@ typedef struct { char *rtname; /* pathname of realtime "subvolume" */ int isreadonly; /* filesystem is only read in applic */ int isdirect; /* we can attempt to use direct I/O */ - int disfile; /* data "subvolume" is a regular file */ int dcreat; /* try to create data subvolume */ + int disfile; /* data "subvolume" is a regular file */ + int dcreat; /* try to create data subvolume */ int lisfile; /* log "subvolume" is a regular file */ int lcreat; /* try to create log subvolume */ - int risfile; /* realtime "subvolume" is a reg file */ int rcreat; /* try to create realtime subvolume */ + int risfile; /* realtime "subvolume" is a reg file */ + int rcreat; /* try to create realtime subvolume */ int setblksize; /* attempt to set device blksize */ + int nobuflock; /* don't lock xfs_buf_t's */ /* output results */ dev_t ddev; /* device for data subvolume */ dev_t logdev; /* device for log subvolume */ =========================================================================== xfsprogs/libxfs/init.c =========================================================================== --- a/xfsprogs/libxfs/init.c 2008-05-28 18:10:03.000000000 +1000 +++ b/xfsprogs/libxfs/init.c 2008-05-28 17:50:48.105195527 +1000 @@ -28,6 +28,8 @@ int libxfs_ihash_size; /* #buckets in i struct cache *libxfs_bcache; /* global buffer cache */ int libxfs_bhash_size; /* #buckets in bcache */ +int no_xfs_buf_lock; /* global don't use xfs_buf_t lock flag */ + static void manage_zones(int); /* setup global zones */ /*
@@ -335,6 +337,7 @@ libxfs_init(libxfs_init_t *a)
if (!libxfs_bhash_size)
libxfs_bhash_size = LIBXFS_BHASHSIZE(sbp);
libxfs_bcache = cache_init(libxfs_bhash_size,
&libxfs_bcache_operations);
+ no_xfs_buf_lock = a->nobuflock;
manage_zones(0);
rval = 1;
done:=========================================================================== xfsprogs/libxfs/rdwr.c =========================================================================== --- a/xfsprogs/libxfs/rdwr.c 2008-05-28 18:10:03.000000000 +1000
+++ b/xfsprogs/libxfs/rdwr.c 2008-05-28 18:01:29.735224868 +1000
@@ -375,6 +375,8 @@ struct list_head lock_buf_list = {&lock_
int lock_buf_count = 0;
#endif+extern int no_xfs_buf_lock;
+
xfs_buf_t *
libxfs_getbuf(dev_t device, xfs_daddr_t blkno, int len)
{
@@ -388,7 +390,8 @@ libxfs_getbuf(dev_t device, xfs_daddr_t miss = cache_node_get(libxfs_bcache, &key, (struct cache_node **)&bp);
if (bp) {
- pthread_mutex_lock(&bp->b_lock);
+ if (!no_xfs_buf_lock)
+ pthread_mutex_lock(&bp->b_lock);
cache_node_set_priority(libxfs_bcache, (struct cache_node *)bp,
cache_node_get_priority((struct cache_node *)bp) - 4);
#ifdef XFS_BUF_TRACING
@@ -417,7 +420,8 @@ libxfs_putbuf(xfs_buf_t *bp)
list_del_init(&bp->b_lock_list);
pthread_mutex_unlock(&libxfs_bcache->c_mutex);
#endif
- pthread_mutex_unlock(&bp->b_lock);
+ if (!no_xfs_buf_lock)
+ pthread_mutex_unlock(&bp->b_lock);
cache_node_put((struct cache_node *)bp);
}
--- a/xfsprogs/repair/init.c 2008-05-28 18:10:03.000000000 +1000
+++ b/xfsprogs/repair/init.c 2008-05-28 17:52:26.024674072 +1000
@@ -135,6 +135,7 @@ xfs_init(libxfs_init_t *args)
/* XXX assume data file also means rt file */
}+ args->nobuflock = !do_prefetch;
args->setblksize = !dangerously;
args->isdirect = LIBXFS_DIRECT;
if (no_modify)
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: XFS: SB validate failed, Stefan Smietanowski |
|---|---|
| Next by Date: | Re: REVIEW: Enhance xfs_repair -P option to disable libxfs xfs_buf_t locking, Eric Sandeen |
| Previous by Thread: | XFS: SB validate failed, Spam Magnet |
| Next by Thread: | Re: REVIEW: Enhance xfs_repair -P option to disable libxfs xfs_buf_t locking, Eric Sandeen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |