Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83389
b: refs/heads/master
c: 96c5865
h: refs/heads/master
i:
  83387: a97a169
v: v3
  • Loading branch information
David Woodhouse authored and Linus Torvalds committed Feb 6, 2008
1 parent d3a3dae commit 0075d73
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a3b81113fb6658629f4ebaabf8dd3067cd341020
refs/heads/master: 96c5865559cee0f9cbc5173f3c949f6ce3525581
8 changes: 8 additions & 0 deletions trunk/drivers/block/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,10 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info)
lo->transfer = xfer->transfer;
lo->ioctl = xfer->ioctl;

if ((lo->lo_flags & LO_FLAGS_AUTOCLEAR) !=
(info->lo_flags & LO_FLAGS_AUTOCLEAR))
lo->lo_flags ^= LO_FLAGS_AUTOCLEAR;

lo->lo_encrypt_key_size = info->lo_encrypt_key_size;
lo->lo_init[0] = info->lo_init[0];
lo->lo_init[1] = info->lo_init[1];
Expand Down Expand Up @@ -1331,6 +1335,10 @@ static int lo_release(struct inode *inode, struct file *file)

mutex_lock(&lo->lo_ctl_mutex);
--lo->lo_refcnt;

if ((lo->lo_flags & LO_FLAGS_AUTOCLEAR) && !lo->lo_refcnt)
loop_clr_fd(lo, inode->i_bdev);

mutex_unlock(&lo->lo_ctl_mutex);

return 0;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/loop.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ struct loop_device {
enum {
LO_FLAGS_READ_ONLY = 1,
LO_FLAGS_USE_AOPS = 2,
LO_FLAGS_AUTOCLEAR = 4,
};

#include <asm/posix_types.h> /* for __kernel_old_dev_t */
Expand Down

0 comments on commit 0075d73

Please sign in to comment.