|
@@ -194,14 +194,6 @@ struct file *alloc_file(struct path *path, fmode_t mode,
|
|
}
|
|
}
|
|
EXPORT_SYMBOL(alloc_file);
|
|
EXPORT_SYMBOL(alloc_file);
|
|
|
|
|
|
-void fput(struct file *file)
|
|
|
|
-{
|
|
|
|
- if (atomic_long_dec_and_test(&file->f_count))
|
|
|
|
- __fput(file);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-EXPORT_SYMBOL(fput);
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* drop_file_write_access - give up ability to write to a file
|
|
* drop_file_write_access - give up ability to write to a file
|
|
* @file: the file to which we will stop writing
|
|
* @file: the file to which we will stop writing
|
|
@@ -227,10 +219,9 @@ void drop_file_write_access(struct file *file)
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(drop_file_write_access);
|
|
EXPORT_SYMBOL_GPL(drop_file_write_access);
|
|
|
|
|
|
-/* __fput is called from task context when aio completion releases the last
|
|
|
|
- * last use of a struct file *. Do not use otherwise.
|
|
|
|
|
|
+/* the real guts of fput() - releasing the last reference to file
|
|
*/
|
|
*/
|
|
-void __fput(struct file *file)
|
|
|
|
|
|
+static void __fput(struct file *file)
|
|
{
|
|
{
|
|
struct dentry *dentry = file->f_path.dentry;
|
|
struct dentry *dentry = file->f_path.dentry;
|
|
struct vfsmount *mnt = file->f_path.mnt;
|
|
struct vfsmount *mnt = file->f_path.mnt;
|
|
@@ -268,6 +259,14 @@ void __fput(struct file *file)
|
|
mntput(mnt);
|
|
mntput(mnt);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void fput(struct file *file)
|
|
|
|
+{
|
|
|
|
+ if (atomic_long_dec_and_test(&file->f_count))
|
|
|
|
+ __fput(file);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+EXPORT_SYMBOL(fput);
|
|
|
|
+
|
|
struct file *fget(unsigned int fd)
|
|
struct file *fget(unsigned int fd)
|
|
{
|
|
{
|
|
struct file *file;
|
|
struct file *file;
|