Re: [PATCH 19 of 23] Unionfs: Helper macros/inlines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Josef,

The names of some of these macros are somewhat unreadable.

On 10/7/06, Josef Jeff Sipek <[email protected]> wrote:
+/* Inode to private data */
+static inline struct unionfs_inode_info *itopd(const struct inode *inode)
+{
+       return
+           &(container_of(inode, struct unionfs_inode_container, vfs_inode)->
+             info);
+}

Rename to unionfs_inode?

+#define itohi_ptr(ino) (itopd(ino)->uii_inode)

unionfs_hidden_inodes ?

+#define ibstart(ino) (itopd(ino)->b_start)

unionfs_inode_branch_start ?

+#define ibend(ino) (itopd(ino)->b_end)

unionfs_inode_branch_end ?

+#define stopd(super) ((struct unionfs_sb_info *)(super)->s_fs_info)

unionfs_sb_info ?

+#define stopd_lhs(super) ((super)->s_fs_info)

This you should drop.

+#define sbstart(sb) 0

unionfs_sb_branch_start?

+#define sbend(sb) stopd(sb)->b_end

unionfs_sb_branch_end?

+#define sbmax(sb) (stopd(sb)->b_end + 1)

unionfs_sb_branch_max?

+#define ftopd(file) ((struct unionfs_file_info *)((file)->private_data))

unionfs_file_info ?

+#define ftopd_lhs(file) ((file)->private_data)

This you should drop.

+#define ftohf_ptr(file)  (ftopd(file)->ufi_file)

unionfs_hidden_files ?

+#define fbstart(file) (ftopd(file)->b_start)

unionfs_file_branch_start ?

+#define fbend(file) (ftopd(file)->b_end)

unionfs_file_branch_end ?

+
+/* File to hidden file. */
+static inline struct file *ftohf(struct file *f)
+{
+       return ftopd(f)->ufi_file[fbstart(f)];
+}

unionfs_hidden_file ?

+
+static inline struct file *ftohf_index(const struct file *f, int index)
+{
+       return ftopd(f)->ufi_file[index];
+}

__unionfs_hidden_file (and make the above use this too)?

+
+static inline void set_ftohf_index(struct file *f, int index, struct file *val)
+{
+       ftopd(f)->ufi_file[index] = val;
+}

__unionfs_set_hidden_file ?

+
+static inline void set_ftohf(struct file *f, struct file *val)
+{
+       ftopd(f)->ufi_file[fbstart(f)] = val;
+}

unionfs_set_hidden_file ?

[Same comments apply for the rest.]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux