Since Photoshop CS2 you are able to use ‘Smart Objects’ in your Photoshop projects.
Smart Objects are very useful if you want to perform nondestructive layer editing because Smart Objects preserve the source content and all original characteristics of an image. There’s only one disadvantage when working with Smart Objects: you can’t link Layer Masks to them so if you apply a Layer Mask to a Smart Object and move the entire layer around, the Layer Mask won’t be moved.
So there are different workarounds for this problem but you have to choose one certain way to preserve the dynamic data of a Smart Object. The first method would be applying a Layer Mask to a Smart Object and grouping the layer into a new Smart Object. Then you can move the entire Smart Object (inlcuding the Layer Mask) around — you should this method only if the size of your Smart Object is final because the new Smart Object doesn’t have the dynamic data of the dynamic data of the nested Smart Object so you can’t size up the Smart Object.
The second way but simply be rasterizing the Smart Object because rasterized objects can have linked Layer Masks.
In this case, all dynamic data is also lost by rasterizing. So this way isn’t the best solution. The third method should be your choice if you want to have linked Layer Masks on Smart Objects. The trick is very simple: just put the desired Smart Object into a Layer Set and apply the Layer Mask to the Layer Set. That’s all.
When you move the Layer Set around, the Smart Object and the Layer Mask will be moved.