diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-10-07 10:43:04 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-10-07 10:43:04 -0400 |
commit | a56e74f546b64be93731e42d83baf5b538cc1b11 (patch) | |
tree | 18f6dee45d801e57ac9db2a31664b0d5c0762c50 /fs/open.c | |
parent | d08e2e09042bd3f7ef66a35cb4bb92794ab26bb2 (diff) | |
parent | e4e7f10bfc4069925e99cc4b428c3434e30b6c3f (diff) |
Merge branch 'arm-aesbs' of git://git.linaro.org/people/ardbiesheuvel/linux-arm into devel-stable
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -744,14 +744,24 @@ cleanup_file: | |||
744 | 744 | ||
745 | /** | 745 | /** |
746 | * finish_open - finish opening a file | 746 | * finish_open - finish opening a file |
747 | * @od: opaque open data | 747 | * @file: file pointer |
748 | * @dentry: pointer to dentry | 748 | * @dentry: pointer to dentry |
749 | * @open: open callback | 749 | * @open: open callback |
750 | * @opened: state of open | ||
750 | * | 751 | * |
751 | * This can be used to finish opening a file passed to i_op->atomic_open(). | 752 | * This can be used to finish opening a file passed to i_op->atomic_open(). |
752 | * | 753 | * |
753 | * If the open callback is set to NULL, then the standard f_op->open() | 754 | * If the open callback is set to NULL, then the standard f_op->open() |
754 | * filesystem callback is substituted. | 755 | * filesystem callback is substituted. |
756 | * | ||
757 | * NB: the dentry reference is _not_ consumed. If, for example, the dentry is | ||
758 | * the return value of d_splice_alias(), then the caller needs to perform dput() | ||
759 | * on it after finish_open(). | ||
760 | * | ||
761 | * On successful return @file is a fully instantiated open file. After this, if | ||
762 | * an error occurs in ->atomic_open(), it needs to clean up with fput(). | ||
763 | * | ||
764 | * Returns zero on success or -errno if the open failed. | ||
755 | */ | 765 | */ |
756 | int finish_open(struct file *file, struct dentry *dentry, | 766 | int finish_open(struct file *file, struct dentry *dentry, |
757 | int (*open)(struct inode *, struct file *), | 767 | int (*open)(struct inode *, struct file *), |
@@ -772,11 +782,16 @@ EXPORT_SYMBOL(finish_open); | |||
772 | /** | 782 | /** |
773 | * finish_no_open - finish ->atomic_open() without opening the file | 783 | * finish_no_open - finish ->atomic_open() without opening the file |
774 | * | 784 | * |
775 | * @od: opaque open data | 785 | * @file: file pointer |
776 | * @dentry: dentry or NULL (as returned from ->lookup()) | 786 | * @dentry: dentry or NULL (as returned from ->lookup()) |
777 | * | 787 | * |
778 | * This can be used to set the result of a successful lookup in ->atomic_open(). | 788 | * This can be used to set the result of a successful lookup in ->atomic_open(). |
779 | * The filesystem's atomic_open() method shall return NULL after calling this. | 789 | * |
790 | * NB: unlike finish_open() this function does consume the dentry reference and | ||
791 | * the caller need not dput() it. | ||
792 | * | ||
793 | * Returns "1" which must be the return value of ->atomic_open() after having | ||
794 | * called this function. | ||
780 | */ | 795 | */ |
781 | int finish_no_open(struct file *file, struct dentry *dentry) | 796 | int finish_no_open(struct file *file, struct dentry *dentry) |
782 | { | 797 | { |