diff options
author | NeilBrown <neilb@suse.de> | 2012-08-01 06:40:02 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-08-01 06:40:02 -0400 |
commit | bb181e2e48f8c85db08c9cb015cbba9618dbf05c (patch) | |
tree | 191bc24dd97bcb174535cc217af082f16da3b43d /fs/xfs | |
parent | d57368afe63b3b7b45ce6c2b8c5276417935be2f (diff) | |
parent | c039c332f23e794deb6d6f37b9f07ff3b27fb2cf (diff) |
Merge commit 'c039c332f23e794deb6d6f37b9f07ff3b27fb2cf' into md
Pull in pre-requisites for adding raid10 support to dm-raid.
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_alloc.c | 19 | ||||
-rw-r--r-- | fs/xfs/xfs_buf.c | 53 | ||||
-rw-r--r-- | fs/xfs/xfs_buf.h | 1 | ||||
-rw-r--r-- | fs/xfs/xfs_buf_item.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_ioctl.c | 7 | ||||
-rw-r--r-- | fs/xfs/xfs_iops.c | 6 |
6 files changed, 46 insertions, 42 deletions
diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c index 9d1aeb7e2734..4f33c32affe3 100644 --- a/fs/xfs/xfs_alloc.c +++ b/fs/xfs/xfs_alloc.c | |||
@@ -1074,13 +1074,13 @@ restart: | |||
1074 | * If we couldn't get anything, give up. | 1074 | * If we couldn't get anything, give up. |
1075 | */ | 1075 | */ |
1076 | if (bno_cur_lt == NULL && bno_cur_gt == NULL) { | 1076 | if (bno_cur_lt == NULL && bno_cur_gt == NULL) { |
1077 | xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); | ||
1078 | |||
1077 | if (!forced++) { | 1079 | if (!forced++) { |
1078 | trace_xfs_alloc_near_busy(args); | 1080 | trace_xfs_alloc_near_busy(args); |
1079 | xfs_log_force(args->mp, XFS_LOG_SYNC); | 1081 | xfs_log_force(args->mp, XFS_LOG_SYNC); |
1080 | goto restart; | 1082 | goto restart; |
1081 | } | 1083 | } |
1082 | |||
1083 | xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); | ||
1084 | trace_xfs_alloc_size_neither(args); | 1084 | trace_xfs_alloc_size_neither(args); |
1085 | args->agbno = NULLAGBLOCK; | 1085 | args->agbno = NULLAGBLOCK; |
1086 | return 0; | 1086 | return 0; |
@@ -2434,13 +2434,22 @@ xfs_alloc_vextent_worker( | |||
2434 | current_restore_flags_nested(&pflags, PF_FSTRANS); | 2434 | current_restore_flags_nested(&pflags, PF_FSTRANS); |
2435 | } | 2435 | } |
2436 | 2436 | ||
2437 | 2437 | /* | |
2438 | int /* error */ | 2438 | * Data allocation requests often come in with little stack to work on. Push |
2439 | * them off to a worker thread so there is lots of stack to use. Metadata | ||
2440 | * requests, OTOH, are generally from low stack usage paths, so avoid the | ||
2441 | * context switch overhead here. | ||
2442 | */ | ||
2443 | int | ||
2439 | xfs_alloc_vextent( | 2444 | xfs_alloc_vextent( |
2440 | xfs_alloc_arg_t *args) /* allocation argument structure */ | 2445 | struct xfs_alloc_arg *args) |
2441 | { | 2446 | { |
2442 | DECLARE_COMPLETION_ONSTACK(done); | 2447 | DECLARE_COMPLETION_ONSTACK(done); |
2443 | 2448 | ||
2449 | if (!args->userdata) | ||
2450 | return __xfs_alloc_vextent(args); | ||
2451 | |||
2452 | |||
2444 | args->done = &done; | 2453 | args->done = &done; |
2445 | INIT_WORK_ONSTACK(&args->work, xfs_alloc_vextent_worker); | 2454 | INIT_WORK_ONSTACK(&args->work, xfs_alloc_vextent_worker); |
2446 | queue_work(xfs_alloc_wq, &args->work); | 2455 | queue_work(xfs_alloc_wq, &args->work); |
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index a4beb421018a..269b35c084da 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c | |||
@@ -989,27 +989,6 @@ xfs_buf_ioerror_alert( | |||
989 | (__uint64_t)XFS_BUF_ADDR(bp), func, bp->b_error, bp->b_length); | 989 | (__uint64_t)XFS_BUF_ADDR(bp), func, bp->b_error, bp->b_length); |
990 | } | 990 | } |
991 | 991 | ||
992 | int | ||
993 | xfs_bwrite( | ||
994 | struct xfs_buf *bp) | ||
995 | { | ||
996 | int error; | ||
997 | |||
998 | ASSERT(xfs_buf_islocked(bp)); | ||
999 | |||
1000 | bp->b_flags |= XBF_WRITE; | ||
1001 | bp->b_flags &= ~(XBF_ASYNC | XBF_READ | _XBF_DELWRI_Q); | ||
1002 | |||
1003 | xfs_bdstrat_cb(bp); | ||
1004 | |||
1005 | error = xfs_buf_iowait(bp); | ||
1006 | if (error) { | ||
1007 | xfs_force_shutdown(bp->b_target->bt_mount, | ||
1008 | SHUTDOWN_META_IO_ERROR); | ||
1009 | } | ||
1010 | return error; | ||
1011 | } | ||
1012 | |||
1013 | /* | 992 | /* |
1014 | * Called when we want to stop a buffer from getting written or read. | 993 | * Called when we want to stop a buffer from getting written or read. |
1015 | * We attach the EIO error, muck with its flags, and call xfs_buf_ioend | 994 | * We attach the EIO error, muck with its flags, and call xfs_buf_ioend |
@@ -1079,14 +1058,7 @@ xfs_bioerror_relse( | |||
1079 | return EIO; | 1058 | return EIO; |
1080 | } | 1059 | } |
1081 | 1060 | ||
1082 | 1061 | STATIC int | |
1083 | /* | ||
1084 | * All xfs metadata buffers except log state machine buffers | ||
1085 | * get this attached as their b_bdstrat callback function. | ||
1086 | * This is so that we can catch a buffer | ||
1087 | * after prematurely unpinning it to forcibly shutdown the filesystem. | ||
1088 | */ | ||
1089 | int | ||
1090 | xfs_bdstrat_cb( | 1062 | xfs_bdstrat_cb( |
1091 | struct xfs_buf *bp) | 1063 | struct xfs_buf *bp) |
1092 | { | 1064 | { |
@@ -1107,6 +1079,27 @@ xfs_bdstrat_cb( | |||
1107 | return 0; | 1079 | return 0; |
1108 | } | 1080 | } |
1109 | 1081 | ||
1082 | int | ||
1083 | xfs_bwrite( | ||
1084 | struct xfs_buf *bp) | ||
1085 | { | ||
1086 | int error; | ||
1087 | |||
1088 | ASSERT(xfs_buf_islocked(bp)); | ||
1089 | |||
1090 | bp->b_flags |= XBF_WRITE; | ||
1091 | bp->b_flags &= ~(XBF_ASYNC | XBF_READ | _XBF_DELWRI_Q); | ||
1092 | |||
1093 | xfs_bdstrat_cb(bp); | ||
1094 | |||
1095 | error = xfs_buf_iowait(bp); | ||
1096 | if (error) { | ||
1097 | xfs_force_shutdown(bp->b_target->bt_mount, | ||
1098 | SHUTDOWN_META_IO_ERROR); | ||
1099 | } | ||
1100 | return error; | ||
1101 | } | ||
1102 | |||
1110 | /* | 1103 | /* |
1111 | * Wrapper around bdstrat so that we can stop data from going to disk in case | 1104 | * Wrapper around bdstrat so that we can stop data from going to disk in case |
1112 | * we are shutting down the filesystem. Typically user data goes thru this | 1105 | * we are shutting down the filesystem. Typically user data goes thru this |
@@ -1243,7 +1236,7 @@ xfs_buf_iorequest( | |||
1243 | */ | 1236 | */ |
1244 | atomic_set(&bp->b_io_remaining, 1); | 1237 | atomic_set(&bp->b_io_remaining, 1); |
1245 | _xfs_buf_ioapply(bp); | 1238 | _xfs_buf_ioapply(bp); |
1246 | _xfs_buf_ioend(bp, 0); | 1239 | _xfs_buf_ioend(bp, 1); |
1247 | 1240 | ||
1248 | xfs_buf_rele(bp); | 1241 | xfs_buf_rele(bp); |
1249 | } | 1242 | } |
diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index 7f1d1392ce37..79344c48008e 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h | |||
@@ -180,7 +180,6 @@ extern void xfs_buf_unlock(xfs_buf_t *); | |||
180 | extern int xfs_bwrite(struct xfs_buf *bp); | 180 | extern int xfs_bwrite(struct xfs_buf *bp); |
181 | 181 | ||
182 | extern void xfsbdstrat(struct xfs_mount *, struct xfs_buf *); | 182 | extern void xfsbdstrat(struct xfs_mount *, struct xfs_buf *); |
183 | extern int xfs_bdstrat_cb(struct xfs_buf *); | ||
184 | 183 | ||
185 | extern void xfs_buf_ioend(xfs_buf_t *, int); | 184 | extern void xfs_buf_ioend(xfs_buf_t *, int); |
186 | extern void xfs_buf_ioerror(xfs_buf_t *, int); | 185 | extern void xfs_buf_ioerror(xfs_buf_t *, int); |
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 45df2b857d48..d9e451115f98 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c | |||
@@ -954,7 +954,7 @@ xfs_buf_iodone_callbacks( | |||
954 | 954 | ||
955 | if (!XFS_BUF_ISSTALE(bp)) { | 955 | if (!XFS_BUF_ISSTALE(bp)) { |
956 | bp->b_flags |= XBF_WRITE | XBF_ASYNC | XBF_DONE; | 956 | bp->b_flags |= XBF_WRITE | XBF_ASYNC | XBF_DONE; |
957 | xfs_bdstrat_cb(bp); | 957 | xfs_buf_iorequest(bp); |
958 | } else { | 958 | } else { |
959 | xfs_buf_relse(bp); | 959 | xfs_buf_relse(bp); |
960 | } | 960 | } |
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 3a05a41b5d76..1f1535d25a9b 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c | |||
@@ -208,6 +208,7 @@ xfs_open_by_handle( | |||
208 | struct inode *inode; | 208 | struct inode *inode; |
209 | struct dentry *dentry; | 209 | struct dentry *dentry; |
210 | fmode_t fmode; | 210 | fmode_t fmode; |
211 | struct path path; | ||
211 | 212 | ||
212 | if (!capable(CAP_SYS_ADMIN)) | 213 | if (!capable(CAP_SYS_ADMIN)) |
213 | return -XFS_ERROR(EPERM); | 214 | return -XFS_ERROR(EPERM); |
@@ -252,8 +253,10 @@ xfs_open_by_handle( | |||
252 | goto out_dput; | 253 | goto out_dput; |
253 | } | 254 | } |
254 | 255 | ||
255 | filp = dentry_open(dentry, mntget(parfilp->f_path.mnt), | 256 | path.mnt = parfilp->f_path.mnt; |
256 | hreq->oflags, cred); | 257 | path.dentry = dentry; |
258 | filp = dentry_open(&path, hreq->oflags, cred); | ||
259 | dput(dentry); | ||
257 | if (IS_ERR(filp)) { | 260 | if (IS_ERR(filp)) { |
258 | put_unused_fd(fd); | 261 | put_unused_fd(fd); |
259 | return PTR_ERR(filp); | 262 | return PTR_ERR(filp); |
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index 1a25fd802798..9c4340f5c3e0 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c | |||
@@ -179,7 +179,7 @@ xfs_vn_create( | |||
179 | struct inode *dir, | 179 | struct inode *dir, |
180 | struct dentry *dentry, | 180 | struct dentry *dentry, |
181 | umode_t mode, | 181 | umode_t mode, |
182 | struct nameidata *nd) | 182 | bool flags) |
183 | { | 183 | { |
184 | return xfs_vn_mknod(dir, dentry, mode, 0); | 184 | return xfs_vn_mknod(dir, dentry, mode, 0); |
185 | } | 185 | } |
@@ -197,7 +197,7 @@ STATIC struct dentry * | |||
197 | xfs_vn_lookup( | 197 | xfs_vn_lookup( |
198 | struct inode *dir, | 198 | struct inode *dir, |
199 | struct dentry *dentry, | 199 | struct dentry *dentry, |
200 | struct nameidata *nd) | 200 | unsigned int flags) |
201 | { | 201 | { |
202 | struct xfs_inode *cip; | 202 | struct xfs_inode *cip; |
203 | struct xfs_name name; | 203 | struct xfs_name name; |
@@ -222,7 +222,7 @@ STATIC struct dentry * | |||
222 | xfs_vn_ci_lookup( | 222 | xfs_vn_ci_lookup( |
223 | struct inode *dir, | 223 | struct inode *dir, |
224 | struct dentry *dentry, | 224 | struct dentry *dentry, |
225 | struct nameidata *nd) | 225 | unsigned int flags) |
226 | { | 226 | { |
227 | struct xfs_inode *ip; | 227 | struct xfs_inode *ip; |
228 | struct xfs_name xname; | 228 | struct xfs_name xname; |