Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lustre-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
debian-packages
lustre-release
Commits
b7549061
Commit
b7549061
authored
21 years ago
by
Wang Di
Browse files
Options
Downloads
Patches
Plain Diff
add loop_device_get_info.patch in snapfs series
parent
f907e2f2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lustre/kernel_patches/patches/loop_device_get_info.patch
+57
-0
57 additions, 0 deletions
lustre/kernel_patches/patches/loop_device_get_info.patch
lustre/kernel_patches/series/snapfs-2.4.20
+1
-0
1 addition, 0 deletions
lustre/kernel_patches/series/snapfs-2.4.20
with
58 additions
and
0 deletions
lustre/kernel_patches/patches/loop_device_get_info.patch
0 → 100644
+
57
−
0
View file @
b7549061
Index: linux-2.4.20-8/drivers/block/loop.c
===================================================================
--- linux-2.4.20-8.orig/drivers/block/loop.c 2002-11-29 07:53:12.000000000 +0800
+++ linux-2.4.20-8/drivers/block/loop.c 2004-01-10 00:02:33.000000000 +0800
@@ -843,6 +843,31 @@
}
return copy_to_user(arg, &info, sizeof(info)) ? -EFAULT : 0;
}
+static int loop_get_info(struct loop_device *lo, struct loop_info *arg)
+{
+ struct loop_info info;
+ struct file *file = lo->lo_backing_file;
+
+ if (lo->lo_state != Lo_bound)
+ return -ENXIO;
+ if (!arg)
+ return -EINVAL;
+ memset(&info, 0, sizeof(info));
+ info.lo_number = lo->lo_number;
+ info.lo_device = kdev_t_to_nr(file->f_dentry->d_inode->i_dev);
+ info.lo_inode = file->f_dentry->d_inode->i_ino;
+ info.lo_rdevice = kdev_t_to_nr(lo->lo_device);
+ info.lo_offset = lo->lo_offset;
+ info.lo_flags = lo->lo_flags;
+ strncpy(info.lo_name, lo->lo_name, LO_NAME_SIZE);
+ info.lo_encrypt_type = lo->lo_encrypt_type;
+ if (lo->lo_encrypt_key_size && capable(CAP_SYS_ADMIN)) {
+ info.lo_encrypt_key_size = lo->lo_encrypt_key_size;
+ memcpy(info.lo_encrypt_key, lo->lo_encrypt_key,
+ lo->lo_encrypt_key_size);
+ }
+ return memcpy(arg, &info, sizeof(info)) ? -EFAULT : 0;
+}
static int lo_ioctl(struct inode * inode, struct file * file,
unsigned int cmd, unsigned long arg)
@@ -875,6 +900,9 @@
case LOOP_GET_STATUS:
err = loop_get_status(lo, (struct loop_info *) arg);
break;
+ case LOOP_GET_INFO:
+ err = loop_get_info(lo, (struct loop_info *) arg);
+ break;
case BLKGETSIZE:
if (lo->lo_state != Lo_bound) {
err = -ENXIO;
Index: linux-2.4.20-8/include/linux/loop.h
===================================================================
--- linux-2.4.20-8.orig/include/linux/loop.h 2001-09-18 04:16:30.000000000 +0800
+++ linux-2.4.20-8/include/linux/loop.h 2004-01-09 23:50:17.000000000 +0800
@@ -151,5 +151,6 @@
#define LOOP_CLR_FD 0x4C01
#define LOOP_SET_STATUS 0x4C02
#define LOOP_GET_STATUS 0x4C03
+#define LOOP_GET_INFO 0x4C04
#endif
This diff is collapsed.
Click to expand it.
lustre/kernel_patches/series/snapfs-2.4.20
+
1
−
0
View file @
b7549061
...
...
@@ -49,4 +49,5 @@ ext3-trusted_ea-2.4.20.patch
kernel_text_address-2.4.20-vanilla.patch
ext3-xattr-ptr-arith-fix.patch
gfp_memalloc-2.4.22.patch
loop_device_get_info.patch
snapfs_core-2.4.20.patch
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment