diff options
author | Jiri Kosina <jkosina@suse.cz> | 2013-01-29 04:48:30 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-01-29 04:48:30 -0500 |
commit | 617677295b53a40d0e54aac4cbbc216ffbc755dd (patch) | |
tree | 51b9e87213243ed5efff252c8e8d8fec4eebc588 /fs/nfs/pnfs.c | |
parent | 5c8d1b68e01a144813e38795fe6dbe7ebb506131 (diff) | |
parent | 6abb7c25775b7fb2225ad0508236d63ca710e65f (diff) |
Merge branch 'master' into for-next
Conflicts:
drivers/devfreq/exynos4_bus.c
Sync with Linus' tree to be able to apply patches that are
against newer code (mvneta).
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r-- | fs/nfs/pnfs.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index fe624c91bd00..d00260b08103 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -254,7 +254,7 @@ static void | |||
254 | pnfs_layout_set_fail_bit(struct pnfs_layout_hdr *lo, int fail_bit) | 254 | pnfs_layout_set_fail_bit(struct pnfs_layout_hdr *lo, int fail_bit) |
255 | { | 255 | { |
256 | lo->plh_retry_timestamp = jiffies; | 256 | lo->plh_retry_timestamp = jiffies; |
257 | if (test_and_set_bit(fail_bit, &lo->plh_flags)) | 257 | if (!test_and_set_bit(fail_bit, &lo->plh_flags)) |
258 | atomic_inc(&lo->plh_refcount); | 258 | atomic_inc(&lo->plh_refcount); |
259 | } | 259 | } |
260 | 260 | ||
@@ -369,17 +369,6 @@ end_offset(u64 start, u64 len) | |||
369 | return end >= start ? end : NFS4_MAX_UINT64; | 369 | return end >= start ? end : NFS4_MAX_UINT64; |
370 | } | 370 | } |
371 | 371 | ||
372 | /* last octet in a range */ | ||
373 | static inline u64 | ||
374 | last_byte_offset(u64 start, u64 len) | ||
375 | { | ||
376 | u64 end; | ||
377 | |||
378 | BUG_ON(!len); | ||
379 | end = start + len; | ||
380 | return end > start ? end - 1 : NFS4_MAX_UINT64; | ||
381 | } | ||
382 | |||
383 | /* | 372 | /* |
384 | * is l2 fully contained in l1? | 373 | * is l2 fully contained in l1? |
385 | * start1 end1 | 374 | * start1 end1 |
@@ -645,7 +634,6 @@ send_layoutget(struct pnfs_layout_hdr *lo, | |||
645 | 634 | ||
646 | dprintk("--> %s\n", __func__); | 635 | dprintk("--> %s\n", __func__); |
647 | 636 | ||
648 | BUG_ON(ctx == NULL); | ||
649 | lgp = kzalloc(sizeof(*lgp), gfp_flags); | 637 | lgp = kzalloc(sizeof(*lgp), gfp_flags); |
650 | if (lgp == NULL) | 638 | if (lgp == NULL) |
651 | return NULL; | 639 | return NULL; |
@@ -925,8 +913,8 @@ pnfs_find_alloc_layout(struct inode *ino, | |||
925 | if (likely(nfsi->layout == NULL)) { /* Won the race? */ | 913 | if (likely(nfsi->layout == NULL)) { /* Won the race? */ |
926 | nfsi->layout = new; | 914 | nfsi->layout = new; |
927 | return new; | 915 | return new; |
928 | } | 916 | } else if (new != NULL) |
929 | pnfs_free_layout_hdr(new); | 917 | pnfs_free_layout_hdr(new); |
930 | out_existing: | 918 | out_existing: |
931 | pnfs_get_layout_hdr(nfsi->layout); | 919 | pnfs_get_layout_hdr(nfsi->layout); |
932 | return nfsi->layout; | 920 | return nfsi->layout; |
@@ -1126,7 +1114,6 @@ pnfs_update_layout(struct inode *ino, | |||
1126 | * chance of a CB_LAYOUTRECALL(FILE) coming in. | 1114 | * chance of a CB_LAYOUTRECALL(FILE) coming in. |
1127 | */ | 1115 | */ |
1128 | spin_lock(&clp->cl_lock); | 1116 | spin_lock(&clp->cl_lock); |
1129 | BUG_ON(!list_empty(&lo->plh_layouts)); | ||
1130 | list_add_tail(&lo->plh_layouts, &server->layouts); | 1117 | list_add_tail(&lo->plh_layouts, &server->layouts); |
1131 | spin_unlock(&clp->cl_lock); | 1118 | spin_unlock(&clp->cl_lock); |
1132 | } | 1119 | } |
@@ -1222,7 +1209,7 @@ pnfs_generic_pg_init_read(struct nfs_pageio_descriptor *pgio, struct nfs_page *r | |||
1222 | { | 1209 | { |
1223 | u64 rd_size = req->wb_bytes; | 1210 | u64 rd_size = req->wb_bytes; |
1224 | 1211 | ||
1225 | BUG_ON(pgio->pg_lseg != NULL); | 1212 | WARN_ON_ONCE(pgio->pg_lseg != NULL); |
1226 | 1213 | ||
1227 | if (req->wb_offset != req->wb_pgbase) { | 1214 | if (req->wb_offset != req->wb_pgbase) { |
1228 | nfs_pageio_reset_read_mds(pgio); | 1215 | nfs_pageio_reset_read_mds(pgio); |
@@ -1251,7 +1238,7 @@ void | |||
1251 | pnfs_generic_pg_init_write(struct nfs_pageio_descriptor *pgio, | 1238 | pnfs_generic_pg_init_write(struct nfs_pageio_descriptor *pgio, |
1252 | struct nfs_page *req, u64 wb_size) | 1239 | struct nfs_page *req, u64 wb_size) |
1253 | { | 1240 | { |
1254 | BUG_ON(pgio->pg_lseg != NULL); | 1241 | WARN_ON_ONCE(pgio->pg_lseg != NULL); |
1255 | 1242 | ||
1256 | if (req->wb_offset != req->wb_pgbase) { | 1243 | if (req->wb_offset != req->wb_pgbase) { |
1257 | nfs_pageio_reset_write_mds(pgio); | 1244 | nfs_pageio_reset_write_mds(pgio); |