diff options
Diffstat (limited to 'fs/locks.c')
-rw-r--r-- | fs/locks.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/fs/locks.c b/fs/locks.c index e0b6a80649a0..52a81005dab4 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -142,12 +142,12 @@ int lease_break_time = 45; | |||
142 | static LIST_HEAD(file_lock_list); | 142 | static LIST_HEAD(file_lock_list); |
143 | static LIST_HEAD(blocked_list); | 143 | static LIST_HEAD(blocked_list); |
144 | 144 | ||
145 | static kmem_cache_t *filelock_cache __read_mostly; | 145 | static struct kmem_cache *filelock_cache __read_mostly; |
146 | 146 | ||
147 | /* Allocate an empty lock structure. */ | 147 | /* Allocate an empty lock structure. */ |
148 | static struct file_lock *locks_alloc_lock(void) | 148 | static struct file_lock *locks_alloc_lock(void) |
149 | { | 149 | { |
150 | return kmem_cache_alloc(filelock_cache, SLAB_KERNEL); | 150 | return kmem_cache_alloc(filelock_cache, GFP_KERNEL); |
151 | } | 151 | } |
152 | 152 | ||
153 | static void locks_release_private(struct file_lock *fl) | 153 | static void locks_release_private(struct file_lock *fl) |
@@ -199,7 +199,7 @@ EXPORT_SYMBOL(locks_init_lock); | |||
199 | * Initialises the fields of the file lock which are invariant for | 199 | * Initialises the fields of the file lock which are invariant for |
200 | * free file_locks. | 200 | * free file_locks. |
201 | */ | 201 | */ |
202 | static void init_once(void *foo, kmem_cache_t *cache, unsigned long flags) | 202 | static void init_once(void *foo, struct kmem_cache *cache, unsigned long flags) |
203 | { | 203 | { |
204 | struct file_lock *lock = (struct file_lock *) foo; | 204 | struct file_lock *lock = (struct file_lock *) foo; |
205 | 205 | ||
@@ -321,7 +321,7 @@ static int flock_to_posix_lock(struct file *filp, struct file_lock *fl, | |||
321 | start = filp->f_pos; | 321 | start = filp->f_pos; |
322 | break; | 322 | break; |
323 | case SEEK_END: | 323 | case SEEK_END: |
324 | start = i_size_read(filp->f_dentry->d_inode); | 324 | start = i_size_read(filp->f_path.dentry->d_inode); |
325 | break; | 325 | break; |
326 | default: | 326 | default: |
327 | return -EINVAL; | 327 | return -EINVAL; |
@@ -371,7 +371,7 @@ static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl, | |||
371 | start = filp->f_pos; | 371 | start = filp->f_pos; |
372 | break; | 372 | break; |
373 | case SEEK_END: | 373 | case SEEK_END: |
374 | start = i_size_read(filp->f_dentry->d_inode); | 374 | start = i_size_read(filp->f_path.dentry->d_inode); |
375 | break; | 375 | break; |
376 | default: | 376 | default: |
377 | return -EINVAL; | 377 | return -EINVAL; |
@@ -672,7 +672,7 @@ posix_test_lock(struct file *filp, struct file_lock *fl, | |||
672 | struct file_lock *cfl; | 672 | struct file_lock *cfl; |
673 | 673 | ||
674 | lock_kernel(); | 674 | lock_kernel(); |
675 | for (cfl = filp->f_dentry->d_inode->i_flock; cfl; cfl = cfl->fl_next) { | 675 | for (cfl = filp->f_path.dentry->d_inode->i_flock; cfl; cfl = cfl->fl_next) { |
676 | if (!IS_POSIX(cfl)) | 676 | if (!IS_POSIX(cfl)) |
677 | continue; | 677 | continue; |
678 | if (posix_locks_conflict(cfl, fl)) | 678 | if (posix_locks_conflict(cfl, fl)) |
@@ -734,7 +734,7 @@ static int flock_lock_file(struct file *filp, struct file_lock *request) | |||
734 | { | 734 | { |
735 | struct file_lock *new_fl = NULL; | 735 | struct file_lock *new_fl = NULL; |
736 | struct file_lock **before; | 736 | struct file_lock **before; |
737 | struct inode * inode = filp->f_dentry->d_inode; | 737 | struct inode * inode = filp->f_path.dentry->d_inode; |
738 | int error = 0; | 738 | int error = 0; |
739 | int found = 0; | 739 | int found = 0; |
740 | 740 | ||
@@ -1018,7 +1018,7 @@ static int __posix_lock_file_conf(struct inode *inode, struct file_lock *request | |||
1018 | */ | 1018 | */ |
1019 | int posix_lock_file(struct file *filp, struct file_lock *fl) | 1019 | int posix_lock_file(struct file *filp, struct file_lock *fl) |
1020 | { | 1020 | { |
1021 | return __posix_lock_file_conf(filp->f_dentry->d_inode, fl, NULL); | 1021 | return __posix_lock_file_conf(filp->f_path.dentry->d_inode, fl, NULL); |
1022 | } | 1022 | } |
1023 | EXPORT_SYMBOL(posix_lock_file); | 1023 | EXPORT_SYMBOL(posix_lock_file); |
1024 | 1024 | ||
@@ -1033,7 +1033,7 @@ EXPORT_SYMBOL(posix_lock_file); | |||
1033 | int posix_lock_file_conf(struct file *filp, struct file_lock *fl, | 1033 | int posix_lock_file_conf(struct file *filp, struct file_lock *fl, |
1034 | struct file_lock *conflock) | 1034 | struct file_lock *conflock) |
1035 | { | 1035 | { |
1036 | return __posix_lock_file_conf(filp->f_dentry->d_inode, fl, conflock); | 1036 | return __posix_lock_file_conf(filp->f_path.dentry->d_inode, fl, conflock); |
1037 | } | 1037 | } |
1038 | EXPORT_SYMBOL(posix_lock_file_conf); | 1038 | EXPORT_SYMBOL(posix_lock_file_conf); |
1039 | 1039 | ||
@@ -1333,8 +1333,8 @@ int fcntl_getlease(struct file *filp) | |||
1333 | int type = F_UNLCK; | 1333 | int type = F_UNLCK; |
1334 | 1334 | ||
1335 | lock_kernel(); | 1335 | lock_kernel(); |
1336 | time_out_leases(filp->f_dentry->d_inode); | 1336 | time_out_leases(filp->f_path.dentry->d_inode); |
1337 | for (fl = filp->f_dentry->d_inode->i_flock; fl && IS_LEASE(fl); | 1337 | for (fl = filp->f_path.dentry->d_inode->i_flock; fl && IS_LEASE(fl); |
1338 | fl = fl->fl_next) { | 1338 | fl = fl->fl_next) { |
1339 | if (fl->fl_file == filp) { | 1339 | if (fl->fl_file == filp) { |
1340 | type = fl->fl_type & ~F_INPROGRESS; | 1340 | type = fl->fl_type & ~F_INPROGRESS; |
@@ -1359,7 +1359,7 @@ int fcntl_getlease(struct file *filp) | |||
1359 | static int __setlease(struct file *filp, long arg, struct file_lock **flp) | 1359 | static int __setlease(struct file *filp, long arg, struct file_lock **flp) |
1360 | { | 1360 | { |
1361 | struct file_lock *fl, **before, **my_before = NULL, *lease; | 1361 | struct file_lock *fl, **before, **my_before = NULL, *lease; |
1362 | struct dentry *dentry = filp->f_dentry; | 1362 | struct dentry *dentry = filp->f_path.dentry; |
1363 | struct inode *inode = dentry->d_inode; | 1363 | struct inode *inode = dentry->d_inode; |
1364 | int error, rdlease_count = 0, wrlease_count = 0; | 1364 | int error, rdlease_count = 0, wrlease_count = 0; |
1365 | 1365 | ||
@@ -1448,7 +1448,7 @@ out: | |||
1448 | 1448 | ||
1449 | int setlease(struct file *filp, long arg, struct file_lock **lease) | 1449 | int setlease(struct file *filp, long arg, struct file_lock **lease) |
1450 | { | 1450 | { |
1451 | struct dentry *dentry = filp->f_dentry; | 1451 | struct dentry *dentry = filp->f_path.dentry; |
1452 | struct inode *inode = dentry->d_inode; | 1452 | struct inode *inode = dentry->d_inode; |
1453 | int error; | 1453 | int error; |
1454 | 1454 | ||
@@ -1482,7 +1482,7 @@ EXPORT_SYMBOL(setlease); | |||
1482 | int fcntl_setlease(unsigned int fd, struct file *filp, long arg) | 1482 | int fcntl_setlease(unsigned int fd, struct file *filp, long arg) |
1483 | { | 1483 | { |
1484 | struct file_lock fl, *flp = &fl; | 1484 | struct file_lock fl, *flp = &fl; |
1485 | struct dentry *dentry = filp->f_dentry; | 1485 | struct dentry *dentry = filp->f_path.dentry; |
1486 | struct inode *inode = dentry->d_inode; | 1486 | struct inode *inode = dentry->d_inode; |
1487 | int error; | 1487 | int error; |
1488 | 1488 | ||
@@ -1692,7 +1692,7 @@ int fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd, | |||
1692 | if (copy_from_user(&flock, l, sizeof(flock))) | 1692 | if (copy_from_user(&flock, l, sizeof(flock))) |
1693 | goto out; | 1693 | goto out; |
1694 | 1694 | ||
1695 | inode = filp->f_dentry->d_inode; | 1695 | inode = filp->f_path.dentry->d_inode; |
1696 | 1696 | ||
1697 | /* Don't allow mandatory locks on files that may be memory mapped | 1697 | /* Don't allow mandatory locks on files that may be memory mapped |
1698 | * and shared. | 1698 | * and shared. |
@@ -1835,7 +1835,7 @@ int fcntl_setlk64(unsigned int fd, struct file *filp, unsigned int cmd, | |||
1835 | if (copy_from_user(&flock, l, sizeof(flock))) | 1835 | if (copy_from_user(&flock, l, sizeof(flock))) |
1836 | goto out; | 1836 | goto out; |
1837 | 1837 | ||
1838 | inode = filp->f_dentry->d_inode; | 1838 | inode = filp->f_path.dentry->d_inode; |
1839 | 1839 | ||
1840 | /* Don't allow mandatory locks on files that may be memory mapped | 1840 | /* Don't allow mandatory locks on files that may be memory mapped |
1841 | * and shared. | 1841 | * and shared. |
@@ -1922,7 +1922,7 @@ void locks_remove_posix(struct file *filp, fl_owner_t owner) | |||
1922 | * posix_lock_file(). Another process could be setting a lock on this | 1922 | * posix_lock_file(). Another process could be setting a lock on this |
1923 | * file at the same time, but we wouldn't remove that lock anyway. | 1923 | * file at the same time, but we wouldn't remove that lock anyway. |
1924 | */ | 1924 | */ |
1925 | if (!filp->f_dentry->d_inode->i_flock) | 1925 | if (!filp->f_path.dentry->d_inode->i_flock) |
1926 | return; | 1926 | return; |
1927 | 1927 | ||
1928 | lock.fl_type = F_UNLCK; | 1928 | lock.fl_type = F_UNLCK; |
@@ -1951,7 +1951,7 @@ EXPORT_SYMBOL(locks_remove_posix); | |||
1951 | */ | 1951 | */ |
1952 | void locks_remove_flock(struct file *filp) | 1952 | void locks_remove_flock(struct file *filp) |
1953 | { | 1953 | { |
1954 | struct inode * inode = filp->f_dentry->d_inode; | 1954 | struct inode * inode = filp->f_path.dentry->d_inode; |
1955 | struct file_lock *fl; | 1955 | struct file_lock *fl; |
1956 | struct file_lock **before; | 1956 | struct file_lock **before; |
1957 | 1957 | ||
@@ -2020,7 +2020,7 @@ static void lock_get_status(char* out, struct file_lock *fl, int id, char *pfx) | |||
2020 | struct inode *inode = NULL; | 2020 | struct inode *inode = NULL; |
2021 | 2021 | ||
2022 | if (fl->fl_file != NULL) | 2022 | if (fl->fl_file != NULL) |
2023 | inode = fl->fl_file->f_dentry->d_inode; | 2023 | inode = fl->fl_file->f_path.dentry->d_inode; |
2024 | 2024 | ||
2025 | out += sprintf(out, "%d:%s ", id, pfx); | 2025 | out += sprintf(out, "%d:%s ", id, pfx); |
2026 | if (IS_POSIX(fl)) { | 2026 | if (IS_POSIX(fl)) { |