diff options
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index fa04a00d126d..db11fdef0e92 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -2307,8 +2307,7 @@ static void cifs_invalidate_page(struct page *page, unsigned long offset) | |||
2307 | cifs_fscache_invalidate_page(page, &cifsi->vfs_inode); | 2307 | cifs_fscache_invalidate_page(page, &cifsi->vfs_inode); |
2308 | } | 2308 | } |
2309 | 2309 | ||
2310 | static void | 2310 | void cifs_oplock_break(struct work_struct *work) |
2311 | cifs_oplock_break(struct slow_work *work) | ||
2312 | { | 2311 | { |
2313 | struct cifsFileInfo *cfile = container_of(work, struct cifsFileInfo, | 2312 | struct cifsFileInfo *cfile = container_of(work, struct cifsFileInfo, |
2314 | oplock_break); | 2313 | oplock_break); |
@@ -2345,33 +2344,30 @@ cifs_oplock_break(struct slow_work *work) | |||
2345 | LOCKING_ANDX_OPLOCK_RELEASE, false); | 2344 | LOCKING_ANDX_OPLOCK_RELEASE, false); |
2346 | cFYI(1, "Oplock release rc = %d", rc); | 2345 | cFYI(1, "Oplock release rc = %d", rc); |
2347 | } | 2346 | } |
2347 | |||
2348 | /* | ||
2349 | * We might have kicked in before is_valid_oplock_break() | ||
2350 | * finished grabbing reference for us. Make sure it's done by | ||
2351 | * waiting for GlobalSMSSeslock. | ||
2352 | */ | ||
2353 | write_lock(&GlobalSMBSeslock); | ||
2354 | write_unlock(&GlobalSMBSeslock); | ||
2355 | |||
2356 | cifs_oplock_break_put(cfile); | ||
2348 | } | 2357 | } |
2349 | 2358 | ||
2350 | static int | 2359 | void cifs_oplock_break_get(struct cifsFileInfo *cfile) |
2351 | cifs_oplock_break_get(struct slow_work *work) | ||
2352 | { | 2360 | { |
2353 | struct cifsFileInfo *cfile = container_of(work, struct cifsFileInfo, | ||
2354 | oplock_break); | ||
2355 | mntget(cfile->mnt); | 2361 | mntget(cfile->mnt); |
2356 | cifsFileInfo_get(cfile); | 2362 | cifsFileInfo_get(cfile); |
2357 | return 0; | ||
2358 | } | 2363 | } |
2359 | 2364 | ||
2360 | static void | 2365 | void cifs_oplock_break_put(struct cifsFileInfo *cfile) |
2361 | cifs_oplock_break_put(struct slow_work *work) | ||
2362 | { | 2366 | { |
2363 | struct cifsFileInfo *cfile = container_of(work, struct cifsFileInfo, | ||
2364 | oplock_break); | ||
2365 | mntput(cfile->mnt); | 2367 | mntput(cfile->mnt); |
2366 | cifsFileInfo_put(cfile); | 2368 | cifsFileInfo_put(cfile); |
2367 | } | 2369 | } |
2368 | 2370 | ||
2369 | const struct slow_work_ops cifs_oplock_break_ops = { | ||
2370 | .get_ref = cifs_oplock_break_get, | ||
2371 | .put_ref = cifs_oplock_break_put, | ||
2372 | .execute = cifs_oplock_break, | ||
2373 | }; | ||
2374 | |||
2375 | const struct address_space_operations cifs_addr_ops = { | 2371 | const struct address_space_operations cifs_addr_ops = { |
2376 | .readpage = cifs_readpage, | 2372 | .readpage = cifs_readpage, |
2377 | .readpages = cifs_readpages, | 2373 | .readpages = cifs_readpages, |